1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Alert, 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} />
20 {user.random_quote && user.random_quote.comment ?
21 <Alert className="quote-alert" variant="dark">
22 <blockquote className="blockquote mb-0">
23 {user.random_quote.comment}
28 <Col md={6} className="mb-5">
29 <h2>{i18n.t('users.discordTag')}</h2>
30 <Box discriminator user={user} />
32 <Col md={6} className="mb-5">
33 <h2>{i18n.t('users.streamLink')}</h2>
37 href={user.stream_link}
39 variant="outline-twitch"
46 i18n.t('users.noStream')
49 <EditStreamLinkButton user={user} />
52 <Col md={6} className="mb-5">
53 <h2>{i18n.t('users.tournamentRecords')}</h2>
55 first={user.tournament_first_count}
56 second={user.tournament_second_count}
57 third={user.tournament_third_count}
60 <Col md={6} className="mb-5">
61 <h2>{i18n.t('users.roundRecords')}</h2>
63 first={user.round_first_count}
64 second={user.round_second_count}
65 third={user.round_third_count}
68 <Col md={12} className="mb-5">
69 <h2>{i18n.t('users.tournaments')}</h2>
70 <Participation user={user} />
76 user: PropTypes.shape({
77 nickname: PropTypes.string,
78 participation: PropTypes.arrayOf(PropTypes.shape({
80 random_quote: PropTypes.shape({
81 comment: PropTypes.string,
83 round_first_count: PropTypes.number,
84 round_second_count: PropTypes.number,
85 round_third_count: PropTypes.number,
86 stream_link: PropTypes.string,
87 tournament_first_count: PropTypes.number,
88 tournament_second_count: PropTypes.number,
89 tournament_third_count: PropTypes.number,
90 username: PropTypes.string,
94 export default withTranslation()(Profile);