fix auth modal links
This commit is contained in:
parent
60d196fcf5
commit
6dbc2dcd01
@ -15,13 +15,9 @@ export default function Component() {
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
||||||
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
||||||
const [select, setSelect] = React.useState(0);
|
|
||||||
const userId = useUserStore((state) => state.userId);
|
const userId = useUserStore((state) => state.userId);
|
||||||
const navigate = useNavigate();
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const onClick = () => (userId ? navigate("/list") : navigate("/signin"));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SectionStyled
|
<SectionStyled
|
||||||
tag={"header"}
|
tag={"header"}
|
||||||
@ -69,8 +65,10 @@ export default function Component() {
|
|||||||
{/* ))}*/}
|
{/* ))}*/}
|
||||||
{/*</Box>*/}
|
{/*</Box>*/}
|
||||||
<Button
|
<Button
|
||||||
|
component={Link}
|
||||||
|
to={userId ? "/list" : "/signin"}
|
||||||
|
state={{ backgroundLocation: location }}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={onClick}
|
|
||||||
sx={{
|
sx={{
|
||||||
color: "black",
|
color: "black",
|
||||||
border: "1px solid black",
|
border: "1px solid black",
|
||||||
|
|||||||
@ -198,11 +198,23 @@ export default function SigninDialog() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography sx={{ color: "#7E2AEA", textAlign: "center" }}>Вы еще не присоединились?</Typography>
|
<Typography sx={{ color: "#7E2AEA", textAlign: "center" }}>Вы еще не присоединились?</Typography>
|
||||||
<Box sx={{ display: "flex", alignItems: "center", gap: "4px" }}>
|
<Box sx={{ display: "flex", flexDirection: "column", alignItems: "center", gap: "15px" }}>
|
||||||
<Link component={RouterLink} to="/signup" sx={{ color: "#7E2AEA" }}>
|
<Link
|
||||||
|
component={RouterLink}
|
||||||
|
to="/signup"
|
||||||
|
state={{ backgroundLocation: location.state.backgroundLocation }}
|
||||||
|
sx={{
|
||||||
|
color: "#7E2AEA"
|
||||||
|
}}>
|
||||||
Регистрация
|
Регистрация
|
||||||
</Link>
|
</Link>
|
||||||
<Link component={RouterLink} to="/restore" sx={{ color: "#7E2AEA" }}>
|
<Link
|
||||||
|
component={RouterLink}
|
||||||
|
to="/restore"
|
||||||
|
state={{ backgroundLocation: location.state.backgroundLocation }}
|
||||||
|
sx={{
|
||||||
|
color: "#7E2AEA"
|
||||||
|
}}>
|
||||||
Забыли пароль
|
Забыли пароль
|
||||||
</Link>
|
</Link>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -212,7 +212,12 @@ export default function SignupDialog() {
|
|||||||
>
|
>
|
||||||
Вход в личный кабинет
|
Вход в личный кабинет
|
||||||
</Link>
|
</Link>
|
||||||
<Link component={RouterLink} to="/restore" sx={{ color: "#7E2AEA" }}>
|
<Link
|
||||||
|
component={RouterLink}
|
||||||
|
to="/restore"
|
||||||
|
state={{ backgroundLocation: location.state.backgroundLocation }}
|
||||||
|
sx={{ color: "#7E2AEA" }}
|
||||||
|
>
|
||||||
Забыли пароль
|
Забыли пароль
|
||||||
</Link>
|
</Link>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import { FC, useState } from "react";
|
import { FC, useState } from "react";
|
||||||
import CloseIcon from "@mui/icons-material/Close";
|
import CloseIcon from "@mui/icons-material/Close";
|
||||||
import { Box, Button, Dialog, IconButton, Typography, useMediaQuery, useTheme } from "@mui/material";
|
import { Box, Button, Dialog, IconButton, Link, Typography, useMediaQuery, useTheme } from "@mui/material";
|
||||||
import InputTextfield from "@ui_kit/InputTextfield";
|
import InputTextfield from "@ui_kit/InputTextfield";
|
||||||
import PasswordInput from "@ui_kit/passwordInput";
|
import PasswordInput from "@ui_kit/passwordInput";
|
||||||
import { useFormik } from "formik";
|
import { useFormik } from "formik";
|
||||||
import { object, ref, string } from "yup";
|
import { object, ref, string } from "yup";
|
||||||
import Logotip from "../Landing/images/icons/QuizLogo";
|
import Logotip from "../Landing/images/icons/QuizLogo";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate, Link as RouterLink, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
interface Values {
|
interface Values {
|
||||||
email: string;
|
email: string;
|
||||||
@ -36,6 +36,7 @@ export const Restore: FC = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
const formik = useFormik<Values>({
|
const formik = useFormik<Values>({
|
||||||
initialValues,
|
initialValues,
|
||||||
@ -177,6 +178,17 @@ export const Restore: FC = () => {
|
|||||||
>
|
>
|
||||||
Восстановить
|
Восстановить
|
||||||
</Button>
|
</Button>
|
||||||
|
<Link
|
||||||
|
component={RouterLink}
|
||||||
|
to="/signin"
|
||||||
|
state={{ backgroundLocation: location.state.backgroundLocation }}
|
||||||
|
sx={{
|
||||||
|
color: "#7E2AEA",
|
||||||
|
mt: "auto",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
У меня уже есть аккаунт
|
||||||
|
</Link>
|
||||||
</Box>
|
</Box>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user