diff --git a/packages/web/components/patterns/FormModal.tsx b/packages/web/components/patterns/FormModal.tsx index e1a76fcf8..14244a4c0 100644 --- a/packages/web/components/patterns/FormModal.tsx +++ b/packages/web/components/patterns/FormModal.tsx @@ -7,6 +7,9 @@ import { Box, HStack, VStack } from '../elements/LayoutPrimitives' import { Button } from '../elements/Button' import { StyledText } from '../elements/StyledText' import { useState } from 'react' +import { FormInput } from '../elements/FormElements' +import { CrossIcon } from '../elements/images/CrossIcon' +import { theme } from '../tokens/stitches.config' export interface FormInputProps { name: string @@ -34,12 +37,36 @@ export function FormModal(props: FormModalProps): JSX.Element { return ( - - - {props.title} - - - + { + event.preventDefault() + props.onOpenChange(false) + }} + css={{ overflow: 'auto', p: '0' }} + > + + + + {props.title} + + + +
{ event.preventDefault() @@ -48,34 +75,74 @@ export function FormModal(props: FormModalProps): JSX.Element { }} > {inputs.map((input, index) => ( - - {input.label} - { - if (input.onChange) { - inputs[index].value = event.target.value - setInputs(inputs) - input.onChange( - event.target.value || event.target.checked - ) - } + + + + { + if (input.onChange) { + inputs[index].value = event.target.value + setInputs(inputs) + input.onChange( + event.target.value || event.target.checked + ) + } + }} + disabled={input.disabled} + hidden={input.hidden} + required={input.required} + checked={input.value} + css={{ + border: '1px solid $grayBorder', + borderRadius: '8px', + width: '100%', + bg: 'transparent', + fontSize: '16px', + textIndent: '8px', + marginBottom: '2px', + color: '$grayTextContrast', + '&:focus': { + outline: 'none', + boxShadow: + '0px 0px 2px 2px rgba(255, 234, 159, 0.56)', + }, + }} + /> + ))} - - - +