1
0
mirror of synced 2026-01-07 00:01:39 -05:00
Files
docs/components/sidebar/AllProductsLink.tsx
Robert Sese e5370a5990 Feature Branch: Global Nav Phase 2 (#34359)
Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: Joe Oak <41307427+joeoak@users.noreply.github.com>
2023-02-13 17:37:47 +00:00

23 lines
723 B
TypeScript

import { useRouter } from 'next/router'
import { ArrowLeftIcon } from '@primer/octicons-react'
import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion'
import { Link } from 'components/Link'
export const AllProductsLink = () => {
const router = useRouter()
const { currentVersion } = useVersion()
const currentVersionPathSegment = currentVersion === DEFAULT_VERSION ? '' : `/${currentVersion}`
return (
<div className="mt-3">
<Link
href={`/${router.locale}${currentVersionPathSegment}`}
className="f6 pl-2 pr-5 ml-n1 pb-1 Link--primary color-fg-default"
>
<ArrowLeftIcon size="small" className="mr-1" />
All products
</Link>
</div>
)
}