Add terms and conditions checkbox to sign-up methods (#45)
A checkbox has been added for user acceptance of terms and conditions during sign-up. This change includes adding a new adjustable flag in the configuration to control the display of the checkbox. A new file "terms-and-conditions-form-field.tsx" is added to handle the checkbox UI part. Also, localization support has been added for the feature.
This commit is contained in:
committed by
GitHub
parent
3393863dd2
commit
a75f7c576d
@@ -20,9 +20,11 @@ import { Input } from '@kit/ui/input';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { PasswordSignUpSchema } from '../schemas/password-sign-up.schema';
|
||||
import { TermsAndConditionsFormField } from './terms-and-conditions-form-field';
|
||||
|
||||
export function PasswordSignUpForm({
|
||||
defaultValues,
|
||||
displayTermsCheckbox,
|
||||
onSubmit,
|
||||
loading,
|
||||
}: {
|
||||
@@ -30,6 +32,8 @@ export function PasswordSignUpForm({
|
||||
email: string;
|
||||
};
|
||||
|
||||
displayTermsCheckbox?: boolean;
|
||||
|
||||
onSubmit: (params: {
|
||||
email: string;
|
||||
password: string;
|
||||
@@ -130,6 +134,10 @@ export function PasswordSignUpForm({
|
||||
)}
|
||||
/>
|
||||
|
||||
<If condition={displayTermsCheckbox}>
|
||||
<TermsAndConditionsFormField />
|
||||
</If>
|
||||
|
||||
<Button
|
||||
data-test={'auth-submit-button'}
|
||||
className={'w-full'}
|
||||
|
||||
Reference in New Issue
Block a user