diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-08-11 23:17:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 23:17:28 +0300 |
commit | 94067ef2a0d9ac5c2aa5f45eca5366a2251ac04a (patch) | |
tree | 51e502c7d1be7c8ad2179daf2f5c9bfd27911636 /src/components/UserStrip | |
parent | c6723fa8a2a303f356b1756b45b2190203c96582 (diff) | |
parent | b5ce9be31993f5b4bee9abbe57d775b7ea407507 (diff) | |
download | which-ui-94067ef2a0d9ac5c2aa5f45eca5366a2251ac04a.tar.gz |
Merge pull request #76 from which-ecosystem/redesign
Initial header redesign
Diffstat (limited to 'src/components/UserStrip')
-rw-r--r-- | src/components/UserStrip/UserStrip.tsx | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/components/UserStrip/UserStrip.tsx b/src/components/UserStrip/UserStrip.tsx index 73d9363..a837961 100644 --- a/src/components/UserStrip/UserStrip.tsx +++ b/src/components/UserStrip/UserStrip.tsx @@ -1,10 +1,11 @@ import React from 'react'; -import { useHistory } from 'react-router-dom'; import { makeStyles } from '@material-ui/core/styles'; import VerifiedIcon from '@material-ui/icons/CheckCircleOutline'; -import { Avatar, CardHeader } from '@material-ui/core/'; +import { CardHeader } from '@material-ui/core/'; import { User } from 'which-types'; +import Avatar from '../Avatar/Avatar'; + interface PropTypes { user: User; @@ -21,30 +22,15 @@ const useStyles = makeStyles(theme => ({ marginLeft: theme.spacing(0.5), width: theme.spacing(2), height: theme.spacing(2) - }, - avatar: { - cursor: 'pointer' } })); const UserStrip: React.FC<PropTypes> = ({ user, info }) => { const classes = useStyles(); - const history = useHistory(); - const { username, avatarUrl, verified } = user; - - const handleNavigate = () => { - history.push(`/profile/${username}`); - }; - - const avatar = ( - <Avatar - src={avatarUrl} - alt={username[0].toUpperCase()} - onClick={handleNavigate} - className={classes.avatar} - /> - ); + const { username, verified } = user; + + const avatar = <Avatar user={user} />; const title = ( <div className={classes.root}> |