1 import React from 'react';
2 import { Button, Nav } from 'react-bootstrap';
3 import { LinkContainer } from 'react-router-bootstrap';
4 import { useTranslation } from 'react-i18next';
6 import Icon from '../components/common/Icon';
7 import { useUser } from '../hooks/user';
8 import { getAvatarUrl } from '../helpers/User';
11 const { t } = useTranslation();
12 const { logout, user } = useUser();
16 <Nav className="ms-auto">
17 <LinkContainer to={`/users/${user.id}`}>
19 <img alt="" src={getAvatarUrl(user)} />
21 {user.discriminator && user.discriminator !== '0' ?
22 <span className="text-muted">#{user.discriminator}</span>
30 title={t('button.logout')}
31 variant="outline-secondary"
33 <Icon.LOGOUT title="" />
40 if (location.pathname.length > 1) {
41 localStorage.setItem('returnPath', location.pathname.substr(1));
44 title={t('button.login')}