11import { ControlledField } from '@baca/components'
22import { isWeb } from '@baca/constants'
33import { Text , Box } from '@baca/design-system'
4- import { useTranslation , useWeb } from '@baca/hooks'
5- import { I18nKeys } from '@baca/types/i18next'
6- import { Control , FieldErrors } from 'react-hook-form'
7-
8- interface ProfileControlledInputProps {
9- labelTx : I18nKeys
10- name : string
11- placeholderTx : I18nKeys
12- control : Control
13- errors : FieldErrors
14- isDisabled ?: boolean
15- onFocus ?: ( ) => void
16- onSubmitEditing ?: ( ) => void
17- }
4+ import { useWeb } from '@baca/hooks'
5+ import { ProfileControlledInputProps } from '@baca/types/ProfileInputProps'
186
197export const ProfileControlledInput = ( {
20- labelTx ,
8+ label ,
219 name,
22- placeholderTx ,
10+ placeholder ,
2311 control,
2412 errors,
2513 isDisabled = false ,
2614 onFocus,
2715 onSubmitEditing,
2816} : ProfileControlledInputProps ) => {
29- const { t } = useTranslation ( )
3017 const { shouldApplyMobileStyles } = useWeb ( )
3118
3219 return (
@@ -36,20 +23,20 @@ export const ProfileControlledInput = ({
3623 mb = { isWeb ? 10 : 0 }
3724 maxW = { 800 }
3825 >
39- < Text . SmBold flex = { 1 } > { t ( labelTx ) } </ Text . SmBold >
26+ < Text . SmBold flex = { 1 } > { label } </ Text . SmBold >
4027 < Box flex = { isWeb ? 2 : 0 } >
4128 < ControlledField . Input
4229 control = { control }
4330 errors = { errors }
4431 autoCapitalize = "none"
4532 inputMode = { name === 'email' ? 'email' : 'text' }
4633 name = { name }
47- placeholder = { t ( placeholderTx ) }
34+ placeholder = { placeholder }
4835 testID = { `${ name } Input` }
4936 isDisabled = { isDisabled }
5037 onFocus = { onFocus }
5138 onSubmitEditing = { onSubmitEditing }
52- { ...( ! isWeb && { label : t ( labelTx ) } ) }
39+ { ...( ! isWeb && { label } ) }
5340 />
5441 </ Box >
5542 </ Box >
0 commit comments