@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.
@@ -242,9 +242,8 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
242
242
  animatedValue,
243
243
  useBorder = false,
244
244
  }) => {
245
- const {theme, config} = useContext(ApplicationContext);
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, config} = useContext(ApplicationContext);
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.props?.useMargin === false ? 0 : Spacing.M;
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
- );
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;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.81.35",
3
+ "version": "0.81.36-beta.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/verify.js CHANGED
@@ -27,6 +27,7 @@ try {
27
27
  }
28
28
 
29
29
  if (
30
+ miniInfo?.name !== '@momo-platform/momo-core' &&
30
31
  miniInfo?.resolutions?.['@momo-platform/momo-core'] !== packageInfo?.version
31
32
  ) {
32
33
  console.error(