diff --git a/src/components/PageLayout/Authentication/Authentication.module.scss b/src/components/PageLayout/Authentication/Authentication.module.scss index 3a108549..60c78e1c 100644 --- a/src/components/PageLayout/Authentication/Authentication.module.scss +++ b/src/components/PageLayout/Authentication/Authentication.module.scss @@ -14,17 +14,3 @@ border-left: 2px solid white; } } - -.authenticationContainer { - place-self: center; - padding: 0px; - width: 300px; - color: black; - background-color: white; - z-index: 1000; - border: 10px solid black; - - .content { - padding: 20px; - } -} diff --git a/src/components/PageLayout/Authentication/Authentication.module.scss.d.ts b/src/components/PageLayout/Authentication/Authentication.module.scss.d.ts index ef50130a..3081527a 100644 --- a/src/components/PageLayout/Authentication/Authentication.module.scss.d.ts +++ b/src/components/PageLayout/Authentication/Authentication.module.scss.d.ts @@ -1,7 +1,5 @@ export type Styles = { - authenticationContainer: string authenticationDisplayButtons: string - content: string } export type ClassNames = keyof Styles diff --git a/src/components/PageLayout/Authentication/Authentication.tsx b/src/components/PageLayout/Authentication/Authentication.tsx index c03849ed..2d5cd186 100644 --- a/src/components/PageLayout/Authentication/Authentication.tsx +++ b/src/components/PageLayout/Authentication/Authentication.tsx @@ -5,16 +5,16 @@ import {FC, useState} from 'react' import {AuthContainer} from '@/utils/AuthContainer' import {useSeminarInfo} from '@/utils/useSeminarInfo' -import {Overlay} from '../../Overlay/Overlay' +import {Dialog} from '../../Dialog/Dialog' import {LoginFormWrapper} from '../LoginFormWrapper/LoginFormWrapper' import styles from './Authentication.module.scss' export const Authentication: FC = () => { - const [displayAuthenticationOverlay, setDisplayAuthenticationOverlay] = useState(false) + const [displayAuthenticationDialog, setDisplayAuthenticationDialog] = useState(false) const {logout, isAuthed} = AuthContainer.useContainer() - const toggleDisplayLoginOverlay = () => { - setDisplayAuthenticationOverlay((prev) => !prev) + const toggleDisplayAuthenticationDialog = () => { + setDisplayAuthenticationDialog((prev) => !prev) } const {seminar} = useSeminarInfo() @@ -33,15 +33,13 @@ export const Authentication: FC = () => { <>
Registrovať - Prihlásiť + Prihlásiť
- -
-
- -
-
-
+ } + /> ) } else { diff --git a/src/components/PageLayout/LoginForm/LoginForm.tsx b/src/components/PageLayout/LoginForm/LoginForm.tsx index aa6d493f..0d780292 100644 --- a/src/components/PageLayout/LoginForm/LoginForm.tsx +++ b/src/components/PageLayout/LoginForm/LoginForm.tsx @@ -19,14 +19,14 @@ const defaultValues: LoginFormValues = { password: '', } -export const LoginForm: FC = ({closeOverlay}) => { +export const LoginForm: FC = ({closeDialog: closeDialog}) => { const {login} = AuthContainer.useContainer() const {handleSubmit, control} = useForm({defaultValues}) const router = useRouter() const redirectClose = () => { - closeOverlay() + closeDialog() if (router.asPath.endsWith('registracia')) { router.push('/') } diff --git a/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx b/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx index d2e4cb56..f6e543b5 100644 --- a/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx +++ b/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx @@ -9,10 +9,10 @@ import {LoginForm} from '../LoginForm/LoginForm' import {PasswordResetRequestForm} from '../PasswordResetRequest/PasswordResetRequest' export type LoginFormWrapperProps = { - closeOverlay: () => void + closeDialog: () => void } -export const LoginFormWrapper: FC = ({closeOverlay}) => { +export const LoginFormWrapper: FC = ({closeDialog: closeDialog}) => { const router = useRouter() const [form, changeForm] = useState('login') @@ -21,7 +21,7 @@ export const LoginFormWrapper: FC = ({closeOverlay}) => { if (form === 'login') return ( - +