@momo-kits/foundation 0.92.6-rc.25 → 0.92.6-rc.27

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.
@@ -10,21 +10,26 @@ import {Text} from '../../Text';
10
10
  import {ApplicationContext} from '../index';
11
11
  import StackScreen from '../StackScreen';
12
12
  import {BottomTabProps, NavigationScreenProps} from '../types';
13
- import {getStackOptions} from '../utils';
13
+ import {getOptions, getStackOptions} from '../utils';
14
14
  import BottomTabBar from './BottomTabBar';
15
15
 
16
16
  const Tab = createBottomTabNavigator();
17
17
  const Stack = createStackNavigator();
18
18
 
19
19
  const TabScreen: React.FC<NavigationScreenProps> = ({route}) => {
20
+ const {theme} = useContext(ApplicationContext);
21
+ let options = {};
22
+ if (route.params?.options) {
23
+ options = getOptions(route.params?.options, theme);
24
+ }
20
25
  if (route.params?.nested) {
21
26
  return (
22
27
  <Stack.Navigator>
23
28
  <Stack.Screen
24
29
  name="Stack"
25
30
  component={StackScreen}
26
- initialParams={{screen: route.params?.screen}}
27
- options={{...getStackOptions(), ...route.params?.options}}
31
+ initialParams={{screen: route.params?.screen, options}}
32
+ options={{...getStackOptions()}}
28
33
  />
29
34
  </Stack.Navigator>
30
35
  );
@@ -35,7 +40,7 @@ const TabScreen: React.FC<NavigationScreenProps> = ({route}) => {
35
40
  <Stack.Screen
36
41
  name="Stack"
37
42
  component={StackScreen}
38
- initialParams={{screen: route.params?.screen}}
43
+ initialParams={{screen: route.params?.screen, options}}
39
44
  options={{...getStackOptions(), ...route.params?.options}}
40
45
  />
41
46
  </Stack.Navigator>
@@ -158,20 +158,18 @@ const headerDefault = (title: string, onClose: () => void) => {
158
158
 
159
159
  const footerDefault = (footerComponent: React.ReactNode) => {
160
160
  const insets = useSafeAreaInsets();
161
- return (
162
- <View
163
- style={{
164
- marginBottom: Math.min(insets.bottom, 21),
165
- paddingHorizontal: 12,
166
- }}>
167
- {footerComponent && (
168
- <>
169
- {footerComponent}
170
- <View style={{height: Spacing.S}} />
171
- </>
172
- )}
173
- </View>
174
- );
161
+ if (footerComponent) {
162
+ return (
163
+ <View
164
+ style={{
165
+ marginBottom: Math.min(insets.bottom, 21),
166
+ paddingHorizontal: Spacing.M,
167
+ paddingVertical: Spacing.S,
168
+ }}>
169
+ {footerComponent}
170
+ </View>
171
+ );
172
+ }
175
173
  };
176
174
 
177
175
  const styles = StyleSheet.create({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.92.6-rc.25",
3
+ "version": "0.92.6-rc.27",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},