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

Zmena textu GDPR #242

Merged
merged 2 commits into from
Dec 8, 2023
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
20 changes: 5 additions & 15 deletions src/components/RegisterForm/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import {FC} from 'react'
import {SubmitHandler, useForm} from 'react-hook-form'

import styles from '@/components/FormItems/Form.module.scss'
import {FormCheckbox} from '@/components/FormItems/FormCheckbox/FormCheckbox'
import {FormInput} from '@/components/FormItems/FormInput/FormInput'
import {IGeneralPostResponse} from '@/types/api/general'
import {useSeminarInfo} from '@/utils/useSeminarInfo'

import {Button} from '../Clickable/Clickable'
import {Button, Link} from '../Clickable/Clickable'
import {SchoolSubForm, SchoolSubFormValues} from '../SchoolSubForm/SchoolSubForm'

interface RegisterFormValues extends SchoolSubFormValues {
Expand All @@ -21,7 +20,6 @@ interface RegisterFormValues extends SchoolSubFormValues {
last_name?: string
phone?: string
parent_phone?: string
gdpr?: boolean
}

interface RegisterErrorResponseData {
Expand All @@ -41,7 +39,6 @@ const defaultValues: RegisterFormValues = {
school: null,
school_not_found: false,
grade: '',
gdpr: false,
}

export const RegisterForm: FC = () => {
Expand Down Expand Up @@ -71,7 +68,6 @@ export const RegisterForm: FC = () => {
school: data.school?.id,
phone: data.phone?.replaceAll(/\s+/gu, ''),
parent_phone: data.parent_phone?.replaceAll(/\s+/gu, ''),
gdpr: data.gdpr,
grade: data.grade,
},
new_school_description: data.new_school_description || '',
Expand Down Expand Up @@ -149,17 +145,11 @@ export const RegisterForm: FC = () => {
<SchoolSubForm control={control} watch={watch} setValue={setValue} />
<FormInput control={control} name="phone" label="telefónne číslo" rules={phoneRule} />
<FormInput control={control} name="parent_phone" label="telefónne číslo na rodiča" rules={phoneRule} />
<FormCheckbox
control={control}
name="gdpr"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mali by sme odstranit este gdpr field z RegisterFormValues typu hore

label="súhlas so spracovaním osobných údajov"
rules={{
validate: (val) => {
if (!val) return '* Súhlas so spracovaním osobných údajov je nutnou podmienkou registrácie.'
},
}}
/>
<p style={{fontWeight: 'bold'}}>* takto označéné polia sú povinné</p>
<p>
Vyplnením a odoslaním registrácie beriem na vedomie, že moje osobné údaje budú spracované v súlade so zákonom
o ochrane osobných údajov. Bližšie informácie nájdete <Link href={`./gdpr`}>tu</Link>.
</p>
<Button type="submit" onClick={scrollToTop}>
Registrovať
</Button>
Expand Down
Loading