@applicaster/zapp-react-native-ui-components 15.0.0-rc.6 → 15.0.0-rc.8
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<Screen Component /> when the navbar should be hidden renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
|
+
importantForAccessibility="yes"
|
|
5
6
|
style={
|
|
6
7
|
{
|
|
7
8
|
"backgroundColor": "blue",
|
|
@@ -34,6 +35,7 @@ exports[`<Screen Component /> when the navbar should be hidden renders correctly
|
|
|
34
35
|
|
|
35
36
|
exports[`<Screen Component /> when the navbar should show renders correctly 1`] = `
|
|
36
37
|
<View
|
|
38
|
+
importantForAccessibility="yes"
|
|
37
39
|
style={
|
|
38
40
|
{
|
|
39
41
|
"backgroundColor": "blue",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@applicaster/applicaster-types" />
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { View } from "react-native";
|
|
3
|
+
import { AccessibilityInfo, findNodeHandle, View } from "react-native";
|
|
4
4
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
5
5
|
|
|
6
6
|
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from "@applicaster/zapp-react-native-utils/navigationUtils";
|
|
13
13
|
import {
|
|
14
14
|
useCurrentScreenData,
|
|
15
|
+
useIsScreenActive,
|
|
15
16
|
useNavbarState,
|
|
16
17
|
useNavigation,
|
|
17
18
|
useRoute,
|
|
@@ -57,8 +58,8 @@ export function Screen(_props: Props) {
|
|
|
57
58
|
const hasMenu = shouldNavBarDisplayMenu(currentRiver, plugins);
|
|
58
59
|
|
|
59
60
|
const navBarProps = React.useMemo<MobileNavBarPluginProps | null>(
|
|
60
|
-
getNavBarProps(currentRiver, pathname, title),
|
|
61
|
-
[currentRiver, pathname]
|
|
61
|
+
() => getNavBarProps(currentRiver, pathname, title),
|
|
62
|
+
[currentRiver, pathname, title]
|
|
62
63
|
);
|
|
63
64
|
|
|
64
65
|
const NavBar = React.useMemo(
|
|
@@ -89,13 +90,29 @@ export function Screen(_props: Props) {
|
|
|
89
90
|
[theme.app_background_color, backgroundColor]
|
|
90
91
|
);
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
const isActive = useIsScreenActive();
|
|
94
|
+
|
|
95
|
+
const ref = React.useRef(null);
|
|
93
96
|
const isReady = useWaitForValidOrientation();
|
|
94
97
|
|
|
98
|
+
React.useEffect(() => {
|
|
99
|
+
if (ref.current && isActive && isReady) {
|
|
100
|
+
const nodeHandle = findNodeHandle(ref.current);
|
|
101
|
+
|
|
102
|
+
if (nodeHandle != null) {
|
|
103
|
+
AccessibilityInfo.setAccessibilityFocus(nodeHandle);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, [isActive, isReady]);
|
|
107
|
+
|
|
95
108
|
// We prevent rendering of the screen until UI is actually rotated to screen desired orientation.
|
|
96
109
|
// This saves unnecessary re-renders and user will not see distorted aspect screen.
|
|
97
110
|
return (
|
|
98
|
-
<View
|
|
111
|
+
<View
|
|
112
|
+
ref={ref}
|
|
113
|
+
style={style}
|
|
114
|
+
importantForAccessibility={!isActive ? "no-hide-descendants" : "yes"}
|
|
115
|
+
>
|
|
99
116
|
{isReady ? (
|
|
100
117
|
<>
|
|
101
118
|
{navBarProps ? <NavBar {...navBarProps} hasMenu={hasMenu} /> : null}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "15.0.0-rc.
|
|
3
|
+
"version": "15.0.0-rc.8",
|
|
4
4
|
"description": "Applicaster Zapp React Native ui components for the Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "15.0.0-rc.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "15.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "15.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "15.0.0-rc.8",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.8",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "15.0.0-rc.8",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "15.0.0-rc.8",
|
|
35
35
|
"promise": "^8.3.0",
|
|
36
36
|
"url": "^0.11.0",
|
|
37
37
|
"uuid": "^3.3.2"
|