@momo-kits/foundation 0.77.5 → 0.77.7
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/Application/Components.tsx +4 -4
- package/Application/StackScreen.tsx +1 -1
- package/Application/types.ts +2 -0
- package/Application/utils.tsx +7 -0
- package/Layout/Card.tsx +1 -1
- package/Layout/Screen.tsx +18 -11
- package/Layout/Section.tsx +8 -0
- package/Layout/styles.ts +1 -1
- package/Layout/types.ts +2 -0
- package/package.json +1 -1
|
@@ -225,23 +225,22 @@ const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
|
|
|
225
225
|
);
|
|
226
226
|
return <View />;
|
|
227
227
|
}
|
|
228
|
+
return item;
|
|
228
229
|
};
|
|
229
230
|
const renderAction = () => {
|
|
230
231
|
if (Array.isArray(children)) {
|
|
231
232
|
return children.map((child, index) => {
|
|
232
|
-
validType(child);
|
|
233
233
|
return (
|
|
234
234
|
<View key={index} style={styles.headerButton}>
|
|
235
|
-
{React.cloneElement(child, {...restProps})}
|
|
235
|
+
{React.cloneElement(validType(child), {...restProps})}
|
|
236
236
|
</View>
|
|
237
237
|
);
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
validType(children);
|
|
242
241
|
return (
|
|
243
242
|
<View style={styles.headerButton}>
|
|
244
|
-
{React.cloneElement(children, {...restProps})}
|
|
243
|
+
{React.cloneElement(validType(children), {...restProps})}
|
|
245
244
|
</View>
|
|
246
245
|
);
|
|
247
246
|
};
|
|
@@ -328,6 +327,7 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
|
|
|
328
327
|
/>
|
|
329
328
|
);
|
|
330
329
|
}
|
|
330
|
+
return null;
|
|
331
331
|
};
|
|
332
332
|
|
|
333
333
|
if (toolConfig) {
|
|
@@ -6,7 +6,7 @@ import {GridSystem} from '../Layout';
|
|
|
6
6
|
|
|
7
7
|
const StackScreen: React.FC<ScreenParams> = props => {
|
|
8
8
|
const {screen: Component, options}: ScreenParams = props.route.params;
|
|
9
|
-
const {theme, showGrid
|
|
9
|
+
const {theme, showGrid} = useContext(ApplicationContext);
|
|
10
10
|
const navigation = new Navigation(props.navigation, theme);
|
|
11
11
|
|
|
12
12
|
const params = {
|
package/Application/types.ts
CHANGED
|
@@ -90,6 +90,7 @@ export interface ScreenProps extends ViewProps {
|
|
|
90
90
|
scrollViewProps?: ScrollViewProps;
|
|
91
91
|
footerComponent?: ReactNode;
|
|
92
92
|
marginHeader?: number;
|
|
93
|
+
backgroundColor?: string;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
export type ScreenParams = {
|
|
@@ -122,6 +123,7 @@ export type NavigationOptions = {
|
|
|
122
123
|
preventBack?: PopupNotifyProps;
|
|
123
124
|
surface?: boolean;
|
|
124
125
|
headerTransparent?: boolean;
|
|
126
|
+
hiddenBack?: boolean;
|
|
125
127
|
title?: string;
|
|
126
128
|
headerTitle?: (props?: any) => React.ReactElement;
|
|
127
129
|
headerTitleAlign?: 'left' | 'center';
|
package/Application/utils.tsx
CHANGED
package/Layout/Card.tsx
CHANGED
|
@@ -132,7 +132,7 @@ const Card: React.FC<CardProps> = ({children, style, backgroundImage}) => {
|
|
|
132
132
|
{!!backgroundImage && (
|
|
133
133
|
<Image
|
|
134
134
|
source={{uri: backgroundImage}}
|
|
135
|
-
style={[style, styles.
|
|
135
|
+
style={[style, styles.imageBackground]}
|
|
136
136
|
/>
|
|
137
137
|
)}
|
|
138
138
|
{renderView(validateChildren(children, [Item]))}
|
package/Layout/Screen.tsx
CHANGED
|
@@ -15,11 +15,12 @@ const Screen: React.FC<ScreenProps> = ({
|
|
|
15
15
|
scrollable = false,
|
|
16
16
|
navigation,
|
|
17
17
|
marginHeader,
|
|
18
|
-
useAnimatedHeader
|
|
19
|
-
useExtendedHeader
|
|
18
|
+
useAnimatedHeader,
|
|
19
|
+
useExtendedHeader,
|
|
20
20
|
headerBackground,
|
|
21
21
|
scrollViewProps,
|
|
22
22
|
footerComponent: Footer,
|
|
23
|
+
backgroundColor,
|
|
23
24
|
}) => {
|
|
24
25
|
const animatedValue = useRef<Animated.Value | undefined>(undefined);
|
|
25
26
|
const {theme} = useContext(ApplicationContext);
|
|
@@ -44,15 +45,19 @@ const Screen: React.FC<ScreenProps> = ({
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
useEffect(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
if (useAnimatedHeader != undefined || useExtendedHeader != undefined) {
|
|
49
|
+
let title = {};
|
|
50
|
+
if (useExtendedHeader) {
|
|
51
|
+
title = {headerTitle: HeaderTitle};
|
|
52
|
+
}
|
|
53
|
+
setImmediate(() => {
|
|
54
|
+
navigation?.setOptions({
|
|
55
|
+
animatedValue: animatedValue.current,
|
|
56
|
+
headerTransparent: headerTransparent,
|
|
57
|
+
...title,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
50
60
|
}
|
|
51
|
-
navigation?.setOptions({
|
|
52
|
-
animatedValue: animatedValue.current,
|
|
53
|
-
headerTransparent,
|
|
54
|
-
...title,
|
|
55
|
-
});
|
|
56
61
|
}, [useExtendedHeader, useAnimatedHeader]);
|
|
57
62
|
|
|
58
63
|
/**
|
|
@@ -130,7 +135,9 @@ const Screen: React.FC<ScreenProps> = ({
|
|
|
130
135
|
};
|
|
131
136
|
|
|
132
137
|
return (
|
|
133
|
-
<View
|
|
138
|
+
<View
|
|
139
|
+
style={[Styles.flex, {backgroundColor}]}
|
|
140
|
+
accessibilityLabel={`ScreenContainer`}>
|
|
134
141
|
<View
|
|
135
142
|
style={{
|
|
136
143
|
position: 'absolute',
|
package/Layout/Section.tsx
CHANGED
|
@@ -6,11 +6,13 @@ import {GridContext} from './index';
|
|
|
6
6
|
import Item from './Item';
|
|
7
7
|
import {ApplicationContext} from '../Application';
|
|
8
8
|
import styles from './styles';
|
|
9
|
+
import {Image} from '../Image';
|
|
9
10
|
|
|
10
11
|
const Section: React.FC<SectionProps> = ({
|
|
11
12
|
children,
|
|
12
13
|
useMargin = true,
|
|
13
14
|
backgroundColor,
|
|
15
|
+
backgroundImage,
|
|
14
16
|
}) => {
|
|
15
17
|
const {showGrid} = useContext(ApplicationContext);
|
|
16
18
|
const {numberOfColumns} = useGridSystem();
|
|
@@ -124,6 +126,12 @@ const Section: React.FC<SectionProps> = ({
|
|
|
124
126
|
flexWrap: 'wrap',
|
|
125
127
|
backgroundColor: backgroundColor,
|
|
126
128
|
}}>
|
|
129
|
+
{!!backgroundImage && (
|
|
130
|
+
<Image
|
|
131
|
+
source={{uri: backgroundImage}}
|
|
132
|
+
style={styles.imageBackground}
|
|
133
|
+
/>
|
|
134
|
+
)}
|
|
127
135
|
{renderView(validateChildren(children, [Item]))}
|
|
128
136
|
{showGrid && renderOverlay()}
|
|
129
137
|
</View>
|
package/Layout/styles.ts
CHANGED
package/Layout/types.ts
CHANGED