@applicaster/zapp-react-native-ui-components 15.1.6-alpha.2015591222 → 15.1.6
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/ModalComponent/AudioPlayer/Components/Action.tsx +69 -33
- package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +47 -25
- package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +39 -122
- package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +131 -299
- package/Components/ModalComponent/AudioPlayer/Components/index.ts +4 -8
- package/Components/ModalComponent/BottomSheetModalContent.tsx +55 -290
- package/Components/ModalComponent/Button/index.tsx +3 -5
- package/Components/ModalComponent/Header/utils.ts +1 -1
- package/Components/ModalComponent/index.tsx +0 -11
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +13 -82
- package/Components/OfflineHandler/__tests__/index.test.tsx +100 -35
- package/Components/OfflineHandler/hooks.ts +123 -0
- package/Components/OfflineHandler/index.tsx +51 -73
- package/Components/OfflineHandler/utils/index.ts +1 -13
- package/package.json +5 -6
- package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +0 -671
- package/Components/ModalComponent/AudioPlayer/Components/NowPlayingHeaderSection.tsx +0 -86
- package/Components/ModalComponent/SortableList.tsx +0 -142
- package/Components/ModalComponent/TextInputContent.tsx +0 -100
- package/Components/ModalComponent/__tests__/BottomSheetModalContent.test.tsx +0 -183
- package/Components/ModalComponent/__tests__/TextInputContent.test.tsx +0 -128
- package/Components/ModalComponent/__tests__/showTextInput.test.ts +0 -95
- package/Components/ModalComponent/presets/__tests__/getCell.test.ts +0 -66
- package/Components/ModalComponent/presets/dynamicCollectionCell.tsx +0 -74
- package/Components/ModalComponent/presets/index.ts +0 -27
- package/Components/ModalComponent/presets/selectableCell.tsx +0 -27
- package/Components/ModalComponent/presets/standardCell.tsx +0 -41
- package/Components/ModalComponent/presets/types.ts +0 -35
- package/Components/ModalComponent/showTextInput.ts +0 -43
- package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +0 -112
- package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +0 -107
- package/Components/OfflineHandler/NotificationView/NotificationView.tsx +0 -153
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -67
- package/Components/OfflineHandler/NotificationView/utils.ts +0 -34
|
@@ -1,65 +1,130 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Text } from "react-native";
|
|
3
|
+
import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils";
|
|
4
|
+
import { subscriberFor } from "@applicaster/zapp-react-native-utils/reactHooks/useSubscriberFor";
|
|
3
5
|
|
|
4
6
|
jest.useFakeTimers({ legacyFakeTimers: true });
|
|
5
7
|
|
|
8
|
+
// `isOnline` (@applicaster/quick-brick-core/App/NetworkStatusProvider/utils)
|
|
9
|
+
// only treats connectionInfo as "ready" when it has NetInfoState-shaped
|
|
10
|
+
// isConnected/isInternetReachable/details fields, so the mock has to mirror
|
|
11
|
+
// that shape for online/offline to actually be distinguishable.
|
|
6
12
|
let mockConnectionStatus = false;
|
|
7
|
-
const mockPreviousValue = null;
|
|
8
13
|
|
|
9
14
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/connection", () => {
|
|
10
15
|
return {
|
|
11
|
-
|
|
16
|
+
...jest.requireActual(
|
|
17
|
+
"@applicaster/zapp-react-native-utils/reactHooks/connection"
|
|
18
|
+
),
|
|
19
|
+
useConnectionInfo: jest.fn(() => ({
|
|
20
|
+
details: {},
|
|
21
|
+
isConnected: mockConnectionStatus,
|
|
22
|
+
isInternetReachable: mockConnectionStatus,
|
|
23
|
+
})),
|
|
12
24
|
};
|
|
13
25
|
});
|
|
14
26
|
|
|
15
|
-
jest.mock("@applicaster/zapp-react-native-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
useOfflineExperienceConfiguration: () => ({
|
|
31
|
-
configurationFields: {},
|
|
32
|
-
localizations: {
|
|
33
|
-
offline_toast_message: "No internet connection",
|
|
34
|
-
online_toast_message: "You are back online",
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
27
|
+
jest.mock("@applicaster/zapp-react-native-redux", () => ({
|
|
28
|
+
...jest.requireActual("@applicaster/zapp-react-native-redux"),
|
|
29
|
+
usePlugins: () => [
|
|
30
|
+
{
|
|
31
|
+
name: "offline experience",
|
|
32
|
+
identifier: "offline-experience",
|
|
33
|
+
type: "general",
|
|
34
|
+
module: {
|
|
35
|
+
useOfflineExperienceConfiguration: () => ({
|
|
36
|
+
configurationFields: {},
|
|
37
|
+
localizations: {
|
|
38
|
+
offline_toast_message: "No internet connection",
|
|
39
|
+
online_toast_message: "You are back online",
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
38
42
|
},
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
},
|
|
44
|
+
],
|
|
41
45
|
}));
|
|
42
46
|
|
|
43
47
|
jest.mock("react-native-safe-area-context", () => ({
|
|
48
|
+
...jest.requireActual("react-native-safe-area-context"),
|
|
44
49
|
useSafeAreaInsets: () => ({ top: 44 }),
|
|
45
50
|
}));
|
|
46
51
|
|
|
47
52
|
describe("OfflineHandler", () => {
|
|
48
|
-
const { OfflineHandler
|
|
53
|
+
const { OfflineHandler } = require("../");
|
|
54
|
+
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
mockConnectionStatus = false;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("renders its children without wrapping them in a notification view", () => {
|
|
60
|
+
const { toJSON } = renderWithProviders(
|
|
61
|
+
<OfflineHandler>
|
|
62
|
+
<Text>child content</Text>
|
|
63
|
+
</OfflineHandler>
|
|
64
|
+
);
|
|
49
65
|
|
|
50
|
-
it("renders", () => {
|
|
51
|
-
const { toJSON } = render(<OfflineHandler />);
|
|
52
66
|
expect(toJSON()).toMatchSnapshot();
|
|
53
67
|
});
|
|
54
68
|
|
|
55
|
-
it("
|
|
69
|
+
it("emits a showToast event on mount when the device starts offline", () => {
|
|
70
|
+
mockConnectionStatus = false;
|
|
71
|
+
|
|
72
|
+
const handleShowToast = jest.fn();
|
|
73
|
+
const unsubscribe = subscriberFor("showToast", handleShowToast);
|
|
74
|
+
|
|
75
|
+
renderWithProviders(<OfflineHandler />);
|
|
76
|
+
|
|
77
|
+
expect(handleShowToast).toHaveBeenCalledWith(
|
|
78
|
+
expect.objectContaining({
|
|
79
|
+
id: "offline-status",
|
|
80
|
+
message: "No internet connection",
|
|
81
|
+
timeout: 5000,
|
|
82
|
+
}),
|
|
83
|
+
// the shared event bus appends a dispose fn as the last handler arg
|
|
84
|
+
expect.any(Function)
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
unsubscribe();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("does not emit a showToast event on mount when the device starts online", () => {
|
|
56
91
|
mockConnectionStatus = true;
|
|
57
92
|
|
|
58
|
-
const
|
|
93
|
+
const handleShowToast = jest.fn();
|
|
94
|
+
const unsubscribe = subscriberFor("showToast", handleShowToast);
|
|
95
|
+
|
|
96
|
+
renderWithProviders(<OfflineHandler />);
|
|
97
|
+
|
|
98
|
+
expect(handleShowToast).not.toHaveBeenCalled();
|
|
99
|
+
|
|
100
|
+
unsubscribe();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("emits a showToast event when the device comes back online", () => {
|
|
104
|
+
mockConnectionStatus = false;
|
|
59
105
|
|
|
106
|
+
const handleShowToast = jest.fn();
|
|
107
|
+
const unsubscribe = subscriberFor("showToast", handleShowToast);
|
|
108
|
+
|
|
109
|
+
const { rerender } = renderWithProviders(<OfflineHandler />);
|
|
110
|
+
|
|
111
|
+
// ignore the offline toast emitted on mount; we only care about the
|
|
112
|
+
// offline -> online transition here
|
|
113
|
+
handleShowToast.mockClear();
|
|
114
|
+
|
|
115
|
+
mockConnectionStatus = true;
|
|
60
116
|
rerender(<OfflineHandler />);
|
|
61
117
|
|
|
62
|
-
|
|
63
|
-
|
|
118
|
+
expect(handleShowToast).toHaveBeenCalledWith(
|
|
119
|
+
expect.objectContaining({
|
|
120
|
+
id: "offline-status",
|
|
121
|
+
message: "You are back online",
|
|
122
|
+
timeout: 2000,
|
|
123
|
+
}),
|
|
124
|
+
// the shared event bus appends a dispose fn as the last handler arg
|
|
125
|
+
expect.any(Function)
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
unsubscribe();
|
|
64
129
|
});
|
|
65
130
|
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
isWeb,
|
|
5
|
+
platformSelect,
|
|
6
|
+
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
7
|
+
import { sessionStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/SessionStorage";
|
|
8
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
|
+
|
|
10
|
+
import { usePlugins } from "@applicaster/zapp-react-native-redux";
|
|
11
|
+
import { textTransform } from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
12
|
+
import { findPluginByIdentifier } from "@applicaster/zapp-react-native-utils/pluginUtils";
|
|
13
|
+
|
|
14
|
+
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
15
|
+
|
|
16
|
+
const OFFLINE_EXPERIENCE = "offline-experience";
|
|
17
|
+
|
|
18
|
+
const NETWORK_STATUS_LOCALIZATIONS_KEY = "network_status_localizations";
|
|
19
|
+
|
|
20
|
+
const THEME_STORAGE_NAMESPACE = "quick-brick-theme";
|
|
21
|
+
|
|
22
|
+
export const useNotificationHeight = () => {
|
|
23
|
+
const insets = useSafeAreaInsets();
|
|
24
|
+
|
|
25
|
+
const navBarHeight = platformSelect({ ios: 44, android: 56 });
|
|
26
|
+
|
|
27
|
+
const statusHeight = insets.top;
|
|
28
|
+
const notificationHeight = statusHeight + navBarHeight;
|
|
29
|
+
|
|
30
|
+
return { statusHeight, notificationHeight };
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function useNetworkStatusLocalizations() {
|
|
34
|
+
const [storedLocalizations, setStoredLocalizations] = React.useState<Record<
|
|
35
|
+
string,
|
|
36
|
+
string
|
|
37
|
+
> | null>(null);
|
|
38
|
+
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
async function loadStoredLocalizations() {
|
|
41
|
+
try {
|
|
42
|
+
const stored = await sessionStorage.getItem(
|
|
43
|
+
NETWORK_STATUS_LOCALIZATIONS_KEY,
|
|
44
|
+
THEME_STORAGE_NAMESPACE
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
if (stored) {
|
|
48
|
+
setStoredLocalizations(stored);
|
|
49
|
+
}
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error("Error loading network status localizations", error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
loadStoredLocalizations();
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
return storedLocalizations;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function useOfflineHandlerProps(online: boolean) {
|
|
62
|
+
const theme = useTheme<BaseThemePropertiesTV>();
|
|
63
|
+
const storedLocalizations = useNetworkStatusLocalizations();
|
|
64
|
+
const plugins = usePlugins();
|
|
65
|
+
const offlinePlugin = findPluginByIdentifier(OFFLINE_EXPERIENCE, plugins);
|
|
66
|
+
const { useOfflineExperienceConfiguration } = offlinePlugin?.module ?? {};
|
|
67
|
+
|
|
68
|
+
const {
|
|
69
|
+
configurationFields,
|
|
70
|
+
localizations,
|
|
71
|
+
}: {
|
|
72
|
+
configurationFields: OfflineExperiencePluginConfiguration;
|
|
73
|
+
localizations: OfflineExperienceLocalizations;
|
|
74
|
+
} = useOfflineExperienceConfiguration?.() ?? {};
|
|
75
|
+
|
|
76
|
+
let title, subtitle, style;
|
|
77
|
+
|
|
78
|
+
if (isWeb()) {
|
|
79
|
+
title = online
|
|
80
|
+
? (theme?.online_notification_title ??
|
|
81
|
+
storedLocalizations?.online_notification_title)
|
|
82
|
+
: (theme?.offline_notification_title ??
|
|
83
|
+
storedLocalizations?.offline_notification_title);
|
|
84
|
+
|
|
85
|
+
subtitle = online
|
|
86
|
+
? (theme?.online_notification_subtitle ??
|
|
87
|
+
storedLocalizations?.online_notification_subtitle)
|
|
88
|
+
: (theme?.offline_notification_subtitle ??
|
|
89
|
+
storedLocalizations?.offline_notification_subtitle);
|
|
90
|
+
} else {
|
|
91
|
+
title = textTransform(
|
|
92
|
+
configurationFields.offline_toast_message_text_transform,
|
|
93
|
+
online
|
|
94
|
+
? localizations.online_toast_message
|
|
95
|
+
: localizations.offline_toast_message
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
style = {
|
|
99
|
+
color: online
|
|
100
|
+
? configurationFields.offline_toast_message_online_font_color
|
|
101
|
+
: configurationFields.offline_toast_message_font_color,
|
|
102
|
+
backgroundColor: online
|
|
103
|
+
? configurationFields.offline_toast_online_background_color
|
|
104
|
+
: configurationFields.offline_toast_offline_background_color,
|
|
105
|
+
fontFamily: platformSelect({
|
|
106
|
+
ios: configurationFields.offline_toast_message_ios_font_family,
|
|
107
|
+
android: configurationFields.offline_toast_message_android_font_family,
|
|
108
|
+
}),
|
|
109
|
+
fontSize: configurationFields.offline_toast_message_font_size,
|
|
110
|
+
lineHeight: configurationFields.offline_toast_message_line_height,
|
|
111
|
+
letterSpacing: platformSelect({
|
|
112
|
+
ios: configurationFields.offline_toast_message_letter_spacing_ios,
|
|
113
|
+
android:
|
|
114
|
+
configurationFields.offline_toast_message_letter_spacing_android,
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return useMemo(
|
|
120
|
+
() => ({ message: title, extraMessage: subtitle, style }),
|
|
121
|
+
[title, subtitle, style]
|
|
122
|
+
);
|
|
123
|
+
}
|
|
@@ -1,105 +1,83 @@
|
|
|
1
|
-
import React, { useCallback, useEffect
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { NotificationView as NotificationViewNative } from "./NotificationView/NotificationView";
|
|
4
|
-
import { NotificationView as NotificationViewSamsung } from "./NotificationView/NotificationView.samsung";
|
|
5
|
-
import { NotificationView as NotificationViewLG } from "./NotificationView/NotificationView.lg";
|
|
6
|
-
|
|
1
|
+
import React, { useCallback, useEffect } from "react";
|
|
7
2
|
import { useConnectionInfo } from "@applicaster/zapp-react-native-utils/reactHooks/connection";
|
|
8
3
|
import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
|
|
9
|
-
import {
|
|
4
|
+
import { useSubscriberFor } from "@applicaster/zapp-react-native-utils/reactHooks/useSubscriberFor";
|
|
10
5
|
|
|
6
|
+
import { useOfflineHandlerProps } from "./hooks";
|
|
11
7
|
import { componentsLogger } from "../../Helpers/logger";
|
|
12
8
|
import { parseConnectionInfo } from "./utils";
|
|
13
9
|
|
|
14
10
|
const logger = componentsLogger.addSubsystem("OfflineHandler");
|
|
15
11
|
|
|
12
|
+
// mirrors NOTIFICATION_TOAST_EVENTS.SHOW_TOAST in
|
|
13
|
+
// @applicaster/quick-brick-core/App/NotificationToastRenderer/NotificationToastManager
|
|
14
|
+
// (kept as a literal here since this package must not depend on quick-brick-core)
|
|
15
|
+
const SHOW_TOAST_EVENT = "showToast";
|
|
16
|
+
const OFFLINE_STATUS_TOAST_ID = "offline-status";
|
|
17
|
+
|
|
16
18
|
type Props = {
|
|
17
19
|
children?: React.ReactElement<any>;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
|
-
const styles = StyleSheet.create({
|
|
21
|
-
container: {
|
|
22
|
-
flex: 1,
|
|
23
|
-
position: "relative",
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
22
|
const timers = {
|
|
28
23
|
goingOffline: 5000,
|
|
29
24
|
goingOnline: 2000,
|
|
30
25
|
};
|
|
31
26
|
|
|
32
|
-
export const NotificationView = platformSelect({
|
|
33
|
-
samsung_tv: NotificationViewSamsung,
|
|
34
|
-
lg_tv: NotificationViewLG,
|
|
35
|
-
default: NotificationViewNative,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
27
|
export const OfflineHandler = ({ children }: Props) => {
|
|
39
28
|
const connectionInfo = useConnectionInfo(false);
|
|
40
|
-
const { online
|
|
29
|
+
const { online } = parseConnectionInfo(connectionInfo);
|
|
30
|
+
const prevOnline = usePrevious(online);
|
|
41
31
|
|
|
42
|
-
const
|
|
43
|
-
const previousOnline: boolean = usePrevious(online);
|
|
44
|
-
const timer = useRef<NodeJS.Timeout | null>(null);
|
|
45
|
-
const initialRender = useRef(false);
|
|
32
|
+
const emitShowToast = useSubscriberFor(SHOW_TOAST_EVENT);
|
|
46
33
|
|
|
47
|
-
const
|
|
48
|
-
setHidden(true);
|
|
34
|
+
const { message, extraMessage, style } = useOfflineHandlerProps(online);
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
timer.current = null;
|
|
53
|
-
}
|
|
54
|
-
}, []);
|
|
36
|
+
const showOnlineToast = useCallback(() => {
|
|
37
|
+
logger.log("Device is back online, emit toast");
|
|
55
38
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
emitShowToast({
|
|
40
|
+
id: OFFLINE_STATUS_TOAST_ID,
|
|
41
|
+
message,
|
|
42
|
+
extraMessage,
|
|
43
|
+
style,
|
|
44
|
+
timeout: timers.goingOnline,
|
|
45
|
+
});
|
|
46
|
+
}, [emitShowToast, message, extraMessage, style]);
|
|
47
|
+
|
|
48
|
+
const showOfflineToast = useCallback(() => {
|
|
49
|
+
logger.log("Device went offline, emit toast");
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
emitShowToast({
|
|
52
|
+
id: OFFLINE_STATUS_TOAST_ID,
|
|
53
|
+
message,
|
|
54
|
+
extraMessage,
|
|
55
|
+
style,
|
|
56
|
+
timeout: timers.goingOffline,
|
|
57
|
+
});
|
|
58
|
+
}, [emitShowToast, message, extraMessage, style]);
|
|
63
59
|
|
|
64
60
|
useEffect(() => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
logger.log("Device went offline");
|
|
72
|
-
setTimer(() => setHidden(true), timers.goingOffline);
|
|
73
|
-
setHidden(false);
|
|
61
|
+
// On mount there is no previous state yet: only surface the offline toast
|
|
62
|
+
// for a device that starts offline. Don't announce "back online" for a
|
|
63
|
+
// device that was online to begin with.
|
|
64
|
+
if (prevOnline === undefined) {
|
|
65
|
+
if (!online) {
|
|
66
|
+
showOfflineToast();
|
|
74
67
|
}
|
|
75
68
|
|
|
76
|
-
|
|
77
|
-
logger.log("Device is back online");
|
|
78
|
-
setHidden(false);
|
|
79
|
-
setTimer(() => setHidden(true), timers.goingOnline);
|
|
80
|
-
}
|
|
81
|
-
} else {
|
|
82
|
-
initialRender.current = true;
|
|
69
|
+
return;
|
|
83
70
|
}
|
|
84
71
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
72
|
+
// On subsequent renders, only emit a toast when the online/offline state changes.
|
|
73
|
+
if (prevOnline !== online) {
|
|
74
|
+
if (!online) {
|
|
75
|
+
showOfflineToast();
|
|
76
|
+
} else {
|
|
77
|
+
showOnlineToast();
|
|
89
78
|
}
|
|
90
|
-
}
|
|
91
|
-
}, [
|
|
92
|
-
|
|
93
|
-
return
|
|
94
|
-
<View style={styles.container}>
|
|
95
|
-
<NotificationView
|
|
96
|
-
hidden={hidden}
|
|
97
|
-
online={online}
|
|
98
|
-
previousOnline={previousOnline}
|
|
99
|
-
dismiss={dismiss}
|
|
100
|
-
>
|
|
101
|
-
{children}
|
|
102
|
-
</NotificationView>
|
|
103
|
-
</View>
|
|
104
|
-
);
|
|
79
|
+
}
|
|
80
|
+
}, [online, prevOnline, showOfflineToast, showOnlineToast]);
|
|
81
|
+
|
|
82
|
+
return children;
|
|
105
83
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as R from "ramda";
|
|
2
|
-
|
|
3
2
|
import { NetInfoState } from "@react-native-community/netinfo";
|
|
4
3
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
5
4
|
import { isOnline as isOnlineUtils } from "@applicaster/quick-brick-core/App/NetworkStatusProvider/utils";
|
|
6
|
-
|
|
5
|
+
|
|
7
6
|
import { Platform } from "react-native";
|
|
8
7
|
|
|
9
8
|
type ConnectionInfo = NetInfoState & { deviceStatus: NetStatus };
|
|
@@ -51,14 +50,3 @@ export const parseConnectionInfo: typeof parseConnectionInfoForDefault =
|
|
|
51
50
|
samsung_tv: parseConnectionInfoForSamsung,
|
|
52
51
|
default: parseConnectionInfoForDefault,
|
|
53
52
|
});
|
|
54
|
-
|
|
55
|
-
export const useNotificationHeight = () => {
|
|
56
|
-
const insets = useSafeAreaInsets();
|
|
57
|
-
|
|
58
|
-
const navBarHeight = platformSelect({ ios: 44, android: 56 });
|
|
59
|
-
|
|
60
|
-
const statusHeight = insets.top;
|
|
61
|
-
const notificationHeight = statusHeight + navBarHeight;
|
|
62
|
-
|
|
63
|
-
return { statusHeight, notificationHeight };
|
|
64
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "15.1.6
|
|
3
|
+
"version": "15.1.6",
|
|
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,13 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "15.1.6
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "15.1.6
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "15.1.6
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "15.1.6
|
|
31
|
+
"@applicaster/applicaster-types": "15.1.6",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "15.1.6",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "15.1.6",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "15.1.6",
|
|
35
35
|
"fast-json-stable-stringify": "^2.1.0",
|
|
36
36
|
"promise": "^8.3.0",
|
|
37
|
-
"react-native-sortables": "1.7.1",
|
|
38
37
|
"url": "^0.11.0",
|
|
39
38
|
"uuid": "^3.3.2"
|
|
40
39
|
},
|