Skip to content

Commit 5ae8f07

Browse files
committed
fix: input type fixes
1 parent be65430 commit 5ae8f07

File tree

61 files changed

+277
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+277
-163
lines changed

example/storybook/stories/components/Wrapper.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
SunIcon,
1212
extendTheme,
1313
Button,
14+
Input,
1415
} from 'native-base';
1516
import type { StorageManager } from 'native-base';
1617
import AsyncStorage from '@react-native-async-storage/async-storage';
@@ -38,6 +39,12 @@ const myTheme = extendTheme({
3839
padding: myPaddingX,
3940
};
4041
},
42+
43+
myNewButton1: (props: any) => {
44+
return {
45+
padding: props.padding,
46+
};
47+
},
4148
},
4249
sizes: {
4350
newsize: ({ mySize }: { mySize: number }) => {
@@ -48,6 +55,22 @@ const myTheme = extendTheme({
4855
},
4956
},
5057

58+
Input: {
59+
variants: {
60+
newsize: ({ mySize }: { mySize: number }) => {
61+
return {
62+
padding: mySize,
63+
};
64+
},
65+
66+
newsize1: (props: any) => {
67+
return {
68+
padding: props.padding,
69+
};
70+
},
71+
},
72+
},
73+
5174
Checkbox: {
5275
sizes: {
5376
myBtn: {
@@ -114,6 +137,7 @@ export function RenderTestButton() {
114137
const [state, setState] = React.useState(1);
115138
return (
116139
<Box style={{ position: 'absolute', top: 10, left: 20 }} m={2} bg="red.100">
140+
<Input m={2} />
117141
<Button
118142
variant={'myNewButton'}
119143
// title={state.toString()}

src/components/basic/FlatList/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ export interface InterfaceFlatListProps<ItemT>
1212
_contentContainerStyle?: Partial<IFlatListProps<ItemT>>;
1313
}
1414

15-
export type IFlatListProps<ItemT> =
16-
| InterfaceFlatListProps<ItemT>
17-
| CustomProps<'FlatList'>;
15+
export type IFlatListProps<ItemT> = InterfaceFlatListProps<ItemT> &
16+
CustomProps<'FlatList'>;

src/components/basic/KeyboardAvoidingView/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ export interface InterfaceKeyboardAvoidingViewProps
1111
children?: JSX.Element | JSX.Element[] | string | any;
1212
}
1313

14-
export type IKeyboardAvoidingViewProps =
15-
| InterfaceKeyboardAvoidingViewProps
16-
| CustomProps<'KeyboardAvoidingView'>;
14+
export type IKeyboardAvoidingViewProps = InterfaceKeyboardAvoidingViewProps &
15+
CustomProps<'KeyboardAvoidingView'>;

src/components/basic/ScrollView/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ export interface InterfaceScrollViewProps
1515
_contentContainerStyle?: Partial<IScrollViewProps>;
1616
}
1717

18-
export type IScrollViewProps =
19-
| InterfaceScrollViewProps
20-
| CustomProps<'ScrollView'>;
18+
export type IScrollViewProps = InterfaceScrollViewProps &
19+
CustomProps<'ScrollView'>;

src/components/basic/SectionList/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface InterfaceSectionListProps<ItemT, sectionT = DefaultSectionT>
1010
StyledProps,
1111
PlatformProps<ISectionListProps<ItemT, sectionT>> {}
1212

13-
export type ISectionListProps<ItemT, sectionT = DefaultSectionT> =
14-
| InterfaceSectionListProps<ItemT, sectionT>
15-
| CustomProps<'SectionList'>;
13+
export type ISectionListProps<
14+
ItemT,
15+
sectionT = DefaultSectionT
16+
> = InterfaceSectionListProps<ItemT, sectionT> & CustomProps<'SectionList'>;

src/components/basic/StatusBar/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ import type { StatusBarProps } from 'react-native';
22
import type { CustomProps } from '../../../components/types';
33

44
export interface InterfaceStatusBarProps extends StatusBarProps {}
5-
export type IStatusBarProps =
6-
| InterfaceStatusBarProps
7-
| CustomProps<'StatusBar'>;
5+
export type IStatusBarProps = InterfaceStatusBarProps &
6+
CustomProps<'StatusBar'>;

src/components/basic/View/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export interface InterfaceViewProps
1111
children?: JSX.Element | JSX.Element[] | string | any;
1212
}
1313

14-
export type IViewProps = InterfaceViewProps | CustomProps<'View'>;
14+
export type IViewProps = InterfaceViewProps & CustomProps<'View'>;

src/components/composites/Actionsheet/types.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,5 @@ export type IActionsheetComponentType = ((
6262
>;
6363
};
6464

65-
export type IActionsheetProps =
66-
| InterfaceActionsheetProps
67-
| CustomProps<'Actionsheet'>;
65+
export type IActionsheetProps = InterfaceActionsheetProps &
66+
CustomProps<'Actionsheet'>;

src/components/composites/Alert/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ export type IAlertComponentType = ((
3232
>;
3333
};
3434

35-
export type IAlertProps = InterfaceAlertProps | CustomProps<'Alert'>;
35+
export type IAlertProps = InterfaceAlertProps & CustomProps<'Alert'>;

src/components/composites/AlertDialog/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,5 @@ export type IAlertDialogComponentType = ((
8383
>;
8484
};
8585

86-
export type IAlertDialogProps =
87-
| InterfaceAlertDialogProps
88-
| CustomProps<'AlertDialog'>;
86+
export type IAlertDialogProps = InterfaceAlertDialogProps &
87+
CustomProps<'AlertDialog'>;

0 commit comments

Comments
 (0)