From 07c8e2f7d9ec2ff76af817b0982e26e8f1c60611 Mon Sep 17 00:00:00 2001 From: Omotola Odusanya Date: Sat, 20 Jul 2024 14:49:36 +0100 Subject: [PATCH 01/27] 124-Bio --- .hintrc | 8 + app/components/constant/index.tsx | 19 +++ app/components/textarea/index.tsx | 45 ++++++ app/components/typings/index.tsx | 17 ++ app/routes/_index.tsx | 70 ++++---- package-lock.json | 254 ++++++++++++++++-------------- 6 files changed, 255 insertions(+), 158 deletions(-) create mode 100644 .hintrc create mode 100644 app/components/constant/index.tsx create mode 100644 app/components/textarea/index.tsx create mode 100644 app/components/typings/index.tsx diff --git a/.hintrc b/.hintrc new file mode 100644 index 00000000..cb34607d --- /dev/null +++ b/.hintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "development" + ], + "hints": { + "no-inline-styles": "off" + } +} \ No newline at end of file diff --git a/app/components/constant/index.tsx b/app/components/constant/index.tsx new file mode 100644 index 00000000..8e577074 --- /dev/null +++ b/app/components/constant/index.tsx @@ -0,0 +1,19 @@ +import { IFormState, IFormError } from "../typings"; + +export enum FormField { + bio = "bio", +} + +export const defaultFormState: IFormState = { + [FormField.bio]: "", +}; + + +export const defaultFormError: IFormError = { + [FormField.bio]: null, +}; + +export const defaultAlert: { message: string | null; classType?: string } = { + message: null, + classType: undefined, +}; diff --git a/app/components/textarea/index.tsx b/app/components/textarea/index.tsx new file mode 100644 index 00000000..d9d486c8 --- /dev/null +++ b/app/components/textarea/index.tsx @@ -0,0 +1,45 @@ +import React from "react"; + +interface Props { + label: string; + name: string; + value: string; + placeholder?: string; + disabled?: boolean; + error?: string | null; + handleChange: (e: React.ChangeEvent) => void; + style?: React.CSSProperties; +} + +export const TextAreaField: React.FC = ({ + label, + name, + placeholder, + disabled, + value, + error, + handleChange, +}) => { + return ( +
+ +
+
+