Download code/frontend/apps/web/src/components/site-header.tsx from Jiali9/Affect-Atlas: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/Jiali9/Affect-Atlas/resolve/main/code/frontend/apps/web/src/components/site-header.tsx
- Command line
-
hf download hf://Jiali9/Affect-Atlas/code/frontend/apps/web/src/components/site-header.tsx
-
curl -L -o site-header.tsx https://huggingface.co/Jiali9/Affect-Atlas/resolve/main/code/frontend/apps/web/src/components/site-header.tsx
2.01 kB
| import { Link, useLocation } from '@tanstack/react-router' | |
| import { AudioLines, FlaskConical } from 'lucide-react' | |
| import { useTranslation } from 'react-i18next' | |
| import { Badge } from '@workspace/ui/components/badge' | |
| export function SiteLinks() { | |
| const { t } = useTranslation() | |
| const atRoot = useLocation({ select: location => location.pathname === '/' }) | |
| return <> | |
| <Link to="/home" className="nav-link" activeOptions={{ exact: true }} viewTransition>{t('nav.home')}</Link> | |
| <Link to={atRoot ? '/' : '/demo'} className="nav-link" activeOptions={{ exact: true }} viewTransition>{t('nav.demo')}</Link> | |
| {/* Retain the existing URLs until these sections have app routes. */} | |
| <a href="/gallery" className="nav-link">{t('nav.gallery')}</a> | |
| <a href="/research" className="nav-link">{t('nav.research')}</a> | |
| <a href="/about" className="nav-link">{t('nav.about')}</a> | |
| </> | |
| } | |
| export default function SiteHeader() { | |
| const { t, i18n } = useTranslation() | |
| const chinese = i18n.resolvedLanguage === 'zh' | |
| return <header className="site-header"> | |
| <div className="header-inner"> | |
| <div className="brand"><div className="brand-symbol"><AudioLines size={22} /></div><div><strong>{t('nav.brand')}</strong><span>{t('nav.subtitle')}</span></div></div> | |
| <nav className="header-nav"><SiteLinks /></nav> | |
| <div className="header-tools"> | |
| <button | |
| type="button" | |
| className="language-toggle" | |
| role="switch" | |
| aria-checked={chinese} | |
| aria-label={t('nav.chinese')} | |
| onClick={() => void i18n.changeLanguage(chinese ? 'en' : 'zh')} | |
| > | |
| <span aria-hidden="true" className="language-thumb" /> | |
| <span aria-hidden="true" lang="en">EN</span> | |
| <span aria-hidden="true" className="language-zh">{t('nav.chineseShort')}</span> | |
| </button> | |
| <Badge variant="outline" className="research-badge"><FlaskConical size={13} /> {t('nav.researchBadge')}</Badge> | |
| </div> | |
| </div> | |
| </header> | |
| } | |