diff options
Diffstat (limited to 'src/containers/Profile')
-rw-r--r-- | src/containers/Profile/ProfileInfo.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/containers/Profile/ProfileInfo.tsx b/src/containers/Profile/ProfileInfo.tsx index 9eee4c1..a01c222 100644 --- a/src/containers/Profile/ProfileInfo.tsx +++ b/src/containers/Profile/ProfileInfo.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Avatar, Badge, Typography } from '@material-ui/core/'; +import { Badge, Typography } from '@material-ui/core/'; import { makeStyles } from '@material-ui/core/styles'; import { User } from 'which-types'; import CameraAltIcon from '@material-ui/icons/CameraAlt'; @@ -8,9 +8,11 @@ import Skeleton from '@material-ui/lab/Skeleton'; import MoreMenu from './MoreMenu'; import Highlight from './Highlight'; import UploadImage from '../../components/UploadImage/UploadImage'; +import Avatar from '../../components/Avatar/Avatar'; import { patch } from '../../requests'; import { useAuth } from '../../hooks/useAuth'; + interface PropTypes { savedPolls: number; totalVotes: number; @@ -116,19 +118,20 @@ const ProfileInfo: React.FC<PropTypes> = ({ vertical: 'bottom', horizontal: 'right' }} + onClick={handleClick} badgeContent={( <div className={classes.badge}> - <CameraAltIcon onClick={handleClick} /> + <CameraAltIcon /> </div> )} > - <Avatar className={classes.avatar} src={userInfo?.avatarUrl} /> + <Avatar className={classes.avatar} user={userInfo} /> </Badge> </div> <UploadImage isOpen={input} setIsOpen={setInput} callback={patchAvatar} /> </div> ) - : <Avatar className={classes.avatar} src={userInfo?.avatarUrl} /> + : <Avatar className={classes.avatar} user={userInfo} /> } { !userInfo |