@artsy/palette-mobile 11.0.28 → 11.0.29

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v11.0.29 (Sat May 13 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - fix(screen): fix safe area [#103](https://github.com/artsy/palette-mobile/pull/103) ([@damassi](https://github.com/damassi))
6
+
7
+ #### Authors: 1
8
+
9
+ - Christopher Pappas ([@damassi](https://github.com/damassi))
10
+
11
+ ---
12
+
1
13
  # v11.0.28 (Sat May 13 2023)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -14,7 +14,7 @@ const Header = ({ hideLeftElements, hideRightElements, leftElements, rightElemen
14
14
  if (hideLeftElements) {
15
15
  return null;
16
16
  }
17
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [leftElements ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: leftElements })) : (
17
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { pr: 1, children: [leftElements ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: leftElements })) : (
18
18
  // If no left elements passed, show back button
19
19
  (0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { onPress: onBack, underlayColor: "transparent", hitSlop: constants_2.DEFAULT_HIT_SLOP, children: (0, jsx_runtime_1.jsx)(ArrowLeftIcon_1.ArrowLeftIcon, { fill: "onBackgroundHigh", top: "2px" }) })), (0, jsx_runtime_1.jsx)(Spacer_1.Spacer, { x: 1 })] }));
20
20
  };
@@ -22,13 +22,13 @@ const Header = ({ hideLeftElements, hideRightElements, leftElements, rightElemen
22
22
  if (hideTitle) {
23
23
  return null;
24
24
  }
25
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, ...titleProps, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "md", numberOfLines: 1, children: title }) }));
25
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, ...titleProps, justifySelf: "stretch", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "md", numberOfLines: 1, children: title }) }));
26
26
  };
27
27
  const Right = () => {
28
28
  if (hideRightElements) {
29
29
  return null;
30
30
  }
31
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Spacer_1.Spacer, { x: 1 }), rightElements] }));
31
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { pl: 1, children: [(0, jsx_runtime_1.jsx)(Spacer_1.Spacer, { x: 1 }), rightElements] }));
32
32
  };
33
33
  return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { height: constants_1.NAVBAR_HEIGHT, flexDirection: "row", px: 2, py: 1, zIndex: constants_1.ZINDEX.header, backgroundColor: "background", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Left, {}), (0, jsx_runtime_1.jsx)(Center, {}), (0, jsx_runtime_1.jsx)(Right, {})] }));
34
34
  };
@@ -6,11 +6,10 @@ const react_native_safe_area_context_1 = require("react-native-safe-area-context
6
6
  const Flex_1 = require("../Flex");
7
7
  const ScreenBase = ({ children, safeArea = true }) => {
8
8
  const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
9
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, backgroundColor: "background", mt: safeArea ? insets.top : 0, children: children }));
9
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flex: 1, backgroundColor: "background", mt: safeArea ? insets.top : 0, children: [children, (0, jsx_runtime_1.jsx)(SafeAreaCover, { safeArea: true })] }));
10
10
  };
11
11
  exports.ScreenBase = ScreenBase;
12
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
- const SafeAreaCover = () => {
12
+ const SafeAreaCover = ({ safeArea }) => {
14
13
  const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
15
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { position: "absolute", left: 0, right: 0, top: 0, height: insets.top, backgroundColor: "background" }));
14
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { position: "absolute", left: 0, right: 0, top: safeArea ? -insets.top : 0, height: insets.top, backgroundColor: "background" }));
16
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "11.0.28",
3
+ "version": "11.0.29",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "scripts": {
6
6
  "android": "react-native run-android",