diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-11 22:19:23 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-11 22:19:23 +0300 |
commit | b5ce9be31993f5b4bee9abbe57d775b7ea407507 (patch) | |
tree | 51e502c7d1be7c8ad2179daf2f5c9bfd27911636 /src/components/Header | |
parent | a9d713a73b65847af419016d2d97c4e8dab950f9 (diff) | |
download | which-ui-b5ce9be31993f5b4bee9abbe57d775b7ea407507.tar.gz |
refactor: create separate Avatar component
Diffstat (limited to 'src/components/Header')
-rw-r--r-- | src/components/Header/Header.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 344b839..5621dbf 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -3,7 +3,6 @@ import { useHistory } from 'react-router-dom'; import { IconButton, Typography, - Avatar, useMediaQuery } from '@material-ui/core'; import { @@ -19,6 +18,7 @@ import { useAuth } from '../../hooks/useAuth'; import MobileHeader from './MobileHeader'; import BottomBar from './BottomBar'; import BrowserHeader from './BrowserHeader'; +import Avatar from '../Avatar/Avatar'; const useStyles = makeStyles(theme => ({ @@ -90,9 +90,9 @@ const Header: React.FC = React.memo(() => { const profile = ( <IconButton onClick={handleProfile}> { - user?.avatarUrl - ? <Avatar className={classes.avatar} src={user?.avatarUrl} /> - : <AccountCircle /> + user + ? <Avatar className={classes.avatar} user={user} /> + : <AccountCircle className={classes.avatar} /> } </IconButton> ); |