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 BaseRomButton from './BaseRomButton';
8 import LanguageSwitcher from '../app/LanguageSwitcher';
9 import Icon from '../common/Icon';
10 import { getAvatarUrl } from '../../helpers/User';
11 import { withUser } from '../../helpers/UserContext';
12 import i18n from '../../i18n';
14 const Header = ({ doLogout, user }) =>
15 <Navbar id="header" bg="dark" variant="dark">
17 <LinkContainer to="/">
22 <Navbar.Text className="ms-auto me-2 button-bar">
29 <LinkContainer to={`/users/${user.id}`}>
31 <img alt="" src={getAvatarUrl(user)} />
33 <span className="text-muted">#{user.discriminator}</span>
38 title={i18n.t('button.logout')}
39 variant="outline-secondary"
41 <Icon.LOGOUT title="" />
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));