1
0
mirror of synced 2025-12-23 11:54:18 -05:00
Files
docs/components/sidebar/AllProductsLink.tsx
Grace Park ef2efb0636 Feature Branch: Global Nav Phase 1 (#33465)
Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>
Co-authored-by: Joe Oak <41307427+joeoak@users.noreply.github.com>
Co-authored-by: Peter Bengtsson <peterbe@github.com>
2023-01-31 17:49:50 +00:00

23 lines
707 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 (
<li className="mt-3">
<Link
href={`/${router.locale}${currentVersionPathSegment}`}
className="f6 pl-4 pr-5 ml-n1 pb-1 color-fg-default"
>
<ArrowLeftIcon size="small" className="mr-1" />
All products
</Link>
</li>
)
}