Skip to content

Commit d617680

Browse files
committed
Rest operator on props and index.ts for types added
1 parent 5ea929d commit d617680

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/components/screens/profile/ProfileControlledInput.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ import { ControlledField } from '@baca/components'
22
import { isWeb } from '@baca/constants'
33
import { Box, Text } from '@baca/design-system'
44
import { useWeb } from '@baca/hooks'
5-
import { ProfileControlledInputProps } from '@baca/types/ProfileInputProps'
5+
import { ProfileControlledInputProps } from '@baca/types'
66
import { StyleSheet } from 'react-native'
77

88
export const ProfileControlledInput = ({
99
label,
1010
name,
11-
placeholder,
12-
control,
13-
errors,
1411
isDisabled = false,
15-
onFocus,
16-
onSubmitEditing,
12+
...rest
1713
}: ProfileControlledInputProps) => {
1814
const { shouldApplyMobileStyles } = useWeb()
1915

@@ -29,16 +25,12 @@ export const ProfileControlledInput = ({
2925
</Text.SmBold>
3026
<Box flex={isWeb ? 2 : 0}>
3127
<ControlledField.Input
32-
control={control}
33-
errors={errors}
3428
autoCapitalize="none"
3529
inputMode={name === 'email' ? 'email' : 'text'}
3630
name={name}
37-
placeholder={placeholder}
3831
testID={`${name}Input`}
3932
isDisabled={isDisabled}
40-
onFocus={onFocus}
41-
onSubmitEditing={onSubmitEditing}
33+
{...rest}
4234
/>
4335
</Box>
4436
</Box>

src/types/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './i18next'
2+
export * from './icon'
3+
export * from './ProfileInputProps'
4+
export * from './testForm'

0 commit comments

Comments
 (0)