Skip to content

Commit

Permalink
user photo edit update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramchike committed Nov 12, 2024
1 parent 5175cb9 commit c31f77d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions frontend/src/pages/edit/ui/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { UserContext } from '../../../app/providers'
import { ModalEdit } from './modal_edit';
import { ModalAbout, ModalName, ModalClass } from './modals';
import { CropWidget } from '../../../widgets';
import { updateAvatar } from '../../../entities';
import { updateAvatar, User } from '../../../entities';

interface Props {
verifySend: boolean
Expand All @@ -21,7 +21,7 @@ export function Edit({verifySend, verify_hook}: Props) {
const [editModal, setEdit] = useState(false)
const [isCrop, setCrop] = useState(false)
const [img, setImg] = useState<string | undefined>(undefined)
const {user } = useContext(UserContext)
const {user, setUser} = useContext(UserContext)

const openModal = (func: React.Dispatch<React.SetStateAction<boolean>>) => {
setEdit(false)
Expand Down Expand Up @@ -57,12 +57,13 @@ export function Edit({verifySend, verify_hook}: Props) {
verify_hook(true)
}

const afterPhoto = () => {
const afterPhoto = (user: User) => {
addNotify({
title: 'Фото обновлено',
content: 'Вы успешно обновили фотографию своего профиля'
})
setImg(undefined)
setUser(user)
}

const onPhoto = (img: string | undefined) => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/tsconfig.app.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"root":["./src/vite-env.d.ts","./src/app/index.tsx","./src/app/providers/index.ts","./src/app/providers/userprovider.tsx","./src/app/router/router.tsx","./src/app/ui/app.tsx","./src/entities/index.ts","./src/entities/user/api.ts","./src/entities/user/index.ts","./src/entities/user/model.ts","./src/features/index.ts","./src/features/like/index.ts","./src/features/like/api/api.ts","./src/features/like/model/model.ts","./src/features/report/index.ts","./src/features/report/api/api.ts","./src/features/report/ui/report.tsx","./src/pages/index.ts","./src/pages/auth/api/api.ts","./src/pages/auth/model/types.ts","./src/pages/auth/ui/auth.tsx","./src/pages/edit/model/model.ts","./src/pages/edit/ui/edit.tsx","./src/pages/edit/ui/modal_edit.tsx","./src/pages/edit/ui/modals/class.tsx","./src/pages/edit/ui/modals/description.tsx","./src/pages/edit/ui/modals/index.ts","./src/pages/edit/ui/modals/name.tsx","./src/pages/feed/ui/feed.tsx","./src/pages/history/ui/history.tsx","./src/shared/clients.ts","./src/shared/config.ts","./src/shared/index.ts","./src/shared/assets/index.ts","./src/shared/ui/index.ts","./src/shared/ui/button/index.tsx","./src/shared/ui/card/index.tsx","./src/shared/ui/input/index.ts","./src/shared/ui/input/input.tsx","./src/shared/ui/input/img-input/index.tsx","./src/shared/ui/input/textarea/index.tsx","./src/shared/ui/navbar/index.tsx","./src/shared/ui/notify/index.tsx","./src/shared/ui/select/index.tsx","./src/widgets/index.ts","./src/widgets/crop/crop.tsx","./src/widgets/crop/toimg.tsx"],"errors":true,"version":"5.6.2"}
{"root":["./src/vite-env.d.ts","./src/app/index.tsx","./src/app/providers/index.ts","./src/app/providers/userprovider.tsx","./src/app/router/router.tsx","./src/app/ui/app.tsx","./src/entities/index.ts","./src/entities/user/api.ts","./src/entities/user/index.ts","./src/entities/user/model.ts","./src/features/index.ts","./src/features/like/index.ts","./src/features/like/api/api.ts","./src/features/like/model/model.ts","./src/features/report/index.ts","./src/features/report/api/api.ts","./src/features/report/ui/report.tsx","./src/pages/index.ts","./src/pages/auth/api/api.ts","./src/pages/auth/model/types.ts","./src/pages/auth/ui/auth.tsx","./src/pages/edit/model/model.ts","./src/pages/edit/ui/edit.tsx","./src/pages/edit/ui/modal_edit.tsx","./src/pages/edit/ui/modals/class.tsx","./src/pages/edit/ui/modals/description.tsx","./src/pages/edit/ui/modals/index.ts","./src/pages/edit/ui/modals/name.tsx","./src/pages/feed/ui/feed.tsx","./src/pages/history/ui/history.tsx","./src/shared/clients.ts","./src/shared/config.ts","./src/shared/index.ts","./src/shared/assets/index.ts","./src/shared/ui/index.ts","./src/shared/ui/button/index.tsx","./src/shared/ui/card/index.tsx","./src/shared/ui/input/index.ts","./src/shared/ui/input/input.tsx","./src/shared/ui/input/img-input/index.tsx","./src/shared/ui/input/textarea/index.tsx","./src/shared/ui/navbar/index.tsx","./src/shared/ui/notify/index.tsx","./src/shared/ui/select/index.tsx","./src/widgets/index.ts","./src/widgets/crop/crop.tsx","./src/widgets/crop/toimg.tsx"],"version":"5.6.2"}

0 comments on commit c31f77d

Please sign in to comment.