Skip to content

Commit

Permalink
Removes picture with a generic avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiogcx committed Feb 10, 2021
1 parent 27129b0 commit 9c0d1a0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions moped-editor/src/views/account/AccountView/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ import {
Typography,
makeStyles,
} from "@material-ui/core";

export const defaultUser = {
avatar: `${process.env.PUBLIC_URL}/static/images/avatars/robSpillar.jpeg`,
name: "Rob Spillar",
jobTitle: "Director of Transportation",
city: "Austin, TX",
};
import { useUser } from "../../../auth/user";

const useStyles = makeStyles(() => ({
root: {},
Expand All @@ -31,22 +25,27 @@ const useStyles = makeStyles(() => ({

const Profile = ({ className, ...rest }) => {
const classes = useStyles();
const { user } = useUser();

return (
<Card className={clsx(classes.root, className)} {...rest}>
<CardContent>
<Box alignItems="center" display="flex" flexDirection="column">
<Box>
<Avatar className={classes.avatar} src={defaultUser.avatar} />
<Avatar
className={classes.avatar}
src={user?.userAvatar}
style={{ "background-color": user?.userColor }}
/>
</Box>
<Typography color="textPrimary" gutterBottom variant="h3">
{defaultUser.name}
{String(user?.userName ?? user?.attributes?.email).toLowerCase()}
</Typography>
<Typography color="textSecondary" variant="body1">
{defaultUser.jobTitle}
{user?.userJobTitle ?? "Austin Transportation"}
</Typography>
<Typography color="textSecondary" variant="body1">
{defaultUser.city}
{user?.userCity ?? "Austin, TX"}
</Typography>
</Box>
</CardContent>
Expand Down

0 comments on commit 9c0d1a0

Please sign in to comment.