& {
getLayout?: (page: ReactElement) => ReactNode
@@ -68,7 +68,7 @@ function App({ Component, pageProps: { session, ...pageProps } }: AppPropsWithLa
<>
@@ -1,258 +0,0 @@
-import React from 'react'
-import { Box, Card, CardMedia, Stack, TextField, Typography } from '@mui/material'
-import Button from '@mui/material/Button'
-import axios from 'axios'
-import Head from 'next/head'
-import Image from 'next/image'
-import Link from 'next/link'
-import { useRouter } from 'next/router'
-
-import { Layout } from '#/app/layout'
-import { useAppSelector } from '#/app/store/store'
-import { API_URL } from '#/shared/lib/constants/constants'
-import { getRandomImage, getTypeDevice } from '#/shared/lib/helpers'
-import { TDeviceProp } from '#/shared/lib/types/entities'
-
-export async function getServerSideProps(context: any): Promise<{ props: TDeviceProp }> {
- const device = getTypeDevice(context)
-
- return {
- props: {
- device,
- },
- }
-}
-
-const ChangePassword: React.FC
= ({ device }) => {
- const [password1, setPassword1] = React.useState('')
-
- const [password2, setPassword2] = React.useState('')
-
- const [isChange, setIsChange] = React.useState(false)
-
- const { query, push } = useRouter()
-
- const changePassword = async () => {
- let formData: any = new FormData()
-
- formData.append('password_1', password1)
- formData.append('password_2', password2)
-
- if (password1.trim() && password2.trim()) {
- try {
- await axios.post(API_URL + `/auth/change-pass?token=${query.token}`, formData, {
- headers: {
- 'content-type': 'multipart/form-data ',
- },
- })
- setIsChange(true)
- setTimeout(() => push('/login'), 5000)
- } catch (err) {}
- }
- }
-
- const desktop = device === 'desktop'
-
- const refImage = React.useRef(getRandomImage())
-
- const theme = useAppSelector((state) => state.theme.theme)
-
- return (
-
-
- Восстановление аккаунта
-
-
-
-
-
-
-
-
- {desktop && (
-
-
-
-
- Midjourney
-
-
- by honeynek
-
-
-
-
- )}
- {isChange ? (
-
-
- Ваш пароль успешно изменён!
-
-
- Войти в аккаунт
-
-
- ) : (
-
-
- Восстановление пароля
-
-
- Новый пароль
-
- setPassword1(e.target.value)}
- >
-
- Подтверждение пароля
-
- setPassword2(e.target.value)}
- >
-
-
-
-
- )}
-
-
- )
-}
-
-export default ChangePassword
@@ -11,7 +11,7 @@ export const CommonSendButton = ({ loading, onClick }: CommonSendButtonProps) =>
return loading ? (
-
+
) : (