From a9033af4bdb8a4594b5f12081a2cd92c31c18fad Mon Sep 17 00:00:00 2001 From: Chuma McPhoy Date: Tue, 8 Oct 2024 14:56:35 +0200 Subject: [PATCH] fix(SW-360): signup form props --- .../DynamicContent/SignUpVerification/index.tsx | 3 +-- .../DynamicContent/SignupFormWrapper/index.tsx | 6 ++---- components/Blocks/DynamicContent/index.tsx | 2 +- components/TempDesignSystem/Form/Checkbox/index.tsx | 2 ++ types/components/blocks/dynamicContent.ts | 13 ++----------- types/components/form/registerForm.ts | 2 +- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/components/Blocks/DynamicContent/SignUpVerification/index.tsx b/components/Blocks/DynamicContent/SignUpVerification/index.tsx index 47712107f..3755b59b4 100644 --- a/components/Blocks/DynamicContent/SignUpVerification/index.tsx +++ b/components/Blocks/DynamicContent/SignUpVerification/index.tsx @@ -12,8 +12,7 @@ import styles from "./signUpVerification.module.css" import type { SignUpVerificationProps } from "@/types/components/blocks/dynamicContent" export default async function SignUpVerification({ - title, - subtitle, + dynamic_content, }: SignUpVerificationProps) { const session = await auth() if (session) { diff --git a/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx b/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx index f48260970..4c39dafc5 100644 --- a/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx +++ b/components/Blocks/DynamicContent/SignupFormWrapper/index.tsx @@ -6,13 +6,11 @@ import { auth } from "@/auth" import Form from "@/components/Forms/Register" import { getLang } from "@/i18n/serverContext" -import type { RegisterFormProps } from "@/types/components/form/registerForm" +import { SignupFormWrapperProps } from "@/types/components/blocks/dynamicContent" export default async function SignupFormWrapper({ dynamic_content, -}: { - dynamic_content: RegisterFormProps -}) { +}: SignupFormWrapperProps) { const session = await auth() if (session) { // We don't want to allow users to access signup if they are already authenticated. diff --git a/components/Blocks/DynamicContent/index.tsx b/components/Blocks/DynamicContent/index.tsx index e03264f5d..31ba4009a 100644 --- a/components/Blocks/DynamicContent/index.tsx +++ b/components/Blocks/DynamicContent/index.tsx @@ -56,7 +56,7 @@ export default async function DynamicContent({ case DynamicContentEnum.Blocks.components.sign_up_form: return case DynamicContentEnum.Blocks.components.sign_up_verification: - return + return case DynamicContentEnum.Blocks.components.soonest_stays: return case DynamicContentEnum.Blocks.components.upcoming_stays: diff --git a/components/TempDesignSystem/Form/Checkbox/index.tsx b/components/TempDesignSystem/Form/Checkbox/index.tsx index 8b2885ebc..cb4a68cde 100644 --- a/components/TempDesignSystem/Form/Checkbox/index.tsx +++ b/components/TempDesignSystem/Form/Checkbox/index.tsx @@ -1,3 +1,5 @@ +"use client" + import { Checkbox as AriaCheckbox } from "react-aria-components" import { useController, useFormContext } from "react-hook-form" diff --git a/types/components/blocks/dynamicContent.ts b/types/components/blocks/dynamicContent.ts index 8d183bfd6..ef01f9b1a 100644 --- a/types/components/blocks/dynamicContent.ts +++ b/types/components/blocks/dynamicContent.ts @@ -19,15 +19,6 @@ export interface OverviewTableProps extends PartialDynamicContent { firstItem: boolean } -export interface SignUpVerificationProps { - title: string - subtitle: string -} +export interface SignupFormWrapperProps extends PartialDynamicContent {} -export interface SignupFormWrapperProps { - dynamic_content: { - link: string - subtitle: string - title: string - } -} +export interface SignUpVerificationProps extends PartialDynamicContent {} diff --git a/types/components/form/registerForm.ts b/types/components/form/registerForm.ts index d4763dcab..41e783dd5 100644 --- a/types/components/form/registerForm.ts +++ b/types/components/form/registerForm.ts @@ -1,5 +1,5 @@ export type RegisterFormProps = { link?: { href: string; text: string } - subtitle: string + subtitle?: string title: string }