diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-06-30 01:47:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 01:47:27 +0300 |
commit | 720a32c4cb1697f3a8f90973f28c334551ab87ff (patch) | |
tree | c9028ea3ff850774d33cbc510eb19dd0e9f7aade /src/components/UserStrip | |
parent | b301bf24c5037403a1e5fc32fc8c10794941b528 (diff) | |
parent | e170d04d5d2c8c86d2683f3accb4feb2d94c881a (diff) | |
download | which-ui-720a32c4cb1697f3a8f90973f28c334551ab87ff.tar.gz |
Merge pull request #54 from which-ecosystem/hooks
Use hooks logic
Diffstat (limited to 'src/components/UserStrip')
-rw-r--r-- | src/components/UserStrip/UserStrip.tsx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/components/UserStrip/UserStrip.tsx b/src/components/UserStrip/UserStrip.tsx index f02adc3..3ac47b3 100644 --- a/src/components/UserStrip/UserStrip.tsx +++ b/src/components/UserStrip/UserStrip.tsx @@ -1,16 +1,13 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import VerifiedIcon from '@material-ui/icons/CheckCircleOutline'; -import { - Avatar, - CardHeader -} from '@material-ui/core/'; +import { Avatar, CardHeader } from '@material-ui/core/'; import { User } from 'which-types'; +import { useNavigate } from '../../hooks/useNavigate'; interface PropTypes { user: User; - navigate: (prefix: string, id: string) => void; info?: string | JSX.Element } @@ -31,13 +28,10 @@ const useStyles = makeStyles(theme => ({ })); -const UserStrip: React.FC<PropTypes> = ({ user, info, navigate }) => { +const UserStrip: React.FC<PropTypes> = ({ user, info }) => { const classes = useStyles(); - const { - username, - avatarUrl, - verified - } = user; + const { navigate } = useNavigate(); + const { username, avatarUrl, verified } = user; const handleNavigate = () => { navigate('profile', user._id); |