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}
avatarMenuOptions={avatarMenuOptions(navigate, logout)}
user={state.user}
/>
<Container
maxWidth="false"

View file

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

View file

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