fix(SW-360): signup form props

This commit is contained in:
Chuma McPhoy
2024-10-08 14:56:35 +02:00
parent e84b3ca980
commit 2fce70e866
6 changed files with 9 additions and 19 deletions

View File

@@ -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) {

View File

@@ -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.

View File

@@ -56,7 +56,7 @@ export default async function DynamicContent({
case DynamicContentEnum.Blocks.components.sign_up_form:
return <SignupFormWrapper dynamic_content={dynamic_content} />
case DynamicContentEnum.Blocks.components.sign_up_verification:
return <SignUpVerification {...dynamic_content} />
return <SignUpVerification dynamic_content={dynamic_content} />
case DynamicContentEnum.Blocks.components.soonest_stays:
return <SoonestStays {...dynamic_content} />
case DynamicContentEnum.Blocks.components.upcoming_stays:

View File

@@ -1,3 +1,5 @@
"use client"
import { Checkbox as AriaCheckbox } from "react-aria-components"
import { useController, useFormContext } from "react-hook-form"

View File

@@ -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 {}

View File

@@ -1,5 +1,5 @@
export type RegisterFormProps = {
link?: { href: string; text: string }
subtitle: string
subtitle?: string
title: string
}