1
0
mirror of synced 2026-01-04 09:06:46 -05:00
Files
docs/components/sidebar/SidebarNav.tsx
Kevin Heis 9f7c20dae8 Upgrade Primer CSS to version 17, removing marketing styles (#20965)
* Package updates

* Fix up things that look broken

* Add to utils

* Lead now just sets font size, just use f3 where needed

* Update package-lock.json

* Update index.tsx

* Delete bump-link.scss

* Update trigger-error.js

* Update components/GenericError.tsx

Co-authored-by: Ash Guillaume <10384315+ashygee@users.noreply.github.com>

* Update ArticlePage.tsx

* Update ActionBar.tsx

* Changes from meeting

* Found a few more monos

* Fix from a merge conflict

* Missed a few f3s

* Update SubLandingHero.tsx

* Bye gradients

* Match up breadcrumbs

* Update SubLandingHero.tsx

* Update lists.scss

Co-authored-by: Ash Guillaume <10384315+ashygee@users.noreply.github.com>
2021-08-31 14:49:39 -07:00

47 lines
1.4 KiB
TypeScript

import { useRouter } from 'next/router'
import { MarkGithubIcon } from '@primer/octicons-react'
import { Link } from 'components/Link'
import { useTranslation } from 'components/hooks/useTranslation'
import { useMainContext } from 'components/context/MainContext'
import { SidebarProduct } from './SidebarProduct'
import { SidebarHomepage } from './SidebarHomepage'
export const SidebarNav = () => {
const router = useRouter()
const { error, relativePath } = useMainContext()
const { t } = useTranslation('header')
return (
<div
className="d-none d-lg-block color-bg-tertiary position-sticky top-0 overflow-y-auto flex-shrink-0 pb-5"
style={{ width: 286, height: '100vh' }}
>
<div
className="d-flex flex-items-center p-4 position-sticky top-0 color-bg-tertiary"
style={{ zIndex: 3 }}
id="github-logo"
role="banner"
>
<Link
href={`/${router.locale}`}
className="color-text-primary"
aria-hidden="true"
tabIndex={-1}
>
<MarkGithubIcon size={32} />
</Link>
<Link
href={`/${router.locale}`}
className="f4 font-weight-semibold color-text-primary no-underline no-wrap pl-2 flex-auto"
>
{t('github_docs')}
</Link>
</div>
<nav>
{error === '404' || relativePath === 'index.md' ? <SidebarHomepage /> : <SidebarProduct />}
</nav>
</div>
)
}