feat: loosen up the zod validations and return null instead of throwing
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
.message {
|
||||
color: var(--Scandic-Red-60);
|
||||
font-family: var(--typography-Body-Regular-fontFamily);
|
||||
font-size: var(--typography-Body-Regular-fontSize);
|
||||
font-weight: var(--typography-Body-Regular-fontWeight);
|
||||
line-height: var(--typography-Body-Regular-lineHeight);
|
||||
margin: var(--Spacing-x-half) 0 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { ErrorMessage as RHFErrorMessage } from "@hookform/error-message"
|
||||
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
|
||||
import styles from "./error.module.css"
|
||||
|
||||
import type { ErrorMessageProps } from "./errorMessage"
|
||||
@@ -12,7 +14,11 @@ export default function ErrorMessage<T>({
|
||||
<RHFErrorMessage
|
||||
errors={errors}
|
||||
name={name}
|
||||
render={({ message }) => <p className={styles.message}>{message}</p>}
|
||||
render={({ message }) => (
|
||||
<Body className={styles.message} fontOnly>
|
||||
{message}
|
||||
</Body>
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user