1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button, Col, Container, Row } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import Box from './Box';
7 import Records from './Records';
8 import EditNicknameButton from './EditNicknameButton';
9 import EditStreamLinkButton from './EditStreamLinkButton';
10 import Participation from './Participation';
11 import Icon from '../common/Icon';
12 import i18n from '../../i18n';
14 const Profile = ({ user }) => <Container>
16 {user.nickname || user.username}
18 <EditNicknameButton user={user} />
21 <Col md={6} className="mb-5">
22 <h2>{i18n.t('users.discordTag')}</h2>
23 <Box discriminator user={user} />
25 <Col md={6} className="mb-5">
26 <h2>{i18n.t('users.streamLink')}</h2>
30 href={user.stream_link}
32 variant="outline-twitch"
39 i18n.t('users.noStream')
42 <EditStreamLinkButton user={user} />
45 <Col md={6} className="mb-5">
46 <h2>{i18n.t('users.tournamentRecords')}</h2>
48 first={user.tournament_first_count}
49 second={user.tournament_second_count}
50 third={user.tournament_third_count}
53 <Col md={6} className="mb-5">
54 <h2>{i18n.t('users.roundRecords')}</h2>
56 first={user.round_first_count}
57 second={user.round_second_count}
58 third={user.round_third_count}
61 <Col md={12} className="mb-5">
62 <h2>{i18n.t('users.tournaments')}</h2>
63 <Participation user={user} />
69 user: PropTypes.shape({
70 nickname: PropTypes.string,
71 participation: PropTypes.arrayOf(PropTypes.shape({
73 round_first_count: PropTypes.number,
74 round_second_count: PropTypes.number,
75 round_third_count: PropTypes.number,
76 stream_link: PropTypes.string,
77 tournament_first_count: PropTypes.number,
78 tournament_second_count: PropTypes.number,
79 tournament_third_count: PropTypes.number,
80 username: PropTypes.string,
84 export default withTranslation()(Profile);