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 { getAvatarUrl } from '../../helpers/User';
9 import { withUser } from '../../helpers/UserContext';
10 import i18n from '../../i18n';
12 const Header = ({ doLogout, user }) =>
13 <Navbar id="header" bg="dark" variant="dark">
15 <LinkContainer to="/">
20 <Nav className="ms-auto">
23 <LinkContainer to={`/users/${user.id}`}>
25 <img alt="" src={getAvatarUrl(user)} />
27 <span className="text-muted">#{user.discriminator}</span>
32 title={i18n.t('button.logout')}
33 variant="outline-secondary"
35 <Icon.LOGOUT title="" />
39 <Button href="/login" variant="discord">
42 {i18n.t('button.login')}
51 doLogout: PropTypes.func,
52 user: PropTypes.shape({
53 avatar: PropTypes.string,
54 discriminator: PropTypes.string,
56 username: PropTypes.string,
60 export default withTranslation()(withUser(Header));