import React from 'react';
import { Button, Container, Nav, Navbar } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';
-import { withTranslation } from 'react-i18next';
+import { useTranslation } from 'react-i18next';
import Icon from './Icon';
import LanguageSwitcher from './LanguageSwitcher';
import { getAvatarUrl } from '../../helpers/User';
import { withUser } from '../../helpers/UserContext';
-import i18n from '../../i18n';
-const Header = ({ doLogout, user }) =>
- <Navbar id="header" bg="dark" variant="dark">
+const Header = ({ doLogout, user }) => {
+ const { t } = useTranslation();
+
+ return <Navbar id="header" bg="dark" variant="dark">
<Container fluid>
<LinkContainer to="/">
<Navbar.Brand>
</Nav.Link>
</LinkContainer>
</Nav>
- <Navbar.Text className="ms-auto me-2">
+ <Nav className="ms-auto">
+ <LinkContainer to="/tech">
+ <Nav.Link href="/tech">
+ {t('menu.tech')}
+ </Nav.Link>
+ </LinkContainer>
+ <LinkContainer to="/map">
+ <Nav.Link href="/map">
+ {t('menu.map')}
+ </Nav.Link>
+ </LinkContainer>
+ </Nav>
+ <Navbar.Text className="mx-2">
<LanguageSwitcher />
</Navbar.Text>
<Nav>
</LinkContainer>
<Button
onClick={doLogout}
- title={i18n.t('button.logout')}
+ title={t('button.logout')}
variant="outline-secondary"
>
<Icon.LOGOUT title="" />
>
<Icon.DISCORD />
{' '}
- {i18n.t('button.login')}
+ {t('button.login')}
</Button>
}
</Nav>
</Container>
- </Navbar>
-;
+ </Navbar>;
+};
Header.propTypes = {
doLogout: PropTypes.func,
}),
};
-export default withTranslation()(withUser(Header));
+export default withUser(Header);
connect: 'Connect Spedruns Discord',
contact: 'Wenn du gerne ein Turnier auf dieser Seite organisieren möchtest, wende dich bitte an HolySmoke#5229 im Discord.',
info: 'Infos',
+ map: 'ALttP Karte',
privacy: 'Datenschutz',
resources: 'Ressourcen',
smd: 'Deutscher Super Metroid Discord',
smwiki: 'Super Metroid Speedrunning Wiki',
+ tech: 'ALttP Techniken',
},
general: {
anonymous: 'Anonym',
uwLong: 'Underworld',
uwShort: 'UW',
},
+ menu: {
+ map: 'Karte',
+ tech: 'Techniken',
+ },
modes: {
heading: 'Modi',
},
connect: 'Connect Spedruns Discord',
contact: 'If you would like to organize a Tournament on this site, please contact HolySmoke#5229 on Discord.',
info: 'Infos',
+ map: 'ALttP Map',
privacy: 'Privacy',
resources: 'Resources',
smd: 'German Super Metroid Discord',
smwiki: 'Super Metroid Speedrunning Wiki',
+ tech: 'ALttP Tech',
},
general: {
anonymous: 'Anonym',
uwLong: 'Underworld',
uwShort: 'UW',
},
+ menu: {
+ map: 'Map',
+ tech: 'Tech',
+ },
modes: {
heading: 'Modes',
},