@momo-kits/foundation 0.75.1-beta.11 → 0.75.1-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Layout/Card.tsx +10 -10
- package/Layout/Item.tsx +13 -13
- package/Layout/ScreenContainer.tsx +2 -1
- package/Navigation/BottomTab.tsx +4 -3
- package/Navigation/types.ts +6 -0
- package/package.json +1 -1
package/Layout/Card.tsx
CHANGED
|
@@ -115,20 +115,20 @@ const Card: React.FC<CardProps> = ({children, style}) => {
|
|
|
115
115
|
return element;
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
const styles: any = style ?? {};
|
|
119
|
-
|
|
120
118
|
return (
|
|
121
119
|
<GridContext.Provider value={gridContext}>
|
|
122
120
|
<View
|
|
123
121
|
accessibilityLabel={`Card`}
|
|
124
|
-
style={
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
style={[
|
|
123
|
+
style,
|
|
124
|
+
{
|
|
125
|
+
width: widthSection,
|
|
126
|
+
marginHorizontal: gridContext.margin,
|
|
127
|
+
padding: 12,
|
|
128
|
+
flexDirection: 'row',
|
|
129
|
+
flexWrap: 'wrap',
|
|
130
|
+
},
|
|
131
|
+
]}>
|
|
132
132
|
{renderView(validateChildren(children, [Item]))}
|
|
133
133
|
{GRIDVIEW && renderOverlay()}
|
|
134
134
|
</View>
|
package/Layout/Item.tsx
CHANGED
|
@@ -33,22 +33,22 @@ const Item: React.FC<ItemProps> = ({
|
|
|
33
33
|
);
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
const styles: any = style ?? {};
|
|
37
|
-
|
|
38
36
|
return (
|
|
39
37
|
<View
|
|
40
38
|
accessibilityLabel={`Item`}
|
|
41
|
-
style={
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
style={[
|
|
40
|
+
style,
|
|
41
|
+
{
|
|
42
|
+
width: grid.getSizeSpan(widthSpan),
|
|
43
|
+
height: heightSpan ? grid.getSizeSpan(heightSpan) : undefined,
|
|
44
|
+
overflow: 'hidden',
|
|
45
|
+
margin: undefined,
|
|
46
|
+
marginTop: undefined,
|
|
47
|
+
marginBottom: undefined,
|
|
48
|
+
marginLeft: undefined,
|
|
49
|
+
marginRight: undefined,
|
|
50
|
+
},
|
|
51
|
+
]}>
|
|
52
52
|
{children}
|
|
53
53
|
{GRIDVIEW && renderOverlay()}
|
|
54
54
|
</View>
|
|
@@ -57,11 +57,12 @@ const ScreenContainer: React.FC<ScreenContainerProps> = ({
|
|
|
57
57
|
const results = validateChildren(children, [Section, Card]);
|
|
58
58
|
if (Array.isArray(results)) {
|
|
59
59
|
return results.map((item, index) => {
|
|
60
|
+
const space = item.props.useMargin === false ? 0 : Spacing.M;
|
|
60
61
|
return (
|
|
61
62
|
<View
|
|
62
63
|
key={`ScreenItem${index}`}
|
|
63
64
|
style={{
|
|
64
|
-
marginTop:
|
|
65
|
+
marginTop: space,
|
|
65
66
|
flex: item.props?.expanded ? 1 : undefined,
|
|
66
67
|
}}>
|
|
67
68
|
{item}
|
package/Navigation/BottomTab.tsx
CHANGED
|
@@ -5,15 +5,16 @@ import {Icon} from '../Icon';
|
|
|
5
5
|
|
|
6
6
|
const Tab = createBottomTabNavigator();
|
|
7
7
|
|
|
8
|
-
const BottomTab: FC<BottomTabProps> = ({tabs}) => {
|
|
8
|
+
const BottomTab: FC<BottomTabProps> = ({tabs, listeners}) => {
|
|
9
9
|
return (
|
|
10
10
|
<Tab.Navigator>
|
|
11
11
|
{tabs.map((item, index) => {
|
|
12
12
|
return (
|
|
13
13
|
<Tab.Screen
|
|
14
|
-
key={
|
|
15
|
-
name={item.
|
|
14
|
+
key={item.name}
|
|
15
|
+
name={item.name}
|
|
16
16
|
component={item.screen}
|
|
17
|
+
listeners={listeners}
|
|
17
18
|
options={{
|
|
18
19
|
tabBarLabel: item.label,
|
|
19
20
|
tabBarBadge: item?.badgeLabel,
|
package/Navigation/types.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {Animated, ScrollViewProps, ViewProps} from 'react-native';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Navigator from './Navigator';
|
|
4
4
|
import {PopupNotifyProps} from '../Popup/types';
|
|
5
|
+
import {ScreenListeners} from '@react-navigation/core/lib/typescript/src/types';
|
|
5
6
|
|
|
6
7
|
export type Theme = {
|
|
7
8
|
dark: boolean;
|
|
@@ -146,6 +147,7 @@ export type HeaderToolkitProps = {
|
|
|
146
147
|
};
|
|
147
148
|
|
|
148
149
|
export type BottomTabItemProps = {
|
|
150
|
+
name: string;
|
|
149
151
|
label: string;
|
|
150
152
|
icon: string;
|
|
151
153
|
showDot?: boolean;
|
|
@@ -155,4 +157,8 @@ export type BottomTabItemProps = {
|
|
|
155
157
|
|
|
156
158
|
export type BottomTabProps = {
|
|
157
159
|
tabs: BottomTabItemProps[];
|
|
160
|
+
listeners: {
|
|
161
|
+
tabPress?: any;
|
|
162
|
+
focus?: any;
|
|
163
|
+
};
|
|
158
164
|
};
|