Skip to content

Commit 95c1994

Browse files
committed
fix(BottomNavigationAction): Removed extra props
1 parent efe2258 commit 95c1994

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed
Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
import { BottomNavigationActionProps, DynamicIcon } from '@bluebase/components';
2+
23
import MuiBottomNavigationAction from '@material-ui/core/BottomNavigationAction';
34
import React from 'react';
5+
import { StyleSheet } from 'react-native';
46
import { componentMapper } from '@bluebase/component-mapper';
57

6-
export const BottomNavigationAction = componentMapper<BottomNavigationActionProps>(MuiBottomNavigationAction, {
7-
icon: ({ icon }) => {
8+
export const BottomNavigationAction = componentMapper<BottomNavigationActionProps>(
9+
MuiBottomNavigationAction,
10+
{
11+
icon: ({ icon }) => {
12+
if (!icon) {
13+
return;
14+
}
815

9-
if (!icon) {
10-
return;
11-
}
16+
const size = icon.size || 24;
1217

13-
const size = icon.size || 24;
18+
const props = {
19+
size,
20+
style: {
21+
// lineHeight: size,
22+
...icon.style,
23+
},
24+
...icon,
25+
};
1426

15-
const props = {
16-
size,
17-
style: {
18-
lineHeight: size,
19-
...icon.style,
20-
},
21-
...icon,
22-
};
27+
return React.createElement(DynamicIcon, props);
28+
},
2329

24-
return React.createElement(DynamicIcon, props);
25-
}
26-
}, {
27-
rest: true
28-
});
30+
style: ({ style }: any) => StyleSheet.flatten(style),
2931

32+
label: 'label',
33+
showLabel: 'showLabel',
34+
value: 'value',
35+
}
36+
);

0 commit comments

Comments
 (0)