@momo-kits/foundation 0.169.10 → 0.169.11-beta.2
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.
|
@@ -8,6 +8,8 @@ import { isIPhoneDuo } from './utils';
|
|
|
8
8
|
|
|
9
9
|
// Top navigation spec, shared with the Compose / SwiftUI kits
|
|
10
10
|
const HEADER_FRAME_MAX_WIDTH = 600;
|
|
11
|
+
// stretch frame on hold until design confirms it: `stretch` lays out like `grid`
|
|
12
|
+
const IS_STRETCH_FRAME_ENABLED = false;
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Top navigation geometry on every device
|
|
@@ -35,7 +37,8 @@ const HeaderBarMetrics = {
|
|
|
35
37
|
|
|
36
38
|
/**
|
|
37
39
|
* `grid` keeps the header row at the bar edges, `stretch` centers it in a 600pt
|
|
38
|
-
* frame on wide windows
|
|
40
|
+
* frame on wide windows (on hold: same as `grid` for now). Background and status
|
|
41
|
+
* bar always span the window.
|
|
39
42
|
*/
|
|
40
43
|
type HeaderContentLayout = 'grid' | 'stretch';
|
|
41
44
|
|
|
@@ -81,7 +84,8 @@ const getHeaderLayout = ({
|
|
|
81
84
|
const isLargeWindow = Math.min(width, height) >= FOLDABLE_MIN_WIDTH;
|
|
82
85
|
const isWide = !isDuo && isLargeWindow;
|
|
83
86
|
let frameInset = sidePadding;
|
|
84
|
-
|
|
87
|
+
const isStretch = IS_STRETCH_FRAME_ENABLED && contentLayout === 'stretch';
|
|
88
|
+
if (isWide && isStretch) {
|
|
85
89
|
const centered = (width - HEADER_FRAME_MAX_WIDTH) / 2;
|
|
86
90
|
frameInset = Math.max(sidePadding, centered);
|
|
87
91
|
}
|
|
@@ -134,7 +138,7 @@ const useHeaderFrameOptions = (
|
|
|
134
138
|
const { width } = useWindowDimensions();
|
|
135
139
|
const isDuo = isIPhoneDuo();
|
|
136
140
|
return useMemo(() => {
|
|
137
|
-
if (contentLayout !== 'stretch' || isDuo) {
|
|
141
|
+
if (!IS_STRETCH_FRAME_ENABLED || contentLayout !== 'stretch' || isDuo) {
|
|
138
142
|
return undefined;
|
|
139
143
|
}
|
|
140
144
|
// the header content row already sits this far in on large iOS windows
|