Skip to content

Commit 0f237af

Browse files
authored
Merge pull request #4806 from GeekyAnts/fix/type-basic-components
Fix/type basic components
2 parents 8d22bd2 + 18127e2 commit 0f237af

File tree

8 files changed

+37
-14
lines changed

8 files changed

+37
-14
lines changed

example/storybook/stories/components/Wrapper.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ const myTheme = extendTheme({
3333
myBtn: {
3434
padding: 10,
3535
},
36-
myNewButton: ({ myPadding }: { myPadding: number }) => {
36+
myNewButton: ({ myPaddingX }: { myPaddingX: number }) => {
3737
return {
38-
padding: myPadding,
38+
padding: myPaddingX,
3939
};
4040
},
4141
},
@@ -115,6 +115,7 @@ export function RenderTestButton() {
115115
return (
116116
<Box style={{ position: 'absolute', top: 10, left: 20 }} m={2} bg="red.100">
117117
<Button
118+
variant={'myNewButton'}
118119
// title={state.toString()}
119120
onPress={() => setState(state + 1)}
120121
/>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"prettier --write"
3737
]
3838
},
39-
"version": "3.3.8-alpha.6",
39+
"version": "3.3.8-alpha.7",
4040
"license": "MIT",
4141
"private": false,
4242
"main": "lib/commonjs/index",
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { StyledProps } from '../../../theme/types';
22
import type { FlatListProps } from 'react-native';
3-
import type { PlatformProps } from '../../types';
3+
import type { CustomProps, PlatformProps } from '../../types';
44

5-
export interface IFlatListProps<ItemT>
5+
export interface InterfaceFlatListProps<ItemT>
66
extends FlatListProps<ItemT>,
77
StyledProps,
88
PlatformProps<IFlatListProps<ItemT>> {
@@ -11,3 +11,7 @@ export interface IFlatListProps<ItemT>
1111
*/
1212
_contentContainerStyle?: IFlatListProps<ItemT>;
1313
}
14+
15+
export type IFlatListProps<ItemT> =
16+
| InterfaceFlatListProps<ItemT>
17+
| CustomProps<'FlatList'>;
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import type { KeyboardAvoidingViewProps } from 'react-native';
22
import type { StyledProps } from '../../../theme/types';
3-
import type { PlatformProps } from '../../types';
3+
import type { CustomProps, PlatformProps } from '../../types';
44

5-
export interface IKeyboardAvoidingViewProps
5+
export interface InterfaceKeyboardAvoidingViewProps
66
extends KeyboardAvoidingViewProps,
77
StyledProps,
88
PlatformProps<IKeyboardAvoidingViewProps> {
99
/**
1010
* Renders components as Box children. Accepts a JSX.Element or an array of JSX.Element. */
1111
children?: JSX.Element | JSX.Element[] | string | any;
1212
}
13+
14+
export type IKeyboardAvoidingViewProps =
15+
| InterfaceKeyboardAvoidingViewProps
16+
| CustomProps<'KeyboardAvoidingView'>;

src/components/basic/ScrollView/types.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { ScrollViewProps } from 'react-native';
22
import type { StyledProps } from '../../../theme/types';
3-
import type { PlatformProps } from '../../types';
3+
import type { CustomProps, PlatformProps } from '../../types';
44

5-
export interface IScrollViewProps
5+
export interface InterfaceScrollViewProps
66
extends ScrollViewProps,
77
StyledProps,
88
PlatformProps<IScrollViewProps> {
@@ -14,3 +14,7 @@ export interface IScrollViewProps
1414
*/
1515
_contentContainerStyle?: IScrollViewProps;
1616
}
17+
18+
export type IScrollViewProps =
19+
| InterfaceScrollViewProps
20+
| CustomProps<'ScrollView'>;
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import type { StyledProps } from '../../../theme/types';
22
import type { SectionListProps } from 'react-native';
3-
import type { PlatformProps } from '../../types';
3+
import type { CustomProps, PlatformProps } from '../../types';
44
type DefaultSectionT = {
55
[key: string]: any;
66
};
77
// TODO: any need to fixed
8-
export interface ISectionListProps<ItemT, sectionT = DefaultSectionT>
8+
export interface InterfaceSectionListProps<ItemT, sectionT = DefaultSectionT>
99
extends SectionListProps<ItemT, sectionT>,
1010
StyledProps,
1111
PlatformProps<ISectionListProps<ItemT, sectionT>> {}
12+
13+
export type ISectionListProps<ItemT, sectionT = DefaultSectionT> =
14+
| InterfaceSectionListProps<ItemT, sectionT>
15+
| CustomProps<'SectionList'>;
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import type { StatusBarProps } from 'react-native';
2+
import type { CustomProps } from '../../../components/types';
23

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

src/components/basic/View/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import type { StyledProps } from '../../../theme/types';
22
import type { ViewProps } from 'react-native';
3-
import type { PlatformProps } from '../../types';
3+
import type { CustomProps, PlatformProps } from '../../types';
44

5-
export interface IViewProps
5+
export interface InterfaceViewProps
66
extends ViewProps,
77
StyledProps,
88
PlatformProps<IViewProps> {
99
/**
1010
* Renders components as Box children. Accepts a JSX.Element or an array of JSX.Element. */
1111
children?: JSX.Element | JSX.Element[] | string | any;
1212
}
13+
14+
export type IViewProps = InterfaceViewProps | CustomProps<'View'>;

0 commit comments

Comments
 (0)