Skip to content

Commit 691806c

Browse files
authored
Merge pull request #5458 from GeekyAnts/release/3.4.18
Release/3.4.18
2 parents 4e7d078 + 72ed66c commit 691806c

File tree

35 files changed

+430
-280
lines changed

35 files changed

+430
-280
lines changed

example/storybook/stories/hooks/useAccessibleColors/Basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const Example = () => {
4242
</Stack>
4343
<HStack mt="6" space="3">
4444
<Text>Toggle Accessible Colors</Text>
45-
<Switch onToggle={toggleAccessibleColors} colorScheme="coolGray" />
45+
<Switch onValueChange={toggleAccessibleColors} colorScheme="coolGray" />
4646
</HStack>
4747
</Center>
4848
);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import { useSx } from 'native-base';
3+
import type { StyledProps } from 'native-base';
4+
import { View, Text } from 'react-native';
5+
6+
const textStyle: StyledProps = {
7+
color: ['orange.900', 'white', 'black'],
8+
textAlign: 'center',
9+
size: '12',
10+
};
11+
12+
export const Example = () => {
13+
const sx = useSx();
14+
console.log('Size', sx(textStyle));
15+
return (
16+
<View
17+
style={[
18+
sx({
19+
p: 2,
20+
bg: ['blue.300', 'violet.400', 'red.400'],
21+
width: 48,
22+
height: 48,
23+
}),
24+
{ justifyContent: 'center', alignItems: 'center' },
25+
]}
26+
>
27+
<Text style={sx(textStyle)}>New Feat useSx in NativeBase</Text>
28+
</View>
29+
);
30+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
import { storiesOf } from '@storybook/react-native';
3+
import { withKnobs } from '@storybook/addon-knobs';
4+
import Wrapper from '../../components/Wrapper';
5+
import { Example as Basic } from './Basic';
6+
7+
storiesOf('useSx', module)
8+
.addDecorator(withKnobs)
9+
.addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>)
10+
.add('Basic', () => <Basic />);

example/storybook/stories/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export * from './hooks/useMediaQuery';
8686
export * from './hooks/useSafeArea';
8787
export * from './hooks/useContrastText';
8888
export * from './hooks/useAccessibleColors';
89-
89+
export * from './hooks/useSx';
9090
// // Theme
9191
export * from './theme/Custom';
9292
export * from './theme/Mode';

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.4.17",
39+
"version": "3.4.18",
4040
"license": "MIT",
4141
"private": false,
4242
"main": "lib/commonjs/index",

src/components/basic/ScrollView/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface InterfaceScrollViewProps
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-
* pass props to contentContainerStyle, and this also resolved NB tokens.
13+
* Pass props to contentContainerStyle, and this also resolves NB tokens.
1414
*/
1515
_contentContainerStyle?: Partial<IScrollViewProps>;
1616
}

src/components/composites/Actionsheet/types.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import type { CustomProps } from '../../../components/types';
66
export interface InterfaceActionsheetProps
77
extends InterfaceBoxProps<IActionsheetProps> {
88
/**
9-
* If true, the ActionSheet will open. Useful for controllable state behaviour
9+
* If true, the ActionSheet will open. Useful for controllable state behavior.
1010
*/
1111
isOpen?: boolean;
1212
/**
13-
* Callback invoked when the modal is closed
13+
* Callback invoked when the modal is closed.
1414
*/
1515
onClose?: () => any;
1616
/**
@@ -36,15 +36,15 @@ export interface InterfaceActionsheetProps
3636
export interface IActionsheetContentProps
3737
extends InterfaceBoxProps<IActionsheetContentProps> {
3838
/**
39-
* Props applied on area above actionsheet content
39+
* Props applied on area above actionsheet content.
4040
*/
4141
_dragIndicatorWrapperOffSet?: InterfaceBoxProps<IActionsheetContentProps>;
4242
/**
43-
* Props applied on area around drag indicator
43+
* Props applied on area around drag indicator.
4444
*/
4545
_dragIndicatorWrapper?: InterfaceBoxProps<IActionsheetContentProps>;
4646
/**
47-
* Props applied on drag indicator
47+
* Props applied on drag indicator.
4848
*/
4949
_dragIndicator?: InterfaceBoxProps<IActionsheetContentProps>;
5050
}

src/components/composites/Alert/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface InterfaceAlertProps extends InterfaceBoxProps<IAlertProps> {
1313
*/
1414
variant?: VariantType<'Alert'>;
1515

16-
/** The colorScheme of the Alert.
16+
/** The color scheme of the Alert.
1717
*/
1818
colorScheme?: ColorSchemeType;
1919
}

src/components/composites/Avatar/types.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ export interface InterfaceAvatarProps extends InterfaceBoxProps<IAvatarProps> {
1010
*/
1111
source?: ImageSourcePropType;
1212
/**
13-
* The size of the avatar
13+
* The size of the avatar.
1414
* @default md
1515
*/
1616
size?: ThemeComponentSizeType<'Avatar'>;
1717
/**
18-
* For providing props to Image component inside Avatar
18+
* For providing props to Image component inside the Avatar.
1919
*/
2020
_image?: Partial<IImageProps>;
2121
/**
22-
* ref to be attached to Avatar wrapper
22+
* ref to be attached to the Avatar wrapper.
2323
*/
2424
wrapperRef?: MutableRefObject<any>;
2525
}

src/components/composites/Fab/types.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ import type { InterfaceButtonProps } from '../../primitives/Button/types';
33

44
export interface InterfaceFabProps extends InterfaceButtonProps {
55
/**
6-
* Placement of the Fab
6+
* Placement of the Fab.
77
* @default bottom-right
88
*/
99
placement?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
1010
/**
11-
* Text to be displayed in Fab
11+
* Text to be displayed in Fab.
1212
*/
1313
label?: JSX.Element | string;
1414
/**
15-
* Icon to be displayed in Fab
15+
* Icon to be displayed in Fab.
1616
*/
1717
icon?: JSX.Element;
1818
/**
1919
* Determines whether the Fab should be rendered in a Portal.
20-
* Refer this solution before using this prop
20+
* Refer to this solution before using this prop-
2121
* https://github.com/GeekyAnts/NativeBase/issues/3817
2222
* @default true
2323
*/

0 commit comments

Comments
 (0)