@momo-kits/foundation 0.81.35 → 0.81.36-beta.2
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 +2 -3
- package/Application/NavigationContainer.tsx +9 -2
- package/Layout/Card.tsx +2 -0
- package/Layout/Screen.tsx +16 -15
- package/Layout/Section.tsx +2 -0
- package/package.json +1 -1
- package/verify.js +1 -0
|
@@ -242,9 +242,8 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
|
|
|
242
242
|
animatedValue,
|
|
243
243
|
useBorder = false,
|
|
244
244
|
}) => {
|
|
245
|
-
const {theme
|
|
246
|
-
let headerImage =
|
|
247
|
-
config?.navigationBar?.headerBar ?? theme.assets?.headerBackground;
|
|
245
|
+
const {theme} = useContext(ApplicationContext);
|
|
246
|
+
let headerImage = theme.assets?.headerBackground;
|
|
248
247
|
if (image === null) {
|
|
249
248
|
headerImage = undefined;
|
|
250
249
|
}
|
|
@@ -29,7 +29,11 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
29
29
|
const navigator = useRef(new Navigator(navigationRef));
|
|
30
30
|
const [showGrid, setShowGrid] = useState(false);
|
|
31
31
|
const [language, setLanguage] = useState<'vi' | 'en'>('vi');
|
|
32
|
-
const [config, setConfig] = useState(undefined);
|
|
32
|
+
const [config, setConfig] = useState<any>(undefined);
|
|
33
|
+
let assets = theme.assets;
|
|
34
|
+
if (config) {
|
|
35
|
+
assets = {...assets, headerBackground: config.navigationBar?.headerBar};
|
|
36
|
+
}
|
|
33
37
|
|
|
34
38
|
/**
|
|
35
39
|
* handle mini language & listen change
|
|
@@ -83,7 +87,10 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
83
87
|
<BottomSheetModalProvider>
|
|
84
88
|
<ApplicationContext.Provider
|
|
85
89
|
value={{
|
|
86
|
-
theme
|
|
90
|
+
theme: {
|
|
91
|
+
...theme,
|
|
92
|
+
assets: assets,
|
|
93
|
+
},
|
|
87
94
|
navigator: navigator.current,
|
|
88
95
|
showGrid,
|
|
89
96
|
language,
|
package/Layout/Card.tsx
CHANGED
|
@@ -27,6 +27,7 @@ const Card: React.FC<CardProps> = ({
|
|
|
27
27
|
style,
|
|
28
28
|
backgroundImage,
|
|
29
29
|
useShadow = false,
|
|
30
|
+
...props
|
|
30
31
|
}) => {
|
|
31
32
|
const {showGrid} = useContext(ApplicationContext);
|
|
32
33
|
const {numberOfColumns} = useGridSystem();
|
|
@@ -141,6 +142,7 @@ const Card: React.FC<CardProps> = ({
|
|
|
141
142
|
return (
|
|
142
143
|
<GridContext.Provider value={gridContext}>
|
|
143
144
|
<View
|
|
145
|
+
{...props}
|
|
144
146
|
accessibilityLabel={`Card`}
|
|
145
147
|
style={[
|
|
146
148
|
style,
|
package/Layout/Screen.tsx
CHANGED
|
@@ -101,7 +101,7 @@ const Screen = forwardRef(
|
|
|
101
101
|
ref,
|
|
102
102
|
) => {
|
|
103
103
|
const animatedValue = useRef<Animated.Value | undefined>(undefined);
|
|
104
|
-
const {theme
|
|
104
|
+
const {theme} = useContext(ApplicationContext);
|
|
105
105
|
const insets = useSafeAreaInsets();
|
|
106
106
|
const heightHeader = useHeaderHeight();
|
|
107
107
|
const currentTint = useRef(Colors.black_01);
|
|
@@ -117,8 +117,7 @@ const Screen = forwardRef(
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
if (headerType == 'extended') {
|
|
120
|
-
headerBackground =
|
|
121
|
-
config?.navigationBar?.headerBar ?? theme.assets?.headerBackground;
|
|
120
|
+
headerBackground = theme.assets?.headerBackground;
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
useEffect(() => {
|
|
@@ -261,20 +260,22 @@ const Screen = forwardRef(
|
|
|
261
260
|
* build content for screen
|
|
262
261
|
*/
|
|
263
262
|
const renderContent = () => {
|
|
264
|
-
const results = validateChildren(children, [Section, Card]);
|
|
263
|
+
const results = validateChildren(children, [Section, Card, undefined]);
|
|
265
264
|
if (Array.isArray(results)) {
|
|
266
265
|
return results.map((item, index) => {
|
|
267
|
-
const space = item
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
266
|
+
const space = item?.props?.useMargin === false ? 0 : Spacing.M;
|
|
267
|
+
if (item) {
|
|
268
|
+
return (
|
|
269
|
+
<View
|
|
270
|
+
key={`ScreenItem${index}`}
|
|
271
|
+
style={{
|
|
272
|
+
marginTop: space,
|
|
273
|
+
flex: item.props?.expanded ? 1 : undefined,
|
|
274
|
+
}}>
|
|
275
|
+
{item}
|
|
276
|
+
</View>
|
|
277
|
+
);
|
|
278
|
+
}
|
|
278
279
|
});
|
|
279
280
|
} else {
|
|
280
281
|
const item: any = children;
|
package/Layout/Section.tsx
CHANGED
|
@@ -33,6 +33,7 @@ const Section: React.FC<SectionProps> = ({
|
|
|
33
33
|
useMargin = true,
|
|
34
34
|
backgroundImage,
|
|
35
35
|
style,
|
|
36
|
+
...props
|
|
36
37
|
}) => {
|
|
37
38
|
const {showGrid} = useContext(ApplicationContext);
|
|
38
39
|
const {numberOfColumns} = useGridSystem();
|
|
@@ -148,6 +149,7 @@ const Section: React.FC<SectionProps> = ({
|
|
|
148
149
|
},
|
|
149
150
|
}}>
|
|
150
151
|
<View
|
|
152
|
+
{...props}
|
|
151
153
|
accessibilityLabel={`Section`}
|
|
152
154
|
style={[
|
|
153
155
|
style,
|
package/package.json
CHANGED