Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoom-Developer committed Nov 12, 2024
2 parents 3a4dd12 + b35f3cd commit bb2897b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
2 changes: 2 additions & 0 deletions frontend/src/pages/auth/ui/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ export function Auth() {
.then(res => res.blob())
.then(blob => {
console.log(blob)
setName((name) => name.trim())
setSurname((surname) => surname.trim())
const userData: UserRegister = {
name,
surname,
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/pages/edit/api/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { UserClient } from "../../../shared";

export async function sendVerify() {
UserClient.post('/verify')
.then((response) => {
return response.data
})
.catch((error) => {
throw error
})
}
22 changes: 13 additions & 9 deletions frontend/src/pages/edit/ui/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ 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';
import { sendVerify } from '../api/api';

interface Props {
verifySend: boolean
Expand All @@ -21,7 +22,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 @@ -49,20 +50,23 @@ export function Edit({verifySend, verify_hook}: Props) {
}

const onVerify = () => {
addNotify({
title: 'Заявка отправлена',
content: 'Заявка на верификацию успешно отправлена. Мы пришлем тебе уведомление после её рассмотрения',
type: 'info'
sendVerify().then(() => {
addNotify({
title: 'Заявка отправлена',
content: 'Заявка на верификацию успешно отправлена. Мы пришлем тебе уведомление после её рассмотрения',
type: 'info'
})
verify_hook(true)
})
verify_hook(true)
}

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

const onPhoto = (img: string | undefined) => {
Expand Down Expand Up @@ -101,7 +105,7 @@ export function Edit({verifySend, verify_hook}: Props) {
<ModalClass is_open={litera} close_hook={() => setLitera(false)} nowClass={user.literal}></ModalClass>
<div className={styles['container']}>
<Card
name={focus.name}
name={user.name}
surname={user.surname}
avatar={user.attachments[0]}
desc={user.desc}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/shared/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const Literales: Option[] = [
{key: "9v", value: "9В"},
{key: "10k", value: "10К"},
{key: "10c", value: "10С"},
{key: "10p", value: "10П"},
{key: "10u", value: "10Ю"},
{key: "10y", value: "10У"},
{key: "10j", value: "10Ж"},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/widgets/crop/crop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {
}

export function CropWidget({img, setImg, onComplete}: Props): ReactElement {
const [zoom, setZoom] = useState(1)
const [zoom, setZoom] = useState(0.8)
const [crop, setCrop] = useState<Point>({x: 0, y: 0})
const [area, setArea] = useState<Area | null>(null)

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 bb2897b

Please sign in to comment.