@sudobility/building_blocks_rn 0.0.44 → 0.0.45

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.
@@ -12,14 +12,17 @@ import { View, StyleSheet } from 'react-native';
12
12
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
13
13
  import { BottomTabBarHeightContext } from '@react-navigation/bottom-tabs';
14
14
  import { createThemedStyles } from '../../utils/styles';
15
+ const SPACING = 16;
15
16
  export function BottomActionBar({ children, style }) {
16
17
  const styles = useStyles();
17
18
  const insets = useSafeAreaInsets();
18
19
  const tabBarHeight = useContext(BottomTabBarHeightContext);
19
- // Under a tab bar, the tab bar already covers the home indicator, so the
20
- // bar sits directly above it with a small constant. Otherwise (pushed/modal
21
- // screens that cover the tab bar) honor the bottom safe-area inset.
22
- const paddingBottom = tabBarHeight != null ? 12 : Math.max(insets.bottom, 12);
20
+ // Above a tab/tool bar: it already covers the home indicator, so just add
21
+ // spacing above it. Otherwise: sit above the bottom safe-area inset with
22
+ // spacing. (Inside a modal, reset BottomTabBarHeightContext so this takes
23
+ // the no-tab-bar branch the tab bar isn't actually below the modal.)
24
+ const hasTabBar = (tabBarHeight ?? 0) > 0;
25
+ const paddingBottom = hasTabBar ? SPACING : insets.bottom + SPACING;
23
26
  return _jsx(View, { style: [styles.bar, { paddingBottom }, style], children: children });
24
27
  }
25
28
  const useStyles = createThemedStyles(colors => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/building_blocks_rn",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "description": "Higher-level shared UI building blocks for Sudobility React Native apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",