Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added link to registration to login dialog #362

Merged
merged 2 commits into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/components/PageLayout/LoginForm/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import {FC, useState} from 'react'
import {SubmitHandler, useForm} from 'react-hook-form'

import {Button} from '@/components/Clickable/Button'
import {Link} from '@/components/Clickable/Link'
import {Dialog} from '@/components/Dialog/Dialog'
import {FormInput} from '@/components/FormItems/FormInput/FormInput'
import {AuthContainer} from '@/utils/AuthContainer'
import {useSeminarInfo} from '@/utils/useSeminarInfo'

import {PasswordResetRequestForm} from '../PasswordResetRequest/PasswordResetRequest'

Expand All @@ -27,6 +29,7 @@ type LoginFormProps = {
export const LoginForm: FC<LoginFormProps> = ({closeDialog}) => {
const {login} = AuthContainer.useContainer()
const {handleSubmit, control} = useForm<LoginFormValues>({defaultValues})
const {seminar} = useSeminarInfo()

const router = useRouter()

Expand Down Expand Up @@ -77,12 +80,19 @@ export const LoginForm: FC<LoginFormProps> = ({closeDialog}) => {
<FormInput control={control} name="password" label="Heslo" type="password" rules={requiredRule} />
</Stack>
<Stack direction={'row'} mt={3} gap={2} justifyContent="space-between">
<Button variant="button2" type="button" onClick={toggleForgottenDialog}>
Zabudnuté heslo
</Button>
<Button variant="button2" type="submit">
Prihlásiť
</Button>
<Stack gap={2} alignItems="start">
<Button variant="button3" type="button" onClick={toggleForgottenDialog}>
Zabudol som heslo
</Button>
<Link variant="button3" href={`${seminar}/registracia`}>
Chcem sa registrovať
</Link>
</Stack>
<Stack direction={'column'} gap={2} alignItems="end" justifyContent="end">
<Button variant="button2" type="submit">
Prihlásiť sa
</Button>
</Stack>
</Stack>
</Stack>
</form>
Expand Down
Loading