@applicaster/zapp-react-native-ui-components 12.0.0-alpha.3788876021 → 12.0.0-alpha.3823240084
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/Components/BaseFocusable/index.tsx +3 -3
- package/Components/Cell/Cell.tsx +30 -9
- package/Components/Cell/CellWithFocusable.tsx +23 -9
- package/Components/Cell/TvOSCellComponent.tsx +3 -7
- package/Components/Focusable/Focusable.tsx +6 -1
- package/Components/FocusableGroup/index.tsx +11 -2
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +13 -6
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +1 -1
- package/Components/HandlePlayable/HandlePlayable.tsx +3 -0
- package/Components/Layout/TV/ScreenContainer.tsx +79 -5
- package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +2 -2
- package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +38 -28
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +25 -13
- package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +10 -50
- package/Components/Layout/TV/__tests__/index.test.tsx +20 -75
- package/Components/Layout/TV/index.tsx +14 -67
- package/Components/Layout/TV/index.web.tsx +33 -0
- package/Components/Layout/index.tsx +15 -11
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +86 -116
- package/Components/MasterCell/DefaultComponents/DynamicBadge.tsx +4 -2
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +5 -3
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/index.ts +57 -0
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +5 -1
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +34 -1
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +14 -2
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +24 -9
- package/Components/MasterCell/DefaultComponents/index.ts +2 -0
- package/Components/MasterCell/DefaultComponents/tv/ButtonContainerView/index.android.tsx +4 -1
- package/Components/MasterCell/DefaultComponents/tv/ButtonContainerView/index.tsx +10 -2
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/index.ts +1 -3
- package/Components/MasterCell/dataAdapter.ts +21 -7
- package/Components/MasterCell/hooks/useAsyncRendering/index.ts +1 -1
- package/Components/MasterCell/index.tsx +5 -3
- package/Components/MasterCell/utils/__tests__/insertBetween.test.js +9 -0
- package/Components/MasterCell/utils/index.ts +17 -30
- package/Components/MeasurmentsPortal/BasicMeasurementsPortal.tsx +11 -7
- package/Components/MeasurmentsPortal/MeasurementsPortal.tsx +10 -1
- package/Components/Navigator/StackNavigator.tsx +57 -0
- package/Components/Navigator/index.ts +1 -0
- package/Components/PlayerContainer/PlayerContainer.tsx +14 -6
- package/Components/River/ComponentsMap/ComponentsMap.tsx +92 -22
- package/Components/River/RefreshControl.tsx +55 -1
- package/Components/River/TV/River.tsx +0 -23
- package/Components/RouteManager/index.tsx +2 -2
- package/Components/Screen/TV/hooks/index.ts +3 -0
- package/Components/Screen/TV/hooks/useInitialFocus.ts +70 -0
- package/Components/Screen/TV/hooks/useRestoreFocus.ts +22 -0
- package/Components/Screen/TV/index.web.tsx +165 -0
- package/Components/Screen/__tests__/Screen.test.tsx +3 -0
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +4 -0
- package/Components/Screen/index.tsx +62 -54
- package/Components/Screen/navigationHandler.ts +6 -3
- package/Components/ScreenResolver/index.tsx +9 -12
- package/Components/Transitioner/Scene.tsx +24 -25
- package/Components/Transitioner/Transitioner.tsx +38 -43
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +12 -4
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +1 -0
- package/Components/VideoLive/LiveImageManager.ts +28 -1
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +52 -24
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +25 -28
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +2 -14
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +73 -48
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +55 -34
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +104 -86
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +44 -5
- package/Components/VideoModal/ModalAnimation/utils.ts +7 -4
- package/Components/VideoModal/PlayerDetails.tsx +3 -3
- package/Components/VideoModal/PlayerWrapper.tsx +67 -60
- package/Components/VideoModal/VideoModal.tsx +17 -17
- package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +7 -0
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +80 -14
- package/Components/VideoModal/hooks/useModalSize.ts +10 -12
- package/Components/VideoModal/utils.ts +5 -2
- package/Components/Viewport/ViewportTracker/ViewportTracker.tsx +31 -40
- package/Components/Viewport/ViewportTracker/index.tsx +1 -0
- package/Components/Viewport/utils.js +1 -1
- package/Components/ZappFrameworkComponents/BarView/BarView.tsx +4 -3
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +4 -4
- package/Contexts/FocusableGroupContext/FocusableGroupContext.ts +3 -0
- package/Contexts/FocusableGroupContext/FocusableGroupContextProvider.tsx +16 -0
- package/Contexts/FocusableGroupContext/__tests__/FocusableGroupContextProvider.test.tsx +22 -0
- package/Contexts/FocusableGroupContext/__tests__/withFocusableContext.test.tsx +26 -0
- package/Contexts/FocusableGroupContext/index.ts +7 -0
- package/Contexts/FocusableGroupContext/withFocusableContext.tsx +17 -0
- package/Contexts/MenuToggleContext/{index.js → index.ts} +16 -0
- package/Contexts/ScreenContext/__tests__/__snapshots__/index.test.tsx.snap +3 -0
- package/Contexts/ScreenContext/__tests__/index.test.tsx +27 -0
- package/Contexts/ScreenContext/index.tsx +94 -25
- package/Contexts/ScreenDataContext/index.tsx +20 -0
- package/Contexts/ZappPipesContext/ZappPipesEntryContext.ts +1 -1
- package/events/index.ts +1 -0
- package/package.json +5 -5
- package/Components/Layout/TV/TransitionOverlay.tsx +0 -64
- /package/Components/FocusableGroup/{index.android.js → index.android.ts} +0 -0
- /package/Components/FocusableGroup/{index.ios.js → index.ios.ts} +0 -0
- /package/Contexts/{index.js → index.ts} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text } from "react-native";
|
|
3
|
+
import { render } from "@testing-library/react-native";
|
|
4
|
+
import { withFocusableContext } from "../withFocusableContext";
|
|
5
|
+
import { FocusableGroupContext } from "../FocusableGroupContext";
|
|
6
|
+
|
|
7
|
+
const MockComponent = ({ groupId }: { groupId: string }) => (
|
|
8
|
+
<Text testID={groupId} />
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const WrappedComponent = withFocusableContext(MockComponent);
|
|
12
|
+
|
|
13
|
+
describe("withFocusableContext HOC", () => {
|
|
14
|
+
it("should provide focusable context to the wrapped component", () => {
|
|
15
|
+
const { getByTestId } = render(<WrappedComponent />, {
|
|
16
|
+
// eslint-disable-next-line react/display-name
|
|
17
|
+
wrapper: ({ children }: { children: React.ReactElement }) => (
|
|
18
|
+
<FocusableGroupContext.Provider value="test">
|
|
19
|
+
{children}
|
|
20
|
+
</FocusableGroupContext.Provider>
|
|
21
|
+
),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(getByTestId("test")).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FocusableGroupContext } from "./FocusableGroupContext";
|
|
3
|
+
import { FocusableGroupContextProvider } from "./FocusableGroupContextProvider";
|
|
4
|
+
|
|
5
|
+
export { FocusableGroupContext, FocusableGroupContextProvider };
|
|
6
|
+
|
|
7
|
+
export const useGroupId = () => React.useContext(FocusableGroupContext);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FocusableGroupContext } from "./FocusableGroupContext";
|
|
3
|
+
|
|
4
|
+
export const withFocusableContext = (Component) => {
|
|
5
|
+
// eslint-disable-next-line react/display-name
|
|
6
|
+
return ({ groupId, ...props }: Record<string, any>) => (
|
|
7
|
+
<FocusableGroupContext.Consumer>
|
|
8
|
+
{(groupIdContext: string) => {
|
|
9
|
+
// eslint-disable-next-line react/display-name
|
|
10
|
+
const propsGroupId = groupId || null;
|
|
11
|
+
const providedGroupId = propsGroupId || groupIdContext;
|
|
12
|
+
|
|
13
|
+
return <Component {...props} groupId={providedGroupId} />;
|
|
14
|
+
}}
|
|
15
|
+
</FocusableGroupContext.Consumer>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext } from "@applicaster/zapp-react-native-utils/reactUtils/createContext";
|
|
2
|
+
import React from "react";
|
|
2
3
|
|
|
3
4
|
const initialContext = { toggleMenu: {}, closeMenu: {}, openMenu: {} };
|
|
4
5
|
|
|
@@ -16,3 +17,18 @@ const stateValidator = ({ property }) =>
|
|
|
16
17
|
property === "openMenu";
|
|
17
18
|
|
|
18
19
|
export const MenuToggleContext = createContext(initialContext, stateValidator);
|
|
20
|
+
|
|
21
|
+
export type MenuToggleContextType = {
|
|
22
|
+
toggleMenu: any;
|
|
23
|
+
setToggleMenu: () => void;
|
|
24
|
+
openMenu: any;
|
|
25
|
+
setOpenMenu: () => void;
|
|
26
|
+
closeMenu: any;
|
|
27
|
+
setCloseMenu: () => void;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const useMenuToggleContext = () => {
|
|
31
|
+
return React.useContext<MenuToggleContextType>(
|
|
32
|
+
MenuToggleContext.ReactContext
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { render } from "@testing-library/react-native";
|
|
2
|
+
import { ScreenContext, ScreenContextProvider, withScreenContext } from "../";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
describe("ScreenContext", () => {
|
|
6
|
+
describe("ScreneContext context", () => {
|
|
7
|
+
it("should return the context", () => {
|
|
8
|
+
expect(ScreenContext).toBeDefined();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe("ScreenContextProvider", () => {
|
|
13
|
+
it("should return the provider", () => {
|
|
14
|
+
expect(ScreenContextProvider).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe("withScreenContext", () => {
|
|
19
|
+
it("should return the context", () => {
|
|
20
|
+
const Component = () => null;
|
|
21
|
+
const WrappedComponent = withScreenContext(Component);
|
|
22
|
+
const { toJSON } = render(<WrappedComponent />);
|
|
23
|
+
|
|
24
|
+
expect(toJSON()).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
createContext,
|
|
3
|
+
ReactNode,
|
|
4
|
+
useCallback,
|
|
5
|
+
useMemo,
|
|
6
|
+
useRef,
|
|
7
|
+
} from "react";
|
|
2
8
|
import {
|
|
3
9
|
useCurrentScreenData,
|
|
4
10
|
useNavigation,
|
|
@@ -7,27 +13,67 @@ import {
|
|
|
7
13
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
8
14
|
import { useModalNavigationContext } from "@applicaster/zapp-react-native-ui-components/Contexts/ModalNavigationContext";
|
|
9
15
|
import { useNestedNavigationContext } from "@applicaster/zapp-react-native-ui-components/Contexts/NestedNavigationContext";
|
|
16
|
+
import { create, StoreApi, UseBoundStore } from "zustand";
|
|
17
|
+
import { useShallow } from "zustand/react/shallow";
|
|
18
|
+
import { Animated } from "react-native";
|
|
19
|
+
|
|
20
|
+
interface NavBarStoreState {
|
|
21
|
+
visible: boolean;
|
|
22
|
+
title: string;
|
|
23
|
+
summary: string;
|
|
24
|
+
setVisible: (state: boolean) => void;
|
|
25
|
+
setTitle: (title: string) => void;
|
|
26
|
+
setSummary: (subtitle: string) => void;
|
|
27
|
+
height: number;
|
|
28
|
+
scrollState: number;
|
|
29
|
+
contentPosition: string;
|
|
30
|
+
scrollYAnimated: Animated.Value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface NavBarState {
|
|
34
|
+
visible: boolean;
|
|
35
|
+
title: string;
|
|
36
|
+
summary: string;
|
|
37
|
+
setVisible: (state: boolean) => void;
|
|
38
|
+
setTitle: (title: string) => void;
|
|
39
|
+
setSummary: (subtitle: string) => void;
|
|
40
|
+
}
|
|
10
41
|
|
|
11
42
|
type ScreenContextType = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
title: string;
|
|
15
|
-
summary: string;
|
|
16
|
-
setVisible: (state: boolean) => void;
|
|
17
|
-
setTitle: (title: string) => void;
|
|
18
|
-
setSummary: (subtitle: string) => void;
|
|
19
|
-
};
|
|
43
|
+
_navBarStore: UseBoundStore<StoreApi<NavBarStoreState>>;
|
|
44
|
+
navBar: NavBarState;
|
|
20
45
|
legacyFormatScreenData: LegacyNavigationScreenData | null;
|
|
21
46
|
};
|
|
22
47
|
|
|
48
|
+
const createStore = () =>
|
|
49
|
+
create<NavBarStoreState>((set) => ({
|
|
50
|
+
title: "",
|
|
51
|
+
summary: "",
|
|
52
|
+
visible: true,
|
|
53
|
+
height: 0,
|
|
54
|
+
scrollState: 0,
|
|
55
|
+
contentPosition: "",
|
|
56
|
+
scrollYAnimated: new Animated.Value(0),
|
|
57
|
+
setTitle(title) {
|
|
58
|
+
set({ title });
|
|
59
|
+
},
|
|
60
|
+
setSummary(summary) {
|
|
61
|
+
set({ summary });
|
|
62
|
+
},
|
|
63
|
+
setVisible(visible) {
|
|
64
|
+
set({ visible });
|
|
65
|
+
},
|
|
66
|
+
}));
|
|
67
|
+
|
|
23
68
|
export const ScreenContext = createContext<ScreenContextType>({
|
|
69
|
+
_navBarStore: createStore(),
|
|
24
70
|
navBar: {
|
|
25
71
|
visible: true,
|
|
26
72
|
title: "",
|
|
27
73
|
summary: "",
|
|
28
|
-
setVisible: (_state) =>
|
|
29
|
-
setTitle: (_title) =>
|
|
30
|
-
setSummary: (_subtitle) =>
|
|
74
|
+
setVisible: (_state) => void 0,
|
|
75
|
+
setTitle: (_title) => void 0,
|
|
76
|
+
setSummary: (_subtitle) => void 0,
|
|
31
77
|
},
|
|
32
78
|
legacyFormatScreenData: {} as LegacyNavigationScreenData,
|
|
33
79
|
});
|
|
@@ -53,9 +99,30 @@ export function ScreenContextProvider({
|
|
|
53
99
|
const isNested = useNestedNavigationContext();
|
|
54
100
|
const currentScreenScreenData = useCurrentScreenData();
|
|
55
101
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
102
|
+
const screenNavBarStateRef =
|
|
103
|
+
useRef<null | ReturnType<typeof createStore>>(null);
|
|
104
|
+
|
|
105
|
+
const getScreenNavBarState = useCallback(() => {
|
|
106
|
+
if (screenNavBarStateRef.current !== null) {
|
|
107
|
+
return screenNavBarStateRef.current;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const navBarState = createStore();
|
|
111
|
+
screenNavBarStateRef.current = navBarState;
|
|
112
|
+
|
|
113
|
+
return navBarState;
|
|
114
|
+
}, []);
|
|
115
|
+
|
|
116
|
+
const screenNavBarState = getScreenNavBarState()(
|
|
117
|
+
useShallow((state) => ({
|
|
118
|
+
visible: state.visible,
|
|
119
|
+
title: state.title,
|
|
120
|
+
summary: state.summary,
|
|
121
|
+
setTitle: state.setTitle,
|
|
122
|
+
setSummary: state.setSummary,
|
|
123
|
+
setVisible: state.setVisible,
|
|
124
|
+
}))
|
|
125
|
+
);
|
|
59
126
|
|
|
60
127
|
const isHook = pathname.includes("hook");
|
|
61
128
|
|
|
@@ -73,26 +140,28 @@ export function ScreenContextProvider({
|
|
|
73
140
|
const isVisible = isNavBarVisible(
|
|
74
141
|
pathname,
|
|
75
142
|
currentScreenScreenData, // what fallback should be if currentScreenData is not available?
|
|
76
|
-
|
|
143
|
+
screenNavBarState.visible,
|
|
77
144
|
canGoBack(isHook, pathname),
|
|
78
145
|
videoModalState
|
|
79
146
|
);
|
|
80
147
|
|
|
81
|
-
const navBarState = useMemo(
|
|
82
|
-
|
|
83
|
-
title:
|
|
84
|
-
summary:
|
|
148
|
+
const navBarState = useMemo(
|
|
149
|
+
() => ({
|
|
150
|
+
title: screenNavBarState.title,
|
|
151
|
+
summary: screenNavBarState.summary,
|
|
85
152
|
visible: isVisible,
|
|
86
|
-
setTitle:
|
|
87
|
-
setSummary:
|
|
88
|
-
setVisible:
|
|
89
|
-
}
|
|
90
|
-
|
|
153
|
+
setTitle: screenNavBarState.setTitle,
|
|
154
|
+
setSummary: screenNavBarState.setSummary,
|
|
155
|
+
setVisible: screenNavBarState.setVisible,
|
|
156
|
+
}),
|
|
157
|
+
[isVisible, screenNavBarState.title, screenNavBarState.summary]
|
|
158
|
+
);
|
|
91
159
|
|
|
92
160
|
return (
|
|
93
161
|
<ScreenContext.Provider
|
|
94
162
|
value={useMemo(
|
|
95
163
|
() => ({
|
|
164
|
+
_navBarStore: getScreenNavBarState(),
|
|
96
165
|
navBar: navBarState,
|
|
97
166
|
legacyFormatScreenData: routeScreenData,
|
|
98
167
|
}),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
3
|
+
|
|
4
|
+
export const ScreenDataContext = React.createContext<any>(null);
|
|
5
|
+
|
|
6
|
+
// Use this only to provide initial screenData context, before the Transitioner and Screen is rendered.
|
|
7
|
+
export const withScreenDataContextProvider = (Component: any) => {
|
|
8
|
+
return function ScreenDataContextProvider(props: any) {
|
|
9
|
+
const { activeRiver } = useNavigation();
|
|
10
|
+
|
|
11
|
+
// use only initial activeRiver as this context should only be used for "Home", initial route
|
|
12
|
+
const screenData = React.useMemo(() => ({ screen: activeRiver }), []);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<ScreenDataContext.Provider value={screenData}>
|
|
16
|
+
<Component {...props} />
|
|
17
|
+
</ScreenDataContext.Provider>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
};
|
package/events/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.3823240084",
|
|
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",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"redux-mock-store": "^1.5.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@applicaster/applicaster-types": "12.0.0-alpha.
|
|
38
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.
|
|
39
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.
|
|
40
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
37
|
+
"@applicaster/applicaster-types": "12.0.0-alpha.3823240084",
|
|
38
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.3823240084",
|
|
39
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.3823240084",
|
|
40
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.3823240084",
|
|
41
41
|
"promise": "^8.3.0",
|
|
42
42
|
"react-router-native": "^5.1.2",
|
|
43
43
|
"url": "^0.11.0",
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { useCurrentScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
|
|
4
|
-
import { ifEmptyUseFallback } from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
5
|
-
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
6
|
-
import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
7
|
-
import { Spinner } from "@applicaster/zapp-react-native-ui-components/Components/Spinner";
|
|
8
|
-
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
9
|
-
|
|
10
|
-
import { useScreenConfiguration } from "../../River/useScreenConfiguration";
|
|
11
|
-
|
|
12
|
-
const styles = StyleSheet.create({
|
|
13
|
-
container: {
|
|
14
|
-
position: "absolute",
|
|
15
|
-
top: 0,
|
|
16
|
-
left: 0,
|
|
17
|
-
right: 0,
|
|
18
|
-
bottom: 0,
|
|
19
|
-
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const TransitionOverlay = () => {
|
|
26
|
-
const screen = useCurrentScreenData();
|
|
27
|
-
|
|
28
|
-
const { backgroundColor: screenBackgroundColor } = useScreenConfiguration(
|
|
29
|
-
screen?.id
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const theme = useTheme();
|
|
33
|
-
|
|
34
|
-
const themeBackgroundColor = React.useMemo(
|
|
35
|
-
() => theme.app_background_color,
|
|
36
|
-
[theme.app_background_color]
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const backgroundColor = ifEmptyUseFallback(
|
|
40
|
-
screenBackgroundColor,
|
|
41
|
-
themeBackgroundColor
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const {
|
|
45
|
-
appState: { isTransitioning },
|
|
46
|
-
} = usePickFromState(["appState"]);
|
|
47
|
-
|
|
48
|
-
if (!isWeb() || !isTransitioning) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<View
|
|
54
|
-
style={[
|
|
55
|
-
styles.container,
|
|
56
|
-
{
|
|
57
|
-
backgroundColor,
|
|
58
|
-
},
|
|
59
|
-
]}
|
|
60
|
-
>
|
|
61
|
-
<Spinner size={"large"} />
|
|
62
|
-
</View>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|