From 0c2599af988081f2ce83c383758dcbc0aa8caff9 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 29 Dec 2023 16:29:23 -0800 Subject: [PATCH 1/3] Fix types --- src/components/Icon/index.tsx | 1 + src/components/TextInput/BaseTextInput/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Icon/index.tsx b/src/components/Icon/index.tsx index 732fe90deae2..27d7a2f217da 100644 --- a/src/components/Icon/index.tsx +++ b/src/components/Icon/index.tsx @@ -104,3 +104,4 @@ function Icon({ Icon.displayName = 'Icon'; export default Icon; +export type {IconProps}; diff --git a/src/components/TextInput/BaseTextInput/types.ts b/src/components/TextInput/BaseTextInput/types.ts index 37dcb0de8f31..3316ba61944d 100644 --- a/src/components/TextInput/BaseTextInput/types.ts +++ b/src/components/TextInput/BaseTextInput/types.ts @@ -2,7 +2,7 @@ import React from 'react'; import type {Component, ForwardedRef} from 'react'; import type {GestureResponderEvent, StyleProp, TextInputProps, TextStyle, ViewStyle} from 'react-native'; import type {AnimatedProps} from 'react-native-reanimated'; -import type {SrcProps} from '@components/Icon'; +import type {IconProps} from '@components/Icon'; import type {MaybePhraseKey} from '@libs/Localize'; type CustomBaseTextInputProps = { @@ -25,7 +25,7 @@ type CustomBaseTextInputProps = { errorText?: MaybePhraseKey; /** Icon to display in right side of text input */ - icon: ((props: SrcProps) => React.ReactNode) | null; + icon: ((props: IconProps) => React.ReactNode) | null; /** Customize the TextInput container */ textInputContainerStyles?: StyleProp; From 018585b9a8a3ad89696c558592be08fca4355c15 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 29 Dec 2023 16:34:28 -0800 Subject: [PATCH 2/3] Use IconAsset instead of IconProps --- src/components/Icon/index.tsx | 1 - src/components/TextInput/BaseTextInput/types.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Icon/index.tsx b/src/components/Icon/index.tsx index 27d7a2f217da..732fe90deae2 100644 --- a/src/components/Icon/index.tsx +++ b/src/components/Icon/index.tsx @@ -104,4 +104,3 @@ function Icon({ Icon.displayName = 'Icon'; export default Icon; -export type {IconProps}; diff --git a/src/components/TextInput/BaseTextInput/types.ts b/src/components/TextInput/BaseTextInput/types.ts index 3316ba61944d..20950c2f4543 100644 --- a/src/components/TextInput/BaseTextInput/types.ts +++ b/src/components/TextInput/BaseTextInput/types.ts @@ -2,8 +2,8 @@ import React from 'react'; import type {Component, ForwardedRef} from 'react'; import type {GestureResponderEvent, StyleProp, TextInputProps, TextStyle, ViewStyle} from 'react-native'; import type {AnimatedProps} from 'react-native-reanimated'; -import type {IconProps} from '@components/Icon'; import type {MaybePhraseKey} from '@libs/Localize'; +import IconAsset from '@src/types/utils/IconAsset'; type CustomBaseTextInputProps = { /** Input label */ @@ -25,7 +25,7 @@ type CustomBaseTextInputProps = { errorText?: MaybePhraseKey; /** Icon to display in right side of text input */ - icon: ((props: IconProps) => React.ReactNode) | null; + icon: IconAsset | null; /** Customize the TextInput container */ textInputContainerStyles?: StyleProp; From 8e06e6366767b1f555d969cf1a846cb9588d0d0e Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 29 Dec 2023 16:36:11 -0800 Subject: [PATCH 3/3] Remove unused React import --- src/components/TextInput/BaseTextInput/types.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/TextInput/BaseTextInput/types.ts b/src/components/TextInput/BaseTextInput/types.ts index 20950c2f4543..2b8264af815b 100644 --- a/src/components/TextInput/BaseTextInput/types.ts +++ b/src/components/TextInput/BaseTextInput/types.ts @@ -1,4 +1,3 @@ -import React from 'react'; import type {Component, ForwardedRef} from 'react'; import type {GestureResponderEvent, StyleProp, TextInputProps, TextStyle, ViewStyle} from 'react-native'; import type {AnimatedProps} from 'react-native-reanimated';