Download web/src/components/Header.tsx from bisheng13/nofx13: direct link, hf CLI and curl.
- Browser
- Download file 2.19 kB
-
https://huggingface.co/spaces/bisheng13/nofx13/resolve/main/web/src/components/Header.tsx
- Command line
-
hf download hf://spaces/bisheng13/nofx13/web/src/components/Header.tsx
-
curl -L -o Header.tsx https://huggingface.co/spaces/bisheng13/nofx13/resolve/main/web/src/components/Header.tsx
2.19 kB
| import { useLanguage } from '../contexts/LanguageContext' | |
| import { t } from '../i18n/translations' | |
| import { Container } from './Container' | |
| interface HeaderProps { | |
| simple?: boolean // For login/register pages | |
| } | |
| export function Header({ simple = false }: HeaderProps) { | |
| const { language, setLanguage } = useLanguage() | |
| return ( | |
| <header className="glass sticky top-0 z-50 backdrop-blur-xl"> | |
| <Container className="py-4"> | |
| <div className="flex items-center justify-between"> | |
| {/* Left - Logo and Title */} | |
| <div className="flex items-center gap-3"> | |
| <div className="flex items-center justify-center"> | |
| <img src="/icons/nofx.svg" alt="NoFx Logo" className="w-8 h-8" /> | |
| </div> | |
| <div> | |
| <h1 className="text-xl font-bold" style={{ color: '#EAECEF' }}> | |
| {t('appTitle', language)} | |
| </h1> | |
| {!simple && ( | |
| <p className="text-xs mono" style={{ color: '#848E9C' }}> | |
| {t('subtitle', language)} | |
| </p> | |
| )} | |
| </div> | |
| </div> | |
| {/* Right - Language Toggle (always show) */} | |
| <div | |
| className="flex gap-1 rounded p-1" | |
| style={{ background: '#1E2329' }} | |
| > | |
| <button | |
| onClick={() => setLanguage('zh')} | |
| className="px-3 py-1.5 rounded text-xs font-semibold transition-all" | |
| style={ | |
| language === 'zh' | |
| ? { background: '#F0B90B', color: '#000' } | |
| : { background: 'transparent', color: '#848E9C' } | |
| } | |
| > | |
| 中文 | |
| </button> | |
| <button | |
| onClick={() => setLanguage('en')} | |
| className="px-3 py-1.5 rounded text-xs font-semibold transition-all" | |
| style={ | |
| language === 'en' | |
| ? { background: '#F0B90B', color: '#000' } | |
| : { background: 'transparent', color: '#848E9C' } | |
| } | |
| > | |
| EN | |
| </button> | |
| </div> | |
| </div> | |
| </Container> | |
| </header> | |
| ) | |
| } | |