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