1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button, Container, Nav, Navbar } from 'react-bootstrap';
4 import { LinkContainer } from 'react-router-bootstrap';
5 import { withTranslation } from 'react-i18next';
7 import Icon from './Icon';
8 import LanguageSwitcher from './LanguageSwitcher';
9 import { getAvatarUrl } from '../../helpers/User';
10 import { withUser } from '../../helpers/UserContext';
11 import i18n from '../../i18n';
13 const Header = ({ doLogout, user }) =>
14 <Navbar id="header" bg="dark" variant="dark">
16 <LinkContainer to="/">
21 <Navbar.Text className="ms-auto me-2">
27 <LinkContainer to={`/users/${user.id}`}>
29 <img alt="" src={getAvatarUrl(user)} />
31 <span className="text-muted">#{user.discriminator}</span>
36 title={i18n.t('button.logout')}
37 variant="outline-secondary"
39 <Icon.LOGOUT title="" />
43 <Button href="/login" variant="discord">
46 {i18n.t('button.login')}
55 doLogout: PropTypes.func,
56 user: PropTypes.shape({
57 avatar: PropTypes.string,
58 discriminator: PropTypes.string,
60 username: PropTypes.string,
64 export default withTranslation()(withUser(Header));