Download react-spring/docs/app/components/Header/HeaderSubNavigation.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-spring/docs/app/components/Header/HeaderSubNavigation.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-spring/docs/app/components/Header/HeaderSubNavigation.tsx
-
curl -L -o HeaderSubNavigation.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-spring/docs/app/components/Header/HeaderSubNavigation.tsx
1.23 kB
| import { DiscordLogo, GithubLogo, Lifebuoy } from 'phosphor-react' | |
| import { EventNames, firePlausibleEvent } from '~/helpers/analytics' | |
| import { NavigationButton, NavigationButtonProps } from '../Buttons/NavButton' | |
| const SUB_NAV: NavigationButtonProps[] = [ | |
| { | |
| title: 'Github', | |
| href: 'https://github.com/pmndrs/react-spring', | |
| isExternal: true, | |
| Icon: GithubLogo, | |
| }, | |
| { | |
| title: 'Discord', | |
| href: 'https://discord.com/invite/poimandres', | |
| isExternal: true, | |
| Icon: DiscordLogo, | |
| }, | |
| { | |
| title: 'Support', | |
| href: 'https://opencollective.com/react-spring', | |
| isExternal: true, | |
| Icon: Lifebuoy, | |
| }, | |
| ] | |
| export interface HeaderSubNavigationProps { | |
| showLabels?: boolean | |
| } | |
| export const HeaderSubNavigation = ({ | |
| showLabels = false, | |
| }: HeaderSubNavigationProps) => { | |
| const handleClick = (label: string) => () => { | |
| firePlausibleEvent({ | |
| name: EventNames.OutboundLink, | |
| additionalProps: { | |
| linkTitle: label, | |
| }, | |
| }) | |
| } | |
| return ( | |
| <> | |
| {SUB_NAV.map(props => ( | |
| <NavigationButton | |
| key={props.title} | |
| showLabel={showLabels} | |
| onClick={handleClick(props.title)} | |
| {...props} | |
| /> | |
| ))} | |
| </> | |
| ) | |
| } | |