diff --git a/src/Components/AddMemory/index.tsx b/src/Components/AddMemory/index.tsx new file mode 100644 index 0000000..d729495 --- /dev/null +++ b/src/Components/AddMemory/index.tsx @@ -0,0 +1,182 @@ +import { FC } from 'react' +import { useFormik } from 'formik' +import { Box, Grid, Flex, GridItem } from '@chakra-ui/react' +import { FilledButton } from 'Components/Buttons' +import { Input, TextArea } from 'Components/Forms' +import { Views } from 'Views/Memories' +import useAuth from 'Utils/Providers/AuthContextProvider' + +import { authStore } from 'Stores/auth.store' + +const AddMemory: FC<{ isAdd?: boolean; toggle?: (e: Views) => void }> = ({ + isAdd, + toggle +}) => { + const { isLoading, login } = useAuth() + + const user = authStore(state => state.user) + + interface IUser { + avatar: any + email: string + firstName: string + lastName: string + password?: string + phoneNumber: string + gender?: string + address?: string + occupation?: string + dob?: string + race?: string + country?: string + tribe?: string + religion?: string + } + + interface IMemory { + name: string + location: string + date: string + member: string + file: string + note: '' + } + + const formik = useFormik({ + initialValues: { + name: '', + location: '', + date: '', + member: '', + file: '', + note: '' + }, + onSubmit: async values => { + // await login(values) + } + }) + + return ( +
+ + + + + + + + + + + + + + + + {isAdd ? ( + <> + + + {toggle && ( + toggle('view')} + /> + )} + + ) : ( + + )} + +
+ ) +} + +export default AddMemory diff --git a/src/Components/Forms/FormTextArea.tsx b/src/Components/Forms/FormTextArea.tsx index fcf5bd3..bd1afe8 100644 --- a/src/Components/Forms/FormTextArea.tsx +++ b/src/Components/Forms/FormTextArea.tsx @@ -20,8 +20,23 @@ const FormTextArea: FC = ({ }) => { return ( - {label} -