From 7e16f500cb7bc0cfd8bafbf6bb1555704f771231 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 29 Apr 2022 12:13:34 +0200 Subject: chore: remove old pages, components, helpers and types Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch. --- src/components/FormElements/Field/Field.tsx | 106 ---------------------------- 1 file changed, 106 deletions(-) delete mode 100644 src/components/FormElements/Field/Field.tsx (limited to 'src/components/FormElements/Field/Field.tsx') diff --git a/src/components/FormElements/Field/Field.tsx b/src/components/FormElements/Field/Field.tsx deleted file mode 100644 index c8df0f9..0000000 --- a/src/components/FormElements/Field/Field.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import { - ChangeEvent, - ForwardedRef, - forwardRef, - ReactElement, - SetStateAction, -} from 'react'; -import styles from './Field.module.scss'; - -type FieldType = 'email' | 'number' | 'search' | 'select' | 'text' | 'textarea'; -type SelectOptions = { - id: string; - name: string; - value: string; -}; - -const Field = ( - { - id, - name, - value, - setValue, - required = false, - kind = 'text', - label, - options, - }: { - id: string; - name: string; - value: string; - setValue: (value: SetStateAction) => void; - required?: boolean; - kind?: FieldType; - label?: ReactElement; - options?: SelectOptions[]; - }, - ref: ForwardedRef -) => { - const updateValue = ( - e: ChangeEvent - ) => { - setValue(e.target.value); - }; - - const getOptions = () => { - return options - ? options.map((option) => ( - - )) - : ''; - }; - - const getField = () => { - switch (kind) { - case 'select': - return ( - - ); - case 'textarea': - return ( -