From fadaa0fe4ad86340d6ecac058ac2188cf569cff5 Mon Sep 17 00:00:00 2001 From: Jesus Vasquez Date: Mon, 4 Mar 2024 20:50:32 -0500 Subject: [PATCH] styling --- app/page.tsx | 2 +- components/Form/ErrorMessage.tsx | 2 +- components/Form/FileInput.tsx | 24 ++++++++++++---- components/Form/RadioGroup.tsx | 17 +++++++---- components/Form/RequiredAsterisk.tsx | 2 +- components/Form/SelectInput.tsx | 13 ++++++--- components/Form/Separator.tsx | 9 ++++++ components/Form/StatusField.tsx | 8 ++++-- components/Form/ToggleField.tsx | 42 ++++++++++++++++++---------- components/Form/formSchemas.ts | 4 --- components/Form/index.tsx | 19 +++++++------ 11 files changed, 94 insertions(+), 48 deletions(-) create mode 100644 components/Form/Separator.tsx diff --git a/app/page.tsx b/app/page.tsx index 3f0fcf6..a2c83d2 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -17,7 +17,7 @@ export default function Web() { {/* Title */} -
+

Document Upload

{/* Form layout */} diff --git a/components/Form/ErrorMessage.tsx b/components/Form/ErrorMessage.tsx index 4b3534d..7d36578 100644 --- a/components/Form/ErrorMessage.tsx +++ b/components/Form/ErrorMessage.tsx @@ -2,7 +2,7 @@ import React from "react" const ErrorMessage = ({ touched, error }: { touched: boolean; error?: string }) => { if (touched && error) { - return

{error}

+ return

{error}

} return null } diff --git a/components/Form/FileInput.tsx b/components/Form/FileInput.tsx index 89eeba3..712c27a 100644 --- a/components/Form/FileInput.tsx +++ b/components/Form/FileInput.tsx @@ -4,6 +4,7 @@ import { useField, useFormikContext } from "formik"; import React, { useRef, useState } from "react"; import ErrorMessage from "./ErrorMessage"; import RequiredAsterisk from "./RequiredAsterisk"; +import Separator from "./Separator"; interface FileInputProps { label: string; @@ -78,11 +79,17 @@ const FileInput: React.FC = ({ label, ...props }) => { }; return ( -
- +
+ {/* Title */} +
+ + +
+ + {/* File drop area */}
= ({ label, ...props }) => {
+ + {/* Hidden input */} + + {/* File info */} {fileInfo && ( -
+
@@ -111,6 +122,7 @@ const FileInput: React.FC = ({ label, ...props }) => {
)} +
); diff --git a/components/Form/RadioGroup.tsx b/components/Form/RadioGroup.tsx index a356049..5fecb8c 100644 --- a/components/Form/RadioGroup.tsx +++ b/components/Form/RadioGroup.tsx @@ -3,6 +3,7 @@ import { useField } from "formik" import React from "react" import ErrorMessage from "./ErrorMessage" import RequiredAsterisk from "./RequiredAsterisk" +import Separator from "./Separator" const RadioGroupField = ({ name, @@ -23,11 +24,15 @@ const RadioGroupField = ({ } return ( -
- - +
+
+ + +
+ {options.map((option) => (
@@ -36,7 +41,7 @@ const RadioGroupField = ({ value={option} id={`${name}-${option}`} > - +