@artsy/palette-mobile 22.1.0--canary.425.5080.0 → 22.1.0--canary.425.5083.0
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.
|
@@ -11,13 +11,13 @@ import { Touchable } from "../Touchable";
|
|
|
11
11
|
export const AnimatedHeader = (props) => {
|
|
12
12
|
return _jsx(Header, { animated: true, ...props });
|
|
13
13
|
};
|
|
14
|
-
export const Header = ({ animated = false, hideLeftElements, hideRightElements, hideTitle, leftElements, onBack, rightElements, title, titleProps = {}, }) => {
|
|
14
|
+
export const Header = ({ animated = false, hideLeftElements, hideRightElements, hideTitle, leftElements, onBack, rightElements, title, titleProps = {}, zIndex = ZINDEX.header, }) => {
|
|
15
15
|
const { width } = useScreenDimensions();
|
|
16
16
|
const space = useSpace();
|
|
17
17
|
// Assumes small left and right elements, it protects from overflowing
|
|
18
18
|
// but doesn't cover edge cases where right or left are bigger
|
|
19
19
|
const centerMaxWidth = width - space(4) - DEFAULT_ICON_SIZE * 2;
|
|
20
|
-
return (_jsxs(Flex, { height: NAVBAR_HEIGHT, flexDirection: "row", px: 2, zIndex:
|
|
20
|
+
return (_jsxs(Flex, { height: NAVBAR_HEIGHT, flexDirection: "row", px: 2, zIndex: zIndex, backgroundColor: "background", alignItems: "center", children: [_jsx(Flex, { flex: 1, children: _jsx(Left, { leftElements: leftElements, onBack: onBack, hideLeftElements: hideLeftElements }) }), _jsx(Flex, { maxWidth: centerMaxWidth, ...titleProps, children: _jsx(Center, { animated: animated, title: title, hideTitle: hideTitle }) }), _jsx(Flex, { flex: 1, alignItems: "flex-end", children: _jsx(Right, { rightElements: rightElements, hideRightElements: hideRightElements }) })] }));
|
|
21
21
|
};
|
|
22
22
|
const Right = ({ hideRightElements, rightElements }) => {
|
|
23
23
|
return _jsx(_Fragment, { children: !hideRightElements && rightElements });
|