import { FC, useCallback, useEffect, useState } from 'react'; import { Col, Container, Row, TouchableHighlight } from 'components/layout'; import { Text } from 'components/text'; import { Visible } from 'components/visible'; import { Divider } from 'components/divider'; import { Avatar } from 'components/avatar'; import { Button } from 'components/button'; import { TextField } from 'components/text-field'; import { useProfile, useResponsiveLayout } from 'hooks'; import { Formik } from 'formik'; import { isProfileOpenVar } from 'state-management/dialogs'; import { useUpdateUserMutation } from 'expo-schema'; export const Edit: FC = ({ userId, setIsEdit }) => { const { isMobile } = useResponsiveLayout(); const { profile } = useProfile(); const [id, setId] = useState(); const [updateUser] = useUpdateUserMutation({}); const direction = isMobile ? 'column' : 'row'; const ml = isMobile ? undefined : 'l'; const mt = isMobile ? 'l' : undefined; const px = isMobile ? 's' : 'l'; const mtTextField = isMobile ? 'xs' : undefined; useEffect(() => { setId(userId); }, [userId]); const closeDialog = useCallback(() => { if (setIsEdit) { setIsEdit(false); } isProfileOpenVar(false); }, [setIsEdit]); return ( {}}> updateUser({ variables: { input: { id: id as string, ...values, }, }, }) } > {({ handleChange, handleBlur, handleSubmit, values }) => ( <> First Name Last Name Pronouns Location Bio <>