blob: 027f0766b1b6cafeff35c39ce78bb260fbf6edfd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
import React from 'react';
import { Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import { User } from 'which-types';
import Avatar from '../Avatar/Avatar';
interface PropTypes {
user: User;
}
const useStyles = makeStyles(theme => ({
root: {
padding: theme.spacing(4, 10),
textAlign: 'center'
},
avatar: {
width: theme.spacing(14),
height: theme.spacing(14)
}
}));
const UserInfo: React.FC<PropTypes> = React.memo(({ user }) => {
const classes = useStyles();
return (
<div className={classes.root}>
<Avatar user={user} className={classes.avatar} />
<Typography variant="h5">
{user.username}
</Typography>
</div>
);
});
export default UserInfo;
|