11import { ControlledField } from '@baca/components'
22import { isWeb } from '@baca/constants'
3- import { Text , Box } from '@baca/design-system'
4- import {
5- useCallback ,
6- useTranslation ,
7- useUpdateProfileForm ,
8- useScreenOptions ,
9- useWeb ,
10- } from '@baca/hooks'
3+ import { Text , Box , Button , Spacer , Row } from '@baca/design-system'
4+ import { useCallback , useTranslation , useUpdateProfileForm , useWeb } from '@baca/hooks'
5+ import { useRouter } from 'expo-router'
116
127export const ProfileDetailsForm = ( ) => {
138 const { t } = useTranslation ( )
149 const { shouldApplyMobileStyles } = useWeb ( )
15- const { control, errors, setFocus, submit } = useUpdateProfileForm ( )
16-
17- useScreenOptions ( {
18- title : t ( 'navigation.screen_titles.profile' ) ,
19- } )
10+ const { control, errors, setFocus, submit, isSubmitting } = useUpdateProfileForm ( )
11+ const { back } = useRouter ( )
2012
2113 const focusLastNameInput = useCallback ( ( ) => setFocus ( 'lastName' ) , [ setFocus ] )
2214
@@ -37,8 +29,8 @@ export const ProfileDetailsForm = () => {
3729 inputMode = "text"
3830 name = "firstName"
3931 onFocus = { focusLastNameInput }
40- placeholder = { t ( 'form.placeholders.email ' ) }
41- testID = "emailInput "
32+ placeholder = { t ( 'form.placeholders.first_name ' ) }
33+ testID = "firstNameInput "
4234 { ...( ! isWeb && {
4335 label : t ( 'form.labels.first_name' ) ,
4436 } ) }
@@ -89,6 +81,25 @@ export const ProfileDetailsForm = () => {
8981 />
9082 </ Box >
9183 </ Box >
84+ < Row maxW = { 800 } justifyContent = "flex-end" >
85+ < Button . SecondaryColor
86+ disabled = { isSubmitting }
87+ loading = { isSubmitting }
88+ onPress = { back }
89+ testID = "backProfileButton"
90+ >
91+ { t ( 'common.cancel' ) }
92+ </ Button . SecondaryColor >
93+ < Spacer x = "4" />
94+ < Button
95+ disabled = { isSubmitting }
96+ loading = { isSubmitting }
97+ onPress = { submit }
98+ testID = "saveProfileUpdateButton"
99+ >
100+ { t ( 'common.save' ) }
101+ </ Button >
102+ </ Row >
92103 </ Box >
93104 </ Box >
94105 )
0 commit comments