@momo-kits/foundation 0.81.34 → 0.81.36-beta.1

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.
@@ -1,5 +1,5 @@
1
1
  import React, {useContext, useEffect} from 'react';
2
- import {Platform, StyleSheet, View} from 'react-native';
2
+ import {Platform} from 'react-native';
3
3
  import {BottomTabProps, NavigationScreenProps} from './types';
4
4
  import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
5
5
  import {createStackNavigator} from '@react-navigation/stack';
@@ -8,7 +8,6 @@ import {Text} from '../Text';
8
8
  import {ApplicationContext} from './index';
9
9
  import {getStackOptions} from './utils';
10
10
  import StackScreen from './StackScreen';
11
- import {Spacing} from '../Consts';
12
11
  import {useSafeAreaInsets} from 'react-native-safe-area-context';
13
12
 
14
13
  const Tab = createBottomTabNavigator();
@@ -49,7 +48,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
49
48
  backBehavior={'firstRoute'}
50
49
  tabBarOptions={{
51
50
  style: {
52
- height: 68 + insets.bottom,
51
+ height: 68 + Math.min(insets.bottom, 21),
53
52
  },
54
53
  tabStyle: {
55
54
  height: 68,
@@ -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(() => {
@@ -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.34",
3
+ "version": "0.81.36-beta.1",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/verify.js CHANGED
@@ -7,7 +7,9 @@ try {
7
7
  const packageVersion = parseInt(packageInfo?.version.split('.')?.[1]);
8
8
 
9
9
  const app = path.join(`${__dirname}/../../../`, 'app.json');
10
+ const miniJson = path.join(`${__dirname}/../../../`, 'package.json');
10
11
  const appInfo = JSON.parse(fs.readFileSync(app, 'utf8'));
12
+ const miniInfo = JSON.parse(fs.readFileSync(miniJson, 'utf8'));
11
13
  const iOSAppTarget = appInfo?.client?.ios.deploymentTarget;
12
14
  const androidAppTarget = appInfo?.client?.android.deploymentTarget;
13
15
 
@@ -23,6 +25,18 @@ try {
23
25
  `Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`,
24
26
  );
25
27
  }
28
+
29
+ if (
30
+ miniInfo?.name !== '@momo-platform/momo-core' &&
31
+ miniInfo?.resolutions?.['@momo-platform/momo-core'] !== packageInfo?.version
32
+ ) {
33
+ console.error(
34
+ `Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
35
+ );
36
+ throw new Error(
37
+ `Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
38
+ );
39
+ }
26
40
  } catch (error) {
27
41
  console.error(`Installation failed: ${error.message}`);
28
42
  process.exit(1);