diff --git a/SurveyFrontend/src/components/LoginForm/LoginForm.tsx b/SurveyFrontend/src/components/LoginForm/LoginForm.tsx index 8431a04..b397b34 100644 --- a/SurveyFrontend/src/components/LoginForm/LoginForm.tsx +++ b/SurveyFrontend/src/components/LoginForm/LoginForm.tsx @@ -27,7 +27,7 @@ const LoginForm = () => { else { const responseData = await authUser({email, password}); if (responseData && !responseData.error) - navigate('/my-surveys'); + navigate('/my-surveys', {replace: true}); else setError('Неверный логин или пароль') } diff --git a/SurveyFrontend/src/components/Logo/Logo.module.css b/SurveyFrontend/src/components/Logo/Logo.module.css index 72fd3c9..b8e2295 100644 --- a/SurveyFrontend/src/components/Logo/Logo.module.css +++ b/SurveyFrontend/src/components/Logo/Logo.module.css @@ -1,6 +1,7 @@ /*Logo.module.css*/ .logo { + outline: none; padding: 0; margin: 0 100px 0 40px; display: flex; diff --git a/SurveyFrontend/src/components/RegisterForm/RegisterForm.tsx b/SurveyFrontend/src/components/RegisterForm/RegisterForm.tsx index ab73c54..45507b0 100644 --- a/SurveyFrontend/src/components/RegisterForm/RegisterForm.tsx +++ b/SurveyFrontend/src/components/RegisterForm/RegisterForm.tsx @@ -39,7 +39,7 @@ const RegisterForm = () => { if (responseData && !responseData.error) { console.log('Регистрация успешна'); localStorage.setItem("user", JSON.stringify(responseData.user)); - navigate('/my-surveys'); + navigate('/my-surveys', {replace: true}); } else if (responseData.status === 409){ setError('Аккаунт с такой почтой уже зарегистрирован'); diff --git a/SurveyFrontend/src/components/SurveyInfo/SurveyInfo.module.css b/SurveyFrontend/src/components/SurveyInfo/SurveyInfo.module.css index b56ae92..89e8e06 100644 --- a/SurveyFrontend/src/components/SurveyInfo/SurveyInfo.module.css +++ b/SurveyFrontend/src/components/SurveyInfo/SurveyInfo.module.css @@ -23,6 +23,7 @@ width: 80%; display: block; border: none; + outline: none; margin: 0 auto 13px; background-color: white; text-align: center; @@ -75,6 +76,7 @@ .description { min-height: 24px; border: none; + outline: none; font-size: 16px; font-weight: 500; text-align: center; @@ -88,6 +90,7 @@ .desc{ font-size: 20px; + outline: none; font-weight: 500; background-color: white; max-width: 80%; diff --git a/SurveyFrontend/src/pages/AuthForm/AuthForm.tsx b/SurveyFrontend/src/pages/AuthForm/AuthForm.tsx index f9c5fc9..fd4e626 100644 --- a/SurveyFrontend/src/pages/AuthForm/AuthForm.tsx +++ b/SurveyFrontend/src/pages/AuthForm/AuthForm.tsx @@ -2,6 +2,7 @@ import styles from './AuthForm.module.css'; import LoginForm from "../../components/LoginForm/LoginForm.tsx"; import RegisterForm from "../../components/RegisterForm/RegisterForm.tsx"; import {useLocation} from "react-router-dom"; +import {useEffect} from "react"; const AuthForm = () => { @@ -9,6 +10,22 @@ const AuthForm = () => { const isLoginPage = location.pathname === '/login'; const isRegisterPage = location.pathname === '/register'; + useEffect(() => { + if (isLoginPage || isRegisterPage) { + window.history.pushState(null, "", window.location.href); + + const handlePopState = () => { + window.history.pushState(null, "", window.location.href); + }; + + window.addEventListener("popstate", handlePopState); + + return () => { + window.removeEventListener("popstate", handlePopState); + }; + } + }, [isLoginPage, isRegisterPage]); + let content; if (isLoginPage) { content = ;