|
1 | 1 | import * as React from "react"; |
2 | 2 | import {FC, FormEvent, useEffect, useState} from "react"; |
3 | 3 | import {Navigate} from "react-router-dom"; |
4 | | -import Avatar from '@material-ui/core/Avatar'; |
5 | 4 | import GitHubIcon from '@mui/icons-material/GitHub'; |
6 | 5 | import {Button, Container, Grid, TextField, Typography, Link} from "@material-ui/core"; |
7 | 6 | import ApiSingleton from "../api/ApiSingleton"; |
8 | 7 | import {useSearchParams} from 'react-router-dom'; |
9 | 8 | import EditIcon from "@material-ui/icons/Edit"; |
10 | 9 | import {makeStyles} from '@material-ui/core/styles'; |
11 | | -import {EditAccountViewModel} from "../api"; |
| 10 | +import {EditAccountViewModel} from "@/api"; |
| 11 | +import AvatarUtils from "@/components/Utils/AvatarUtils"; |
| 12 | +import Avatar from "@mui/material/Avatar"; |
12 | 13 |
|
13 | 14 | interface IEditProfileProps { |
14 | 15 | isExpert: boolean; |
@@ -163,11 +164,9 @@ const EditProfile: FC<IEditProfileProps> = (props) => { |
163 | 164 | {!profile.isExternalAuth && ( |
164 | 165 | <Container component="main" maxWidth="xs"> |
165 | 166 | <div className={classes.paper}> |
166 | | - <Avatar |
167 | | - src="/broken-image.jpg" |
168 | | - style={{color: 'white', backgroundColor: '#3fcb27'}} |
169 | | - className={classes.avatar} |
170 | | - /> |
| 167 | + <Avatar {...AvatarUtils.stringAvatar(profile!)} |
| 168 | + sx={{width: 56, height: 56}} |
| 169 | + className={classes.avatar}/> |
171 | 170 | <Typography component="h1" variant="h5"> |
172 | 171 | Редактировать профиль |
173 | 172 | </Typography> |
@@ -317,11 +316,9 @@ const EditProfile: FC<IEditProfileProps> = (props) => { |
317 | 316 | {profile.isExternalAuth && ( |
318 | 317 | <Container component="main" maxWidth="xs"> |
319 | 318 | <div className={classes.paper}> |
320 | | - <Avatar |
321 | | - src="/broken-image.jpg" |
322 | | - style={{color: 'white', backgroundColor: '#3fcb27'}} |
323 | | - className={classes.avatar} |
324 | | - /> |
| 319 | + <Avatar {...AvatarUtils.stringAvatar(profile)} |
| 320 | + sx={{width: 56, height: 56}} |
| 321 | + className={classes.avatar}/> |
325 | 322 | <Typography component="h1" variant="h5"> |
326 | 323 | Редактировать профиль |
327 | 324 | </Typography> |
|
0 commit comments