Skip to content

Commit 5c52b85

Browse files
authored
Merge pull request #5533 from GeekyAnts/release/3.4.21
release 3.4.21
2 parents 35ee103 + 13778e2 commit 5c52b85

File tree

13 files changed

+43
-37
lines changed

13 files changed

+43
-37
lines changed

example/storybook/stories/components/Wrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function MyWrapper({ children }: any) {
123123
bg={bgColor}
124124
safeAreaY
125125
>
126-
{/* <Tooltip
126+
<Tooltip
127127
label={colorMode === 'dark' ? 'Enable light mode' : 'Enable dark mode'}
128128
placement="bottom right"
129129
openDelay={300}
@@ -138,7 +138,7 @@ function MyWrapper({ children }: any) {
138138
icon={colorMode === 'dark' ? <SunIcon /> : <MoonIcon />}
139139
size="lg"
140140
/>
141-
</Tooltip> */}
141+
</Tooltip>
142142
{children}
143143
</Box>
144144
);

example/storybook/stories/components/primitives/Input/Addons.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010

1111
export const Example = () => {
1212
return (
13-
<Stack alignItems="center">
14-
<InputGroup w={{ base: '70%', md: '285' }}>
13+
<Stack>
14+
<InputGroup w={{ base: '70%', md: '285' }} justifyContent="center">
1515
<InputLeftAddon children={'https://'} />
1616
<Input w={{ base: '70%', md: '100%' }} placeholder="nativebase" />
1717
<InputRightAddon children={'.io'} />

example/storybook/stories/components/primitives/Select/FormControlled.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
export const Example = () => {
1111
return (
1212
<Center>
13-
<FormControl w="3/4" maxW="300" isRequired isInvalid>
13+
<FormControl maxW="300" isRequired isInvalid>
1414
<FormControl.Label>Choose service</FormControl.Label>
1515
<Select
1616
minWidth="200"

example/storybook/stories/components/primitives/Select/SelectLongList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export const Example = () => {
5454
];
5555
return (
5656
<Container>
57-
<FormControl>
57+
<FormControl maxW="300">
5858
<FormControl.Label>Select Color</FormControl.Label>
5959
<Select
6060
selectedValue={value}
61-
minWidth="100"
61+
minWidth="200"
6262
accessibilityLabel="Select a Color"
6363
placeholder="Select a Color"
6464
onValueChange={(itemValue) => {

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

src/components/composites/Avatar/Group.tsx

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const getAvatarGroupChildren = (
2222
plusAvatars = childrenArray.length - max;
2323
childrenArray = childrenArray.slice(0, max);
2424
}
25-
const trailingChildren = childrenArray.slice(1);
2625
const spacingProps = {
2726
ml: isVertical ? 0 : space,
2827
mt: isVertical ? space : 0,
@@ -38,29 +37,18 @@ const getAvatarGroupChildren = (
3837
{'+ ' + plusAvatars}
3938
</Avatar>
4039
) : null,
41-
React.Children.map(
42-
trailingChildren.reverse(),
43-
(child: any, index: number) => {
44-
return React.cloneElement(
45-
child,
46-
{
47-
key: `avatar-group-child-${index}`,
48-
..._avatar,
49-
...spacingProps,
50-
...child.props,
51-
},
52-
child.props.children
53-
);
54-
}
55-
),
56-
React.cloneElement(
57-
childrenArray[0],
58-
{
59-
..._avatar,
60-
...childrenArray[0].props,
61-
},
62-
childrenArray[0].props.children
63-
),
40+
React.Children.map(childrenArray.reverse(), (child: any, index: number) => {
41+
return React.cloneElement(
42+
child,
43+
{
44+
key: `avatar-group-child-${index}`,
45+
..._avatar,
46+
...spacingProps,
47+
...child.props,
48+
},
49+
child.props.children
50+
);
51+
}),
6452
];
6553
};
6654

src/components/composites/Popover/Popover.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const Popover = (
2727
finalFocusRef,
2828
useRNModal,
2929
trapFocus = true,
30+
_backdrop,
3031
...props
3132
}: IPopoverProps,
3233
ref: any
@@ -101,7 +102,7 @@ const Popover = (
101102
style={StyleSheet.absoluteFill}
102103
>
103104
<Popper onClose={handleClose} triggerRef={triggerRef} {...props}>
104-
<Backdrop onPress={handleClose} bg="transparent" />
105+
<Backdrop onPress={handleClose} bg="transparent" {..._backdrop} />
105106
<PopoverContext.Provider
106107
value={{
107108
onClose: handleClose,

src/components/composites/Popover/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ export interface InterfacePopoverProps {
103103
* @default false
104104
*/
105105
useRNModal?: boolean;
106+
/**
107+
* Props applied on backdrop.
108+
*/
109+
_backdrop?: any;
106110
}
107111

108112
export type IPopoverContentImpl = {

src/factory/component.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ export default function Factory<P>(
99
componentTheme?: ComponentTheme
1010
) {
1111
return React.forwardRef(
12-
({ children, ...props }: P & FactoryComponentProps, ref: any) => {
12+
({ children, _state, ...props }: P & FactoryComponentProps, ref: any) => {
1313
const StyledComponent = useMemo(() => makeStyledComponent(Component), []);
1414
const calculatedProps = usePropsWithComponentTheme(
1515
componentTheme ?? {},
16-
props
16+
props,
17+
_state
1718
);
1819
return (
1920
<StyledComponent {...(calculatedProps as P)} ref={ref}>

src/factory/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type { PlatformProps } from '../components/types';
22
import type { StyledProps } from '../theme/types';
3+
import type { IStateProps } from '../hooks/useThemeProps/propsFlattener';
34

45
export type FactoryComponentProps = StyledProps &
56
PlatformProps<StyledProps> & {
67
children?: string | JSX.Element | JSX.Element[];
8+
_state?: IStateProps;
79
};

0 commit comments

Comments
 (0)