Update user mock and use avatar image

This commit is contained in:
Leonardo Murça 2022-09-14 16:37:26 -03:00
parent e2eff9a528
commit 9a81380039
3 changed files with 15 additions and 6 deletions

View file

@ -32,6 +32,7 @@ function AuthenticatedApp() {
} }
layoutType={layoutType} layoutType={layoutType}
avatarMenuOptions={avatarMenuOptions(navigate, logout)} avatarMenuOptions={avatarMenuOptions(navigate, logout)}
user={state.user}
/> />
<Container <Container
maxWidth="false" maxWidth="false"

View file

@ -13,7 +13,7 @@ import { useState } from 'react';
import styles from './styles'; import styles from './styles';
function Toolbar({ title, layoutType, avatarMenuOptions }) { function Toolbar({ title, layoutType, avatarMenuOptions, user }) {
const { const {
box, box,
menuBoxContainer, menuBoxContainer,
@ -63,7 +63,7 @@ function Toolbar({ title, layoutType, avatarMenuOptions }) {
onClick={e => setAnchorElUser(e.currentTarget)} onClick={e => setAnchorElUser(e.currentTarget)}
sx={{ p: 0 }} sx={{ p: 0 }}
> >
<Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" /> <Avatar alt={user.firstName} src={user.avatar} />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
@ -125,7 +125,7 @@ function Toolbar({ title, layoutType, avatarMenuOptions }) {
onClick={e => setAnchorElUser(e.currentTarget)} onClick={e => setAnchorElUser(e.currentTarget)}
sx={{ p: 0 }} sx={{ p: 0 }}
> >
<Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" /> <Avatar alt={user.firstName} src={user.avatar} />
</IconButton> </IconButton>
</Tooltip> </Tooltip>

View file

@ -523,11 +523,19 @@ const allPeople = [
]; ];
const user = { const user = {
id: '0021564', id: '123',
username: 'leonardomurca', ra: '0021564',
name: 'Leonardo', username: 'leo@gmail.com',
email: 'leo@gmail.com',
password: '#leo1234', // TODO: Remove this!
firstName: 'Leonardo',
lastName: 'Murça', lastName: 'Murça',
token: 'skdfb9458hnsdfsif4w38r9234ry98423', token: 'skdfb9458hnsdfsif4w38r9234ry98423',
phone: '31992460019',
avatar: 'https://i.pravatar.cc/300?img=61',
course: 0,
termsAgreed: true,
year: 0,
}; };
const authFailure = { const authFailure = {