react-native-edge-to-edge 1.5.1 → 1.6.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.
- package/README.md +12 -0
- package/dist/commonjs/SystemBars.js +120 -44
- package/dist/commonjs/SystemBars.js.map +1 -1
- package/dist/module/SystemBars.js +120 -44
- package/dist/module/SystemBars.js.map +1 -1
- package/dist/typescript/SystemBars.d.ts +3 -1
- package/dist/typescript/SystemBars.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/SystemBars.ts +135 -80
package/README.md
CHANGED
|
@@ -191,6 +191,18 @@ const entry: SystemBarsEntry = SystemBars.replaceStackEntry(
|
|
|
191
191
|
);
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
+
#### SystemBars.setStyle
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
SystemBars.setStyle(style /*: SystemBarsProps["style"] */);
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
#### SystemBars.setHidden
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
SystemBars.setHidden(style /*: SystemBarsProps["hidden"] */);
|
|
204
|
+
```
|
|
205
|
+
|
|
194
206
|
## Third-party libraries 🧩
|
|
195
207
|
|
|
196
208
|
If you're an author and your package interferes with edge-to-edge, refer to the [`react-native-is-edge-to-edge` `README.md`](./react-native-is-edge-to-edge) for compatibility instructions.
|
|
@@ -8,8 +8,19 @@ var _react = require("react");
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _NativeEdgeToEdgeModule = _interopRequireDefault(require("./specs/NativeEdgeToEdgeModule"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
function
|
|
12
|
-
|
|
11
|
+
function isLightColorScheme() {
|
|
12
|
+
const colorScheme = _reactNative.Appearance?.getColorScheme() ?? "light";
|
|
13
|
+
return colorScheme === "light";
|
|
14
|
+
}
|
|
15
|
+
function resolveSystemBarStyle(style) {
|
|
16
|
+
switch (style) {
|
|
17
|
+
case "auto":
|
|
18
|
+
return isLightColorScheme() ? "dark" : "light";
|
|
19
|
+
case "inverted":
|
|
20
|
+
return isLightColorScheme() ? "light" : "dark";
|
|
21
|
+
default:
|
|
22
|
+
return style;
|
|
23
|
+
}
|
|
13
24
|
}
|
|
14
25
|
function toNativeBarStyle(style) {
|
|
15
26
|
return style === "light" || style === "dark" ? `${style}-content` : "default";
|
|
@@ -34,17 +45,25 @@ function mergeEntriesStack(entriesStack) {
|
|
|
34
45
|
navigationBarHidden: false
|
|
35
46
|
});
|
|
36
47
|
}
|
|
48
|
+
function resolveProps({
|
|
49
|
+
hidden,
|
|
50
|
+
style
|
|
51
|
+
}) {
|
|
52
|
+
const compactStyle = typeof style === "string";
|
|
53
|
+
const compactHidden = typeof hidden === "boolean";
|
|
54
|
+
return {
|
|
55
|
+
statusBarStyle: compactStyle ? style : style?.statusBar,
|
|
56
|
+
navigationBarStyle: compactStyle ? style : style?.navigationBar,
|
|
57
|
+
statusBarHidden: compactHidden ? hidden : hidden?.statusBar,
|
|
58
|
+
navigationBarHidden: compactHidden ? hidden : hidden?.navigationBar
|
|
59
|
+
};
|
|
60
|
+
}
|
|
37
61
|
|
|
38
62
|
/**
|
|
39
63
|
* Returns an object to insert in the props stack from the props.
|
|
40
64
|
*/
|
|
41
65
|
function createStackEntry(props) {
|
|
42
|
-
return
|
|
43
|
-
statusBarStyle: typeof props.style === "string" ? props.style : props.style?.statusBar,
|
|
44
|
-
navigationBarStyle: typeof props.style === "string" ? props.style : props.style?.navigationBar,
|
|
45
|
-
statusBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.statusBar,
|
|
46
|
-
navigationBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.navigationBar
|
|
47
|
-
};
|
|
66
|
+
return resolveProps(props);
|
|
48
67
|
}
|
|
49
68
|
const entriesStack = [];
|
|
50
69
|
|
|
@@ -52,12 +71,50 @@ const entriesStack = [];
|
|
|
52
71
|
let updateImmediate = null;
|
|
53
72
|
|
|
54
73
|
// The current merged values from the entries stack.
|
|
55
|
-
|
|
74
|
+
const currentValues = {
|
|
56
75
|
statusBarStyle: undefined,
|
|
57
76
|
navigationBarStyle: undefined,
|
|
58
77
|
statusBarHidden: false,
|
|
59
78
|
navigationBarHidden: false
|
|
60
79
|
};
|
|
80
|
+
function setStatusBarStyle(style) {
|
|
81
|
+
if (style !== currentValues.statusBarStyle) {
|
|
82
|
+
currentValues.statusBarStyle = style;
|
|
83
|
+
const nativeStyle = toNativeBarStyle(style);
|
|
84
|
+
if (_reactNative.Platform.OS === "android") {
|
|
85
|
+
_NativeEdgeToEdgeModule.default?.setStatusBarStyle(nativeStyle);
|
|
86
|
+
} else if (_reactNative.Platform.OS === "ios") {
|
|
87
|
+
_reactNative.StatusBar.setBarStyle(nativeStyle, true);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function setNavigationBarStyle(style) {
|
|
92
|
+
if (style !== currentValues.navigationBarStyle) {
|
|
93
|
+
currentValues.navigationBarStyle = style;
|
|
94
|
+
if (_reactNative.Platform.OS === "android") {
|
|
95
|
+
const nativeStyle = toNativeBarStyle(style);
|
|
96
|
+
_NativeEdgeToEdgeModule.default?.setNavigationBarStyle(nativeStyle);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function setStatusBarHidden(hidden) {
|
|
101
|
+
if (hidden !== currentValues.statusBarHidden) {
|
|
102
|
+
currentValues.statusBarHidden = hidden;
|
|
103
|
+
if (_reactNative.Platform.OS === "android") {
|
|
104
|
+
_NativeEdgeToEdgeModule.default?.setStatusBarHidden(hidden);
|
|
105
|
+
} else if (_reactNative.Platform.OS === "ios") {
|
|
106
|
+
_reactNative.StatusBar.setHidden(hidden, "fade"); // 'slide' doesn't work in this context
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function setNavigationBarHidden(hidden) {
|
|
111
|
+
if (hidden !== currentValues.navigationBarHidden) {
|
|
112
|
+
currentValues.navigationBarHidden = hidden;
|
|
113
|
+
if (_reactNative.Platform.OS === "android") {
|
|
114
|
+
_NativeEdgeToEdgeModule.default?.setNavigationBarHidden(hidden);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
61
118
|
|
|
62
119
|
/**
|
|
63
120
|
* Updates the native system bars with the entries from the stack.
|
|
@@ -68,38 +125,17 @@ function updateEntriesStack() {
|
|
|
68
125
|
clearImmediate(updateImmediate);
|
|
69
126
|
}
|
|
70
127
|
updateImmediate = setImmediate(() => {
|
|
71
|
-
const isLightColorScheme = getColorScheme() === "light";
|
|
72
|
-
const autoBarStyle = isLightColorScheme ? "dark" : "light";
|
|
73
|
-
const invertedBarStyle = isLightColorScheme ? "light" : "dark";
|
|
74
128
|
const mergedEntries = mergeEntriesStack(entriesStack);
|
|
75
|
-
const statusBarStyle = mergedEntries.statusBarStyle === "auto" ? autoBarStyle : mergedEntries.statusBarStyle === "inverted" ? invertedBarStyle : mergedEntries.statusBarStyle;
|
|
76
|
-
const navigationBarStyle = mergedEntries.navigationBarStyle === "auto" ? autoBarStyle : mergedEntries.navigationBarStyle === "inverted" ? invertedBarStyle : mergedEntries.navigationBarStyle;
|
|
77
129
|
const {
|
|
78
130
|
statusBarHidden,
|
|
79
131
|
navigationBarHidden
|
|
80
132
|
} = mergedEntries;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
if (_reactNative.Platform.OS === "android") {
|
|
89
|
-
if (navigationBarStyle !== currentMergedEntries.navigationBarStyle) {
|
|
90
|
-
const style = toNativeBarStyle(navigationBarStyle);
|
|
91
|
-
_NativeEdgeToEdgeModule.default?.setNavigationBarStyle(style);
|
|
92
|
-
}
|
|
93
|
-
if (navigationBarHidden !== currentMergedEntries.navigationBarHidden) {
|
|
94
|
-
_NativeEdgeToEdgeModule.default?.setNavigationBarHidden(navigationBarHidden);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
currentMergedEntries = {
|
|
98
|
-
statusBarStyle,
|
|
99
|
-
navigationBarStyle,
|
|
100
|
-
statusBarHidden,
|
|
101
|
-
navigationBarHidden
|
|
102
|
-
};
|
|
133
|
+
const statusBarStyle = resolveSystemBarStyle(mergedEntries.statusBarStyle);
|
|
134
|
+
const navigationBarStyle = resolveSystemBarStyle(mergedEntries.navigationBarStyle);
|
|
135
|
+
setStatusBarStyle(statusBarStyle);
|
|
136
|
+
setNavigationBarStyle(navigationBarStyle);
|
|
137
|
+
setStatusBarHidden(statusBarHidden);
|
|
138
|
+
setNavigationBarHidden(navigationBarHidden);
|
|
103
139
|
});
|
|
104
140
|
}
|
|
105
141
|
}
|
|
@@ -145,14 +181,52 @@ function replaceStackEntry(entry, props) {
|
|
|
145
181
|
updateEntriesStack();
|
|
146
182
|
return newEntry;
|
|
147
183
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Set the SystemBars style.
|
|
187
|
+
*
|
|
188
|
+
* @param style SystemBars style to set.
|
|
189
|
+
*/
|
|
190
|
+
function setStyle(style) {
|
|
191
|
+
const props = resolveProps({
|
|
192
|
+
style
|
|
193
|
+
});
|
|
194
|
+
const statusBarStyle = resolveSystemBarStyle(props.statusBarStyle);
|
|
195
|
+
const navigationBarStyle = resolveSystemBarStyle(props.navigationBarStyle);
|
|
196
|
+
if (typeof statusBarStyle === "string") {
|
|
197
|
+
setStatusBarStyle(statusBarStyle);
|
|
198
|
+
}
|
|
199
|
+
if (typeof navigationBarStyle === "string") {
|
|
200
|
+
setNavigationBarStyle(navigationBarStyle);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Show or hide the SystemBars
|
|
206
|
+
*
|
|
207
|
+
* @param hidden Hide the SystemBars.
|
|
208
|
+
*/
|
|
209
|
+
function setHidden(hidden) {
|
|
210
|
+
const {
|
|
211
|
+
statusBarHidden,
|
|
212
|
+
navigationBarHidden
|
|
213
|
+
} = resolveProps({
|
|
214
|
+
hidden
|
|
215
|
+
});
|
|
216
|
+
if (typeof statusBarHidden === "boolean") {
|
|
217
|
+
setStatusBarHidden(statusBarHidden);
|
|
218
|
+
}
|
|
219
|
+
if (typeof navigationBarHidden === "boolean") {
|
|
220
|
+
setNavigationBarHidden(navigationBarHidden);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function SystemBars(props) {
|
|
224
|
+
const {
|
|
225
|
+
statusBarStyle,
|
|
226
|
+
navigationBarStyle,
|
|
227
|
+
statusBarHidden,
|
|
228
|
+
navigationBarHidden
|
|
229
|
+
} = resolveProps(props);
|
|
156
230
|
const stableProps = (0, _react.useMemo)(() => ({
|
|
157
231
|
style: statusBarStyle === navigationBarStyle ? statusBarStyle : {
|
|
158
232
|
statusBar: statusBarStyle,
|
|
@@ -189,4 +263,6 @@ function SystemBars({
|
|
|
189
263
|
SystemBars.pushStackEntry = pushStackEntry;
|
|
190
264
|
SystemBars.popStackEntry = popStackEntry;
|
|
191
265
|
SystemBars.replaceStackEntry = replaceStackEntry;
|
|
266
|
+
SystemBars.setStyle = setStyle;
|
|
267
|
+
SystemBars.setHidden = setHidden;
|
|
192
268
|
//# sourceMappingURL=SystemBars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_NativeEdgeToEdgeModule","_interopRequireDefault","e","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_NativeEdgeToEdgeModule","_interopRequireDefault","e","__esModule","default","isLightColorScheme","colorScheme","Appearance","getColorScheme","resolveSystemBarStyle","style","toNativeBarStyle","mergeEntriesStack","entriesStack","reduce","prev","cur","prop","statusBarStyle","undefined","navigationBarStyle","statusBarHidden","navigationBarHidden","resolveProps","hidden","compactStyle","compactHidden","statusBar","navigationBar","createStackEntry","props","updateImmediate","currentValues","setStatusBarStyle","nativeStyle","Platform","OS","NativeModule","StatusBar","setBarStyle","setNavigationBarStyle","setStatusBarHidden","setHidden","setNavigationBarHidden","updateEntriesStack","clearImmediate","setImmediate","mergedEntries","pushStackEntry","entry","push","popStackEntry","index","indexOf","splice","replaceStackEntry","newEntry","setStyle","SystemBars","stableProps","useMemo","useColorScheme","stackEntryRef","useRef","useEffect","current"],"sourceRoot":"../../src","sources":["SystemBars.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0D,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK1D,SAASG,kBAAkBA,CAAA,EAAG;EAC5B,MAAMC,WAAW,GAAGC,uBAAU,EAAEC,cAAc,CAAC,CAAC,IAAI,OAAO;EAC3D,OAAOF,WAAW,KAAK,OAAO;AAChC;AAEA,SAASG,qBAAqBA,CAC5BC,KAAiC,EACf;EAClB,QAAQA,KAAK;IACX,KAAK,MAAM;MACT,OAAOL,kBAAkB,CAAC,CAAC,GAAG,MAAM,GAAG,OAAO;IAChD,KAAK,UAAU;MACb,OAAOA,kBAAkB,CAAC,CAAC,GAAG,OAAO,GAAG,MAAM;IAChD;MACE,OAAOK,KAAK;EAChB;AACF;AAEA,SAASC,gBAAgBA,CACvBD,KAAuB,EACuB;EAC9C,OAAOA,KAAK,KAAK,OAAO,IAAIA,KAAK,KAAK,MAAM,GAAG,GAAGA,KAAK,UAAU,GAAG,SAAS;AAC/E;;AAEA;AACA;AACA;AACA,SAASE,iBAAiBA,CAACC,YAA+B,EAAE;EAC1D,OAAOA,YAAY,CAACC,MAAM,CAMxB,CAACC,IAAI,E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AQ,GAAGA,QAAQ;AAC9BC,UAAU,CAAChB,SAAS,GAAGA,SAAS","ignoreList":[]}
|
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
import { useEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { Appearance, Platform, StatusBar, useColorScheme } from "react-native";
|
|
5
5
|
import NativeModule from "./specs/NativeEdgeToEdgeModule";
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
function isLightColorScheme() {
|
|
7
|
+
const colorScheme = Appearance?.getColorScheme() ?? "light";
|
|
8
|
+
return colorScheme === "light";
|
|
9
|
+
}
|
|
10
|
+
function resolveSystemBarStyle(style) {
|
|
11
|
+
switch (style) {
|
|
12
|
+
case "auto":
|
|
13
|
+
return isLightColorScheme() ? "dark" : "light";
|
|
14
|
+
case "inverted":
|
|
15
|
+
return isLightColorScheme() ? "light" : "dark";
|
|
16
|
+
default:
|
|
17
|
+
return style;
|
|
18
|
+
}
|
|
8
19
|
}
|
|
9
20
|
function toNativeBarStyle(style) {
|
|
10
21
|
return style === "light" || style === "dark" ? `${style}-content` : "default";
|
|
@@ -29,17 +40,25 @@ function mergeEntriesStack(entriesStack) {
|
|
|
29
40
|
navigationBarHidden: false
|
|
30
41
|
});
|
|
31
42
|
}
|
|
43
|
+
function resolveProps({
|
|
44
|
+
hidden,
|
|
45
|
+
style
|
|
46
|
+
}) {
|
|
47
|
+
const compactStyle = typeof style === "string";
|
|
48
|
+
const compactHidden = typeof hidden === "boolean";
|
|
49
|
+
return {
|
|
50
|
+
statusBarStyle: compactStyle ? style : style?.statusBar,
|
|
51
|
+
navigationBarStyle: compactStyle ? style : style?.navigationBar,
|
|
52
|
+
statusBarHidden: compactHidden ? hidden : hidden?.statusBar,
|
|
53
|
+
navigationBarHidden: compactHidden ? hidden : hidden?.navigationBar
|
|
54
|
+
};
|
|
55
|
+
}
|
|
32
56
|
|
|
33
57
|
/**
|
|
34
58
|
* Returns an object to insert in the props stack from the props.
|
|
35
59
|
*/
|
|
36
60
|
function createStackEntry(props) {
|
|
37
|
-
return
|
|
38
|
-
statusBarStyle: typeof props.style === "string" ? props.style : props.style?.statusBar,
|
|
39
|
-
navigationBarStyle: typeof props.style === "string" ? props.style : props.style?.navigationBar,
|
|
40
|
-
statusBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.statusBar,
|
|
41
|
-
navigationBarHidden: typeof props.hidden === "boolean" ? props.hidden : props.hidden?.navigationBar
|
|
42
|
-
};
|
|
61
|
+
return resolveProps(props);
|
|
43
62
|
}
|
|
44
63
|
const entriesStack = [];
|
|
45
64
|
|
|
@@ -47,12 +66,50 @@ const entriesStack = [];
|
|
|
47
66
|
let updateImmediate = null;
|
|
48
67
|
|
|
49
68
|
// The current merged values from the entries stack.
|
|
50
|
-
|
|
69
|
+
const currentValues = {
|
|
51
70
|
statusBarStyle: undefined,
|
|
52
71
|
navigationBarStyle: undefined,
|
|
53
72
|
statusBarHidden: false,
|
|
54
73
|
navigationBarHidden: false
|
|
55
74
|
};
|
|
75
|
+
function setStatusBarStyle(style) {
|
|
76
|
+
if (style !== currentValues.statusBarStyle) {
|
|
77
|
+
currentValues.statusBarStyle = style;
|
|
78
|
+
const nativeStyle = toNativeBarStyle(style);
|
|
79
|
+
if (Platform.OS === "android") {
|
|
80
|
+
NativeModule?.setStatusBarStyle(nativeStyle);
|
|
81
|
+
} else if (Platform.OS === "ios") {
|
|
82
|
+
StatusBar.setBarStyle(nativeStyle, true);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function setNavigationBarStyle(style) {
|
|
87
|
+
if (style !== currentValues.navigationBarStyle) {
|
|
88
|
+
currentValues.navigationBarStyle = style;
|
|
89
|
+
if (Platform.OS === "android") {
|
|
90
|
+
const nativeStyle = toNativeBarStyle(style);
|
|
91
|
+
NativeModule?.setNavigationBarStyle(nativeStyle);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function setStatusBarHidden(hidden) {
|
|
96
|
+
if (hidden !== currentValues.statusBarHidden) {
|
|
97
|
+
currentValues.statusBarHidden = hidden;
|
|
98
|
+
if (Platform.OS === "android") {
|
|
99
|
+
NativeModule?.setStatusBarHidden(hidden);
|
|
100
|
+
} else if (Platform.OS === "ios") {
|
|
101
|
+
StatusBar.setHidden(hidden, "fade"); // 'slide' doesn't work in this context
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function setNavigationBarHidden(hidden) {
|
|
106
|
+
if (hidden !== currentValues.navigationBarHidden) {
|
|
107
|
+
currentValues.navigationBarHidden = hidden;
|
|
108
|
+
if (Platform.OS === "android") {
|
|
109
|
+
NativeModule?.setNavigationBarHidden(hidden);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
56
113
|
|
|
57
114
|
/**
|
|
58
115
|
* Updates the native system bars with the entries from the stack.
|
|
@@ -63,38 +120,17 @@ function updateEntriesStack() {
|
|
|
63
120
|
clearImmediate(updateImmediate);
|
|
64
121
|
}
|
|
65
122
|
updateImmediate = setImmediate(() => {
|
|
66
|
-
const isLightColorScheme = getColorScheme() === "light";
|
|
67
|
-
const autoBarStyle = isLightColorScheme ? "dark" : "light";
|
|
68
|
-
const invertedBarStyle = isLightColorScheme ? "light" : "dark";
|
|
69
123
|
const mergedEntries = mergeEntriesStack(entriesStack);
|
|
70
|
-
const statusBarStyle = mergedEntries.statusBarStyle === "auto" ? autoBarStyle : mergedEntries.statusBarStyle === "inverted" ? invertedBarStyle : mergedEntries.statusBarStyle;
|
|
71
|
-
const navigationBarStyle = mergedEntries.navigationBarStyle === "auto" ? autoBarStyle : mergedEntries.navigationBarStyle === "inverted" ? invertedBarStyle : mergedEntries.navigationBarStyle;
|
|
72
124
|
const {
|
|
73
125
|
statusBarHidden,
|
|
74
126
|
navigationBarHidden
|
|
75
127
|
} = mergedEntries;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
if (Platform.OS === "android") {
|
|
84
|
-
if (navigationBarStyle !== currentMergedEntries.navigationBarStyle) {
|
|
85
|
-
const style = toNativeBarStyle(navigationBarStyle);
|
|
86
|
-
NativeModule?.setNavigationBarStyle(style);
|
|
87
|
-
}
|
|
88
|
-
if (navigationBarHidden !== currentMergedEntries.navigationBarHidden) {
|
|
89
|
-
NativeModule?.setNavigationBarHidden(navigationBarHidden);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
currentMergedEntries = {
|
|
93
|
-
statusBarStyle,
|
|
94
|
-
navigationBarStyle,
|
|
95
|
-
statusBarHidden,
|
|
96
|
-
navigationBarHidden
|
|
97
|
-
};
|
|
128
|
+
const statusBarStyle = resolveSystemBarStyle(mergedEntries.statusBarStyle);
|
|
129
|
+
const navigationBarStyle = resolveSystemBarStyle(mergedEntries.navigationBarStyle);
|
|
130
|
+
setStatusBarStyle(statusBarStyle);
|
|
131
|
+
setNavigationBarStyle(navigationBarStyle);
|
|
132
|
+
setStatusBarHidden(statusBarHidden);
|
|
133
|
+
setNavigationBarHidden(navigationBarHidden);
|
|
98
134
|
});
|
|
99
135
|
}
|
|
100
136
|
}
|
|
@@ -140,14 +176,52 @@ function replaceStackEntry(entry, props) {
|
|
|
140
176
|
updateEntriesStack();
|
|
141
177
|
return newEntry;
|
|
142
178
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Set the SystemBars style.
|
|
182
|
+
*
|
|
183
|
+
* @param style SystemBars style to set.
|
|
184
|
+
*/
|
|
185
|
+
function setStyle(style) {
|
|
186
|
+
const props = resolveProps({
|
|
187
|
+
style
|
|
188
|
+
});
|
|
189
|
+
const statusBarStyle = resolveSystemBarStyle(props.statusBarStyle);
|
|
190
|
+
const navigationBarStyle = resolveSystemBarStyle(props.navigationBarStyle);
|
|
191
|
+
if (typeof statusBarStyle === "string") {
|
|
192
|
+
setStatusBarStyle(statusBarStyle);
|
|
193
|
+
}
|
|
194
|
+
if (typeof navigationBarStyle === "string") {
|
|
195
|
+
setNavigationBarStyle(navigationBarStyle);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Show or hide the SystemBars
|
|
201
|
+
*
|
|
202
|
+
* @param hidden Hide the SystemBars.
|
|
203
|
+
*/
|
|
204
|
+
function setHidden(hidden) {
|
|
205
|
+
const {
|
|
206
|
+
statusBarHidden,
|
|
207
|
+
navigationBarHidden
|
|
208
|
+
} = resolveProps({
|
|
209
|
+
hidden
|
|
210
|
+
});
|
|
211
|
+
if (typeof statusBarHidden === "boolean") {
|
|
212
|
+
setStatusBarHidden(statusBarHidden);
|
|
213
|
+
}
|
|
214
|
+
if (typeof navigationBarHidden === "boolean") {
|
|
215
|
+
setNavigationBarHidden(navigationBarHidden);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
export function SystemBars(props) {
|
|
219
|
+
const {
|
|
220
|
+
statusBarStyle,
|
|
221
|
+
navigationBarStyle,
|
|
222
|
+
statusBarHidden,
|
|
223
|
+
navigationBarHidden
|
|
224
|
+
} = resolveProps(props);
|
|
151
225
|
const stableProps = useMemo(() => ({
|
|
152
226
|
style: statusBarStyle === navigationBarStyle ? statusBarStyle : {
|
|
153
227
|
statusBar: statusBarStyle,
|
|
@@ -184,4 +258,6 @@ export function SystemBars({
|
|
|
184
258
|
SystemBars.pushStackEntry = pushStackEntry;
|
|
185
259
|
SystemBars.popStackEntry = popStackEntry;
|
|
186
260
|
SystemBars.replaceStackEntry = replaceStackEntry;
|
|
261
|
+
SystemBars.setStyle = setStyle;
|
|
262
|
+
SystemBars.setHidden = setHidden;
|
|
187
263
|
//# sourceMappingURL=SystemBars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useMemo","useRef","Appearance","Platform","StatusBar","useColorScheme","NativeModule","getColorScheme","
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","useRef","Appearance","Platform","StatusBar","useColorScheme","NativeModule","isLightColorScheme","colorScheme","getColorScheme","resolveSystemBarStyle","style","toNativeBarStyle","mergeEntriesStack","entriesStack","reduce","prev","cur","prop","statusBarStyle","undefined","navigationBarStyle","statusBarHidden","navigationBarHidden","resolveProps","hidden","compactStyle","compactHidden","statusBar","navigationBar","createStackEntry","props","updateImmediate","currentValues","setStatusBarStyle","nativeStyle","OS","setBarStyle","setNavigationBarStyle","setStatusBarHidden","setHidden","setNavigationBarHidden","updateEntriesStack","clearImmediate","setImmediate","mergedEntries","pushStackEntry","entry","push","popStackEntry","index","indexOf","splice","replaceStackEntry","newEntry","setStyle","SystemBars","stableProps","stackEntryRef","current"],"sourceRoot":"../../src","sources":["SystemBars.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAClD,SAASC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,cAAc,QAAQ,cAAc;AAC9E,OAAOC,YAAY,MAAM,gCAAgC;AAKzD,SAASC,kBAAkBA,CAAA,EAAG;EAC5B,MAAMC,WAAW,GAAGN,UAAU,EAAEO,cAAc,CAAC,CAAC,IAAI,OAAO;EAC3D,OAAOD,WAAW,KAAK,OAAO;AAChC;AAEA,SAASE,qBAAqBA,CAC5BC,KAAiC,EACf;EAClB,QAAQA,KAAK;IACX,KAAK,MAAM;MACT,OAAOJ,kBAAkB,CAAC,CAAC,GAAG,MAAM,GAAG,OAAO;IAChD,KAAK,UAAU;MACb,OAAOA,kBAAkB,CAAC,CAAC,GAAG,OAAO,GAAG,MAAM;IAChD;MACE,OAAOI,KAAK;EAChB;AACF;AAEA,SAASC,gBAAgBA,CACvBD,KAAuB,EACuB;EAC9C,OAAOA,KAAK,KAAK,OAAO,IAAIA,KAAK,KAAK,MAAM,GAAG,GAAGA,KAAK,U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C1CU,UAAU,CAACP,aAAa,GAAGA,aAAa;AACxCO,UAAU,CAACH,iBAAiB,GAAGA,iBAAiB;AAChDG,UAAU,CAACD,QAAQ,GAAGA,QAAQ;AAC9BC,UAAU,CAAChB,SAAS,GAAGA,SAAS","ignoreList":[]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SystemBarsEntry, SystemBarsProps } from "./types";
|
|
2
|
-
export declare function SystemBars(
|
|
2
|
+
export declare function SystemBars(props: SystemBarsProps): null;
|
|
3
3
|
export declare namespace SystemBars {
|
|
4
4
|
var pushStackEntry: (props: SystemBarsProps) => SystemBarsEntry;
|
|
5
5
|
var popStackEntry: (entry: SystemBarsEntry) => void;
|
|
6
6
|
var replaceStackEntry: (entry: SystemBarsEntry, props: SystemBarsProps) => SystemBarsEntry;
|
|
7
|
+
var setStyle: (style: SystemBarsProps["style"]) => void;
|
|
8
|
+
var setHidden: (hidden: SystemBarsProps["hidden"]) => void;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=SystemBars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemBars.d.ts","sourceRoot":"","sources":["../../src/SystemBars.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SystemBars.d.ts","sourceRoot":"","sources":["../../src/SystemBars.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AAwP3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,QAmDhD;yBAnDe,UAAU;gCA1EK,eAAe,KAAG,eAAe;+BAYlC,eAAe,KAAG,IAAI;mCAe3C,eAAe,SACf,eAAe,KACrB,eAAe;0BAeO,eAAe,CAAC,OAAO,CAAC;4BAmBtB,eAAe,CAAC,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-edge-to-edge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Effortlessly enable edge-to-edge display in React Native",
|
|
6
6
|
"author": "Mathieu Acthernoene <zoontek@gmail.com>",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"prettier": "^3.5.3",
|
|
64
64
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
65
65
|
"react": "19.0.0",
|
|
66
|
-
"react-native": "0.
|
|
67
|
-
"react-native-builder-bob": "^0.
|
|
68
|
-
"typescript": "^5.8.
|
|
66
|
+
"react-native": "0.79.0",
|
|
67
|
+
"react-native-builder-bob": "^0.40.6",
|
|
68
|
+
"typescript": "^5.8.3"
|
|
69
69
|
},
|
|
70
70
|
"codegenConfig": {
|
|
71
71
|
"name": "RNEdgeToEdge",
|
package/src/SystemBars.ts
CHANGED
|
@@ -3,14 +3,28 @@ import { Appearance, Platform, StatusBar, useColorScheme } from "react-native";
|
|
|
3
3
|
import NativeModule from "./specs/NativeEdgeToEdgeModule";
|
|
4
4
|
import { SystemBarsEntry, SystemBarsProps, SystemBarStyle } from "./types";
|
|
5
5
|
|
|
6
|
-
type
|
|
6
|
+
type ResolvedBarStyle = "light" | "dark" | undefined;
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function isLightColorScheme() {
|
|
9
|
+
const colorScheme = Appearance?.getColorScheme() ?? "light";
|
|
10
|
+
return colorScheme === "light";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function resolveSystemBarStyle(
|
|
14
|
+
style: SystemBarStyle | undefined,
|
|
15
|
+
): ResolvedBarStyle {
|
|
16
|
+
switch (style) {
|
|
17
|
+
case "auto":
|
|
18
|
+
return isLightColorScheme() ? "dark" : "light";
|
|
19
|
+
case "inverted":
|
|
20
|
+
return isLightColorScheme() ? "light" : "dark";
|
|
21
|
+
default:
|
|
22
|
+
return style;
|
|
23
|
+
}
|
|
10
24
|
}
|
|
11
25
|
|
|
12
26
|
function toNativeBarStyle(
|
|
13
|
-
style:
|
|
27
|
+
style: ResolvedBarStyle,
|
|
14
28
|
): "default" | "light-content" | "dark-content" {
|
|
15
29
|
return style === "light" || style === "dark" ? `${style}-content` : "default";
|
|
16
30
|
}
|
|
@@ -43,26 +57,23 @@ function mergeEntriesStack(entriesStack: SystemBarsEntry[]) {
|
|
|
43
57
|
);
|
|
44
58
|
}
|
|
45
59
|
|
|
60
|
+
function resolveProps({ hidden, style }: SystemBarsProps) {
|
|
61
|
+
const compactStyle = typeof style === "string";
|
|
62
|
+
const compactHidden = typeof hidden === "boolean";
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
statusBarStyle: compactStyle ? style : style?.statusBar,
|
|
66
|
+
navigationBarStyle: compactStyle ? style : style?.navigationBar,
|
|
67
|
+
statusBarHidden: compactHidden ? hidden : hidden?.statusBar,
|
|
68
|
+
navigationBarHidden: compactHidden ? hidden : hidden?.navigationBar,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
46
72
|
/**
|
|
47
73
|
* Returns an object to insert in the props stack from the props.
|
|
48
74
|
*/
|
|
49
75
|
function createStackEntry(props: SystemBarsProps): SystemBarsEntry {
|
|
50
|
-
return
|
|
51
|
-
statusBarStyle:
|
|
52
|
-
typeof props.style === "string" ? props.style : props.style?.statusBar,
|
|
53
|
-
navigationBarStyle:
|
|
54
|
-
typeof props.style === "string"
|
|
55
|
-
? props.style
|
|
56
|
-
: props.style?.navigationBar,
|
|
57
|
-
statusBarHidden:
|
|
58
|
-
typeof props.hidden === "boolean"
|
|
59
|
-
? props.hidden
|
|
60
|
-
: props.hidden?.statusBar,
|
|
61
|
-
navigationBarHidden:
|
|
62
|
-
typeof props.hidden === "boolean"
|
|
63
|
-
? props.hidden
|
|
64
|
-
: props.hidden?.navigationBar,
|
|
65
|
-
};
|
|
76
|
+
return resolveProps(props);
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
const entriesStack: SystemBarsEntry[] = [];
|
|
@@ -71,9 +82,9 @@ const entriesStack: SystemBarsEntry[] = [];
|
|
|
71
82
|
let updateImmediate: NodeJS.Immediate | null = null;
|
|
72
83
|
|
|
73
84
|
// The current merged values from the entries stack.
|
|
74
|
-
|
|
75
|
-
statusBarStyle:
|
|
76
|
-
navigationBarStyle:
|
|
85
|
+
const currentValues: {
|
|
86
|
+
statusBarStyle: ResolvedBarStyle;
|
|
87
|
+
navigationBarStyle: ResolvedBarStyle;
|
|
77
88
|
statusBarHidden: boolean;
|
|
78
89
|
navigationBarHidden: boolean;
|
|
79
90
|
} = {
|
|
@@ -83,6 +94,53 @@ let currentMergedEntries: {
|
|
|
83
94
|
navigationBarHidden: false,
|
|
84
95
|
};
|
|
85
96
|
|
|
97
|
+
function setStatusBarStyle(style: ResolvedBarStyle) {
|
|
98
|
+
if (style !== currentValues.statusBarStyle) {
|
|
99
|
+
currentValues.statusBarStyle = style;
|
|
100
|
+
|
|
101
|
+
const nativeStyle = toNativeBarStyle(style);
|
|
102
|
+
|
|
103
|
+
if (Platform.OS === "android") {
|
|
104
|
+
NativeModule?.setStatusBarStyle(nativeStyle);
|
|
105
|
+
} else if (Platform.OS === "ios") {
|
|
106
|
+
StatusBar.setBarStyle(nativeStyle, true);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function setNavigationBarStyle(style: ResolvedBarStyle) {
|
|
112
|
+
if (style !== currentValues.navigationBarStyle) {
|
|
113
|
+
currentValues.navigationBarStyle = style;
|
|
114
|
+
|
|
115
|
+
if (Platform.OS === "android") {
|
|
116
|
+
const nativeStyle = toNativeBarStyle(style);
|
|
117
|
+
NativeModule?.setNavigationBarStyle(nativeStyle);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function setStatusBarHidden(hidden: boolean) {
|
|
123
|
+
if (hidden !== currentValues.statusBarHidden) {
|
|
124
|
+
currentValues.statusBarHidden = hidden;
|
|
125
|
+
|
|
126
|
+
if (Platform.OS === "android") {
|
|
127
|
+
NativeModule?.setStatusBarHidden(hidden);
|
|
128
|
+
} else if (Platform.OS === "ios") {
|
|
129
|
+
StatusBar.setHidden(hidden, "fade"); // 'slide' doesn't work in this context
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function setNavigationBarHidden(hidden: boolean) {
|
|
135
|
+
if (hidden !== currentValues.navigationBarHidden) {
|
|
136
|
+
currentValues.navigationBarHidden = hidden;
|
|
137
|
+
|
|
138
|
+
if (Platform.OS === "android") {
|
|
139
|
+
NativeModule?.setNavigationBarHidden(hidden);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
86
144
|
/**
|
|
87
145
|
* Updates the native system bars with the entries from the stack.
|
|
88
146
|
*/
|
|
@@ -93,59 +151,20 @@ function updateEntriesStack() {
|
|
|
93
151
|
}
|
|
94
152
|
|
|
95
153
|
updateImmediate = setImmediate(() => {
|
|
96
|
-
const isLightColorScheme = getColorScheme() === "light";
|
|
97
|
-
const autoBarStyle = isLightColorScheme ? "dark" : "light";
|
|
98
|
-
const invertedBarStyle = isLightColorScheme ? "light" : "dark";
|
|
99
|
-
|
|
100
154
|
const mergedEntries = mergeEntriesStack(entriesStack);
|
|
101
|
-
|
|
102
|
-
const statusBarStyle: MergeableBarStyle =
|
|
103
|
-
mergedEntries.statusBarStyle === "auto"
|
|
104
|
-
? autoBarStyle
|
|
105
|
-
: mergedEntries.statusBarStyle === "inverted"
|
|
106
|
-
? invertedBarStyle
|
|
107
|
-
: mergedEntries.statusBarStyle;
|
|
108
|
-
|
|
109
|
-
const navigationBarStyle: MergeableBarStyle =
|
|
110
|
-
mergedEntries.navigationBarStyle === "auto"
|
|
111
|
-
? autoBarStyle
|
|
112
|
-
: mergedEntries.navigationBarStyle === "inverted"
|
|
113
|
-
? invertedBarStyle
|
|
114
|
-
: mergedEntries.navigationBarStyle;
|
|
115
|
-
|
|
116
155
|
const { statusBarHidden, navigationBarHidden } = mergedEntries;
|
|
117
156
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (statusBarHidden !== currentMergedEntries.statusBarHidden) {
|
|
127
|
-
Platform.OS === "android"
|
|
128
|
-
? NativeModule?.setStatusBarHidden(statusBarHidden)
|
|
129
|
-
: StatusBar.setHidden(statusBarHidden, "fade"); // 'slide' doesn't work in this context
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (Platform.OS === "android") {
|
|
133
|
-
if (navigationBarStyle !== currentMergedEntries.navigationBarStyle) {
|
|
134
|
-
const style = toNativeBarStyle(navigationBarStyle);
|
|
135
|
-
NativeModule?.setNavigationBarStyle(style);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (navigationBarHidden !== currentMergedEntries.navigationBarHidden) {
|
|
139
|
-
NativeModule?.setNavigationBarHidden(navigationBarHidden);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
157
|
+
const statusBarStyle = resolveSystemBarStyle(
|
|
158
|
+
mergedEntries.statusBarStyle,
|
|
159
|
+
);
|
|
160
|
+
const navigationBarStyle = resolveSystemBarStyle(
|
|
161
|
+
mergedEntries.navigationBarStyle,
|
|
162
|
+
);
|
|
142
163
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
navigationBarHidden,
|
|
148
|
-
};
|
|
164
|
+
setStatusBarStyle(statusBarStyle);
|
|
165
|
+
setNavigationBarStyle(navigationBarStyle);
|
|
166
|
+
setStatusBarHidden(statusBarHidden);
|
|
167
|
+
setNavigationBarHidden(navigationBarHidden);
|
|
149
168
|
});
|
|
150
169
|
}
|
|
151
170
|
}
|
|
@@ -195,14 +214,48 @@ function replaceStackEntry(
|
|
|
195
214
|
return newEntry;
|
|
196
215
|
}
|
|
197
216
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Set the SystemBars style.
|
|
219
|
+
*
|
|
220
|
+
* @param style SystemBars style to set.
|
|
221
|
+
*/
|
|
222
|
+
function setStyle(style: SystemBarsProps["style"]) {
|
|
223
|
+
const props = resolveProps({ style });
|
|
224
|
+
|
|
225
|
+
const statusBarStyle = resolveSystemBarStyle(props.statusBarStyle);
|
|
226
|
+
const navigationBarStyle = resolveSystemBarStyle(props.navigationBarStyle);
|
|
227
|
+
|
|
228
|
+
if (typeof statusBarStyle === "string") {
|
|
229
|
+
setStatusBarStyle(statusBarStyle);
|
|
230
|
+
}
|
|
231
|
+
if (typeof navigationBarStyle === "string") {
|
|
232
|
+
setNavigationBarStyle(navigationBarStyle);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Show or hide the SystemBars
|
|
238
|
+
*
|
|
239
|
+
* @param hidden Hide the SystemBars.
|
|
240
|
+
*/
|
|
241
|
+
function setHidden(hidden: SystemBarsProps["hidden"]) {
|
|
242
|
+
const { statusBarHidden, navigationBarHidden } = resolveProps({ hidden });
|
|
243
|
+
|
|
244
|
+
if (typeof statusBarHidden === "boolean") {
|
|
245
|
+
setStatusBarHidden(statusBarHidden);
|
|
246
|
+
}
|
|
247
|
+
if (typeof navigationBarHidden === "boolean") {
|
|
248
|
+
setNavigationBarHidden(navigationBarHidden);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export function SystemBars(props: SystemBarsProps) {
|
|
253
|
+
const {
|
|
254
|
+
statusBarStyle,
|
|
255
|
+
navigationBarStyle,
|
|
256
|
+
statusBarHidden,
|
|
257
|
+
navigationBarHidden,
|
|
258
|
+
} = resolveProps(props);
|
|
206
259
|
|
|
207
260
|
const stableProps = useMemo<SystemBarsProps>(
|
|
208
261
|
() => ({
|
|
@@ -252,3 +305,5 @@ export function SystemBars({ hidden, style }: SystemBarsProps) {
|
|
|
252
305
|
SystemBars.pushStackEntry = pushStackEntry;
|
|
253
306
|
SystemBars.popStackEntry = popStackEntry;
|
|
254
307
|
SystemBars.replaceStackEntry = replaceStackEntry;
|
|
308
|
+
SystemBars.setStyle = setStyle;
|
|
309
|
+
SystemBars.setHidden = setHidden;
|