]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/users/Profile.js
f38ba2f3d8830b8447a3ecbf5b9bfe8802f9446e
[alttp.git] / resources / js / components / users / Profile.js
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';
5
6 import Box from './Box';
7 import EditStreamLinkButton from './EditStreamLinkButton';
8 import Icon from '../common/Icon';
9 import i18n from '../../i18n';
10
11 const Profile = ({ user }) => <Container>
12         <h1>{user.username}</h1>
13         <Row>
14                 <Col md={6}>
15                         <h2>{i18n.t('users.discordTag')}</h2>
16                         <Box discriminator user={user} />
17                 </Col>
18                 <Col md={6}>
19                         <h2>{i18n.t('users.streamLink')}</h2>
20                         <p>
21                                 {user.stream_link ?
22                                         <Button
23                                                 href={user.stream_link}
24                                                 target="_blank"
25                                                 variant="outline-twitch"
26                                         >
27                                                 <Icon.STREAM />
28                                                 {' '}
29                                                 {user.stream_link}
30                                         </Button>
31                                 :
32                                         i18n.t('users.noStream')
33                                 }
34                                 {' '}
35                                 <EditStreamLinkButton user={user} />
36                         </p>
37                 </Col>
38         </Row>
39 </Container>;
40
41 Profile.propTypes = {
42         user: PropTypes.shape({
43                 stream_link: PropTypes.string,
44                 username: PropTypes.string,
45         }),
46 };
47
48 export default withTranslation()(Profile);