Skip to content

Commit 733c221

Browse files
committed
Add user's detail on drawer
1 parent fa534cf commit 733c221

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/layouts/DrawerLayout/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
import MenuIcon from '@material-ui/icons/Menu';
2626
import ListItemIcon from '@material-ui/core/ListItemIcon';
2727
import { faBloggerB } from '@fortawesome/free-brands-svg-icons';
28+
import { useSelector } from 'react-redux';
2829
const drawerWidth = 300;
2930

3031
const useStyles = makeStyles(theme => ({
@@ -120,6 +121,7 @@ const useStyles = makeStyles(theme => ({
120121
}));
121122
export default function DrawerLayout({ children }) {
122123
const classes = useStyles();
124+
const user = useSelector(state => state.account.user);
123125
const history = useHistory();
124126
const [toggle, setToggle] = useState(false);
125127
const myStyles = {
@@ -168,11 +170,11 @@ export default function DrawerLayout({ children }) {
168170
<Avatar
169171
className={classes.idavatar}
170172
alt="ProfileIcon"
171-
src="./static/profile/icons/icons.png"
173+
src={user?.photoURL}
172174
/>
173175
<div style={{ display: 'block', marginLeft: '10px' }}>
174176
<Typography style={{ fontSize: '18px', fontWeight: '600' }}>
175-
John Doe
177+
{user?.displayName}
176178
</Typography>
177179
<div style={{ display: 'flex' }}>
178180
<Typography variant="subtitle1" className={classes.idtext}>

0 commit comments

Comments
 (0)