@applicaster/zapp-react-native-ui-components 13.0.0-rc.99 → 13.0.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/Components/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/tv/Artwork.tsx +41 -0
- package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
- package/Components/AudioPlayer/tv/Layout.tsx +166 -0
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +9 -2
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +17 -10
- package/Components/AudioPlayer/tv/Title.tsx +46 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +4 -4
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +9 -4
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +2 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +2 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +3 -6
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +17 -67
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +3 -0
- package/Components/GeneralContentScreen/utils/useCurationAPI.ts +4 -2
- package/Components/GeneralContentScreen/utils/useEventAlerts.ts +30 -0
- package/Components/ModalComponent/BottomSheetModalContent.tsx +32 -46
- package/Components/ModalComponent/Button/index.tsx +25 -29
- package/Components/ModalComponent/Header/index.tsx +9 -8
- package/Components/PlayerContainer/PlayerContainer.tsx +31 -41
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +7 -3
- package/Components/River/RiverItem.tsx +8 -4
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +1 -1
- package/Components/RouteManager/TestId.tsx +1 -5
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +0 -1
- package/Components/RouteManager/__tests__/testId.test.js +0 -4
- package/Components/Screen/TV/__tests__/index.web.test.tsx +26 -0
- package/Components/Screen/__tests__/Screen.test.tsx +22 -14
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +2 -2
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +1 -2
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +1 -0
- package/Components/VideoModal/ModalAnimation/utils.ts +3 -9
- package/Components/VideoModal/PlayerWrapper.tsx +9 -19
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +60 -0
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +17 -55
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +15 -26
- package/package.json +5 -5
- package/Components/AudioPlayer/Artwork.tsx +0 -35
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -203
- package/Components/AudioPlayer/Title.tsx +0 -39
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
- package/Components/AudioPlayer/index.ts +0 -1
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
|
@@ -71,6 +71,36 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
71
71
|
}
|
|
72
72
|
testID="test-player-container"
|
|
73
73
|
/>
|
|
74
|
+
<View
|
|
75
|
+
animationType="componentFade"
|
|
76
|
+
style={
|
|
77
|
+
{
|
|
78
|
+
"flex": 1,
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
<View
|
|
83
|
+
configuration={
|
|
84
|
+
{
|
|
85
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
86
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
entry={
|
|
90
|
+
{
|
|
91
|
+
"id": "test",
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
isTablet={false}
|
|
95
|
+
isTabletLandscape={false}
|
|
96
|
+
style={
|
|
97
|
+
{
|
|
98
|
+
"flex": 1,
|
|
99
|
+
"paddingTop": 20,
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/>
|
|
103
|
+
</View>
|
|
74
104
|
</View>
|
|
75
105
|
</RNCSafeAreaView>
|
|
76
106
|
</RNCSafeAreaProvider>
|
|
@@ -239,6 +269,36 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
239
269
|
}
|
|
240
270
|
/>
|
|
241
271
|
</View>
|
|
272
|
+
<View
|
|
273
|
+
animationType="componentFade"
|
|
274
|
+
style={
|
|
275
|
+
{
|
|
276
|
+
"flex": 1,
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
>
|
|
280
|
+
<View
|
|
281
|
+
configuration={
|
|
282
|
+
{
|
|
283
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
284
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
entry={
|
|
288
|
+
{
|
|
289
|
+
"id": "test",
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
isTablet={true}
|
|
293
|
+
isTabletLandscape={true}
|
|
294
|
+
style={
|
|
295
|
+
{
|
|
296
|
+
"flex": 1,
|
|
297
|
+
"paddingTop": 20,
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/>
|
|
301
|
+
</View>
|
|
242
302
|
</View>
|
|
243
303
|
</RNCSafeAreaView>
|
|
244
304
|
</RNCSafeAreaProvider>
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { renderHook } from "@testing-library/react-hooks";
|
|
2
2
|
import { useDelayedPlayerDetails } from "../useDelayedPlayerDetails";
|
|
3
|
-
import { withTimeout$ } from "@applicaster/zapp-react-native-utils/idleUtils";
|
|
4
|
-
import { showDetails } from "../utils";
|
|
5
3
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
6
4
|
|
|
7
|
-
jest.mock("@applicaster/zapp-react-native-utils/idleUtils", () => ({
|
|
8
|
-
withTimeout$: jest.fn(),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
|
-
jest.mock("../utils", () => ({
|
|
12
|
-
showDetails: jest.fn(),
|
|
13
|
-
}));
|
|
14
|
-
|
|
15
5
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks", () => ({
|
|
16
|
-
useIsTablet: jest.fn(),
|
|
6
|
+
useIsTablet: jest.fn().mockReturnValue(false),
|
|
17
7
|
}));
|
|
18
8
|
|
|
19
9
|
describe("useDelayedPlayerDetails", () => {
|
|
@@ -21,69 +11,41 @@ describe("useDelayedPlayerDetails", () => {
|
|
|
21
11
|
jest.clearAllMocks();
|
|
22
12
|
});
|
|
23
13
|
|
|
24
|
-
it("should return
|
|
25
|
-
(withTimeout$ as jest.Mock).mockReturnValue({
|
|
26
|
-
subscribe: jest.fn().mockReturnValue({ unsubscribe: jest.fn() }),
|
|
27
|
-
});
|
|
28
|
-
|
|
14
|
+
it("should return true initially", () => {
|
|
29
15
|
const { result } = renderHook(() =>
|
|
30
16
|
useDelayedPlayerDetails({ isInline: true, isDocked: false, isPip: false })
|
|
31
17
|
);
|
|
32
18
|
|
|
33
|
-
expect(result.current).toBe(
|
|
19
|
+
expect(result.current).toBe(true);
|
|
34
20
|
});
|
|
35
21
|
|
|
36
|
-
it("should return
|
|
37
|
-
(withTimeout$ as jest.Mock).mockReturnValue({
|
|
38
|
-
subscribe: (callback) => {
|
|
39
|
-
callback.next();
|
|
40
|
-
|
|
41
|
-
return { unsubscribe: jest.fn() };
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
(showDetails as jest.Mock).mockReturnValue(true);
|
|
46
|
-
(useIsTablet as jest.Mock).mockReturnValue(false);
|
|
47
|
-
|
|
22
|
+
it("should return false when isPip is true", () => {
|
|
48
23
|
const { result } = renderHook(() =>
|
|
49
|
-
useDelayedPlayerDetails({ isInline: true, isDocked:
|
|
24
|
+
useDelayedPlayerDetails({ isInline: true, isDocked: true, isPip: true })
|
|
50
25
|
);
|
|
51
26
|
|
|
52
|
-
expect(result.current).toBe(
|
|
27
|
+
expect(result.current).toBe(false);
|
|
53
28
|
});
|
|
54
29
|
|
|
55
|
-
it("should return false
|
|
56
|
-
(withTimeout$ as jest.Mock).mockReturnValue({
|
|
57
|
-
subscribe: (callback) => {
|
|
58
|
-
callback.next();
|
|
59
|
-
|
|
60
|
-
return { unsubscribe: jest.fn() };
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
(showDetails as jest.Mock).mockReturnValue(false);
|
|
65
|
-
(useIsTablet as jest.Mock).mockReturnValue(false);
|
|
66
|
-
|
|
30
|
+
it("should return false when isDocked is true", () => {
|
|
67
31
|
const { result } = renderHook(() =>
|
|
68
|
-
useDelayedPlayerDetails({ isInline: true, isDocked:
|
|
32
|
+
useDelayedPlayerDetails({ isInline: true, isDocked: true, isPip: false })
|
|
69
33
|
);
|
|
70
34
|
|
|
71
35
|
expect(result.current).toBe(false);
|
|
72
36
|
});
|
|
73
37
|
|
|
74
|
-
it("should
|
|
75
|
-
|
|
38
|
+
it("should return true for tablet regardless of other flags", () => {
|
|
39
|
+
(useIsTablet as jest.Mock).mockReturnValue(true);
|
|
76
40
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
41
|
+
const { result } = renderHook(() =>
|
|
42
|
+
useDelayedPlayerDetails({
|
|
43
|
+
isInline: false,
|
|
44
|
+
isDocked: false,
|
|
45
|
+
isPip: false,
|
|
46
|
+
})
|
|
83
47
|
);
|
|
84
48
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
expect(unsubscribeMock).toHaveBeenCalled();
|
|
49
|
+
expect(result.current).toBe(true);
|
|
88
50
|
});
|
|
89
51
|
});
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
3
|
-
import { withTimeout$ } from "@applicaster/zapp-react-native-utils/idleUtils";
|
|
4
2
|
|
|
5
3
|
import { showDetails } from "./utils";
|
|
6
4
|
|
|
7
|
-
const TIMEOUT = 100; // ms
|
|
8
|
-
|
|
9
5
|
type Props = { isInline: boolean; isDocked: boolean; isPip: boolean };
|
|
10
6
|
|
|
7
|
+
const showPlayerDetails = (
|
|
8
|
+
isInline: boolean,
|
|
9
|
+
isDocked: boolean,
|
|
10
|
+
isPip: boolean,
|
|
11
|
+
isTablet: boolean
|
|
12
|
+
) => {
|
|
13
|
+
return showDetails({
|
|
14
|
+
isMobile: !isTablet,
|
|
15
|
+
isInline,
|
|
16
|
+
isDocked,
|
|
17
|
+
isPip,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
11
21
|
/**
|
|
12
22
|
* Custom hook to determine whether to show player details with a delay.
|
|
13
23
|
*
|
|
@@ -22,28 +32,7 @@ export const useDelayedPlayerDetails = ({
|
|
|
22
32
|
isDocked,
|
|
23
33
|
isPip,
|
|
24
34
|
}: Props): boolean => {
|
|
25
|
-
const [shouldShowDetails, setShouldShowDetails] = React.useState(false);
|
|
26
|
-
|
|
27
35
|
const isTablet = useIsTablet();
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
const subscription = withTimeout$(TIMEOUT).subscribe({
|
|
31
|
-
next: () => {
|
|
32
|
-
setShouldShowDetails(() => {
|
|
33
|
-
return showDetails({
|
|
34
|
-
isMobile: !isTablet,
|
|
35
|
-
isInline,
|
|
36
|
-
isDocked,
|
|
37
|
-
isPip,
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return () => {
|
|
44
|
-
subscription.unsubscribe();
|
|
45
|
-
};
|
|
46
|
-
}, [isDocked, isTablet, isInline, isPip]);
|
|
47
|
-
|
|
48
|
-
return shouldShowDetails;
|
|
37
|
+
return showPlayerDetails(isInline, isDocked, isPip, isTablet);
|
|
49
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "13.0.0
|
|
3
|
+
"version": "13.0.0",
|
|
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",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"redux-mock-store": "^1.5.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@applicaster/applicaster-types": "13.0.0
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "13.0.0
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "13.0.0
|
|
34
|
+
"@applicaster/applicaster-types": "13.0.0",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "13.0.0",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "13.0.0",
|
|
38
38
|
"promise": "^8.3.0",
|
|
39
39
|
"react-router-native": "^5.1.2",
|
|
40
40
|
"url": "^0.11.0",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, Image } from "react-native";
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
srcImage: string;
|
|
6
|
-
config?: {
|
|
7
|
-
titleColor: string;
|
|
8
|
-
summaryColor: string;
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
backgroundImage: string;
|
|
11
|
-
isRTL: boolean;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const containerStyles = {
|
|
16
|
-
marginHorizontal: 24,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const imageStyles = {
|
|
20
|
-
width: 400,
|
|
21
|
-
height: 400,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export function Artwork({ srcImage }: Props) {
|
|
25
|
-
return (
|
|
26
|
-
<View style={containerStyles}>
|
|
27
|
-
<Image
|
|
28
|
-
fadeDuration={0}
|
|
29
|
-
source={{ uri: srcImage }}
|
|
30
|
-
style={imageStyles}
|
|
31
|
-
resizeMode="cover"
|
|
32
|
-
/>
|
|
33
|
-
</View>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
2
|
-
import { View, ImageBackground, Animated, ViewStyle } from "react-native";
|
|
3
|
-
|
|
4
|
-
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
5
|
-
|
|
6
|
-
import { Artwork } from "./Artwork";
|
|
7
|
-
import { directionStyles } from "./helpers";
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
artwork?: string;
|
|
11
|
-
config: {
|
|
12
|
-
titleColor: string;
|
|
13
|
-
summaryColor: string;
|
|
14
|
-
backgroundColor: string;
|
|
15
|
-
backgroundImage: string;
|
|
16
|
-
isRTL: boolean;
|
|
17
|
-
};
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
style: ViewStyle;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
|
|
23
|
-
const fadeAnimation = useRef(new Animated.Value(0)).current;
|
|
24
|
-
|
|
25
|
-
const fadeAudioPlayerIn = () => {
|
|
26
|
-
Animated.timing(fadeAnimation, {
|
|
27
|
-
toValue: 1,
|
|
28
|
-
duration: 3000,
|
|
29
|
-
useNativeDriver: true,
|
|
30
|
-
}).start();
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const { isRTL, backgroundColor, backgroundImage } = config;
|
|
34
|
-
|
|
35
|
-
const backgroundImg = { uri: backgroundImage };
|
|
36
|
-
|
|
37
|
-
const backgroundColorStyle = backgroundImage
|
|
38
|
-
? "transparent"
|
|
39
|
-
: backgroundColor;
|
|
40
|
-
|
|
41
|
-
const mainContainerStyles = platformSelect({
|
|
42
|
-
tvos: {
|
|
43
|
-
width: 1920,
|
|
44
|
-
height: 1080,
|
|
45
|
-
alignItems: "center",
|
|
46
|
-
justifyContent: "center",
|
|
47
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
48
|
-
backgroundColor: backgroundColorStyle,
|
|
49
|
-
},
|
|
50
|
-
android_tv: {
|
|
51
|
-
position: "absolute",
|
|
52
|
-
width: 1920,
|
|
53
|
-
height: 1080,
|
|
54
|
-
alignItems: "center",
|
|
55
|
-
justifyContent: "center",
|
|
56
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
57
|
-
backgroundColor: backgroundColorStyle,
|
|
58
|
-
},
|
|
59
|
-
web: {
|
|
60
|
-
width: 1920,
|
|
61
|
-
height: 1080,
|
|
62
|
-
alignItems: "center",
|
|
63
|
-
justifyContent: "center",
|
|
64
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
65
|
-
backgroundColor: backgroundColorStyle,
|
|
66
|
-
},
|
|
67
|
-
native: {
|
|
68
|
-
backgroundColor: backgroundColorStyle,
|
|
69
|
-
overflow: "hidden",
|
|
70
|
-
...style,
|
|
71
|
-
},
|
|
72
|
-
samsung_tv: {
|
|
73
|
-
position: "absolute",
|
|
74
|
-
margin: "auto",
|
|
75
|
-
display: "flex",
|
|
76
|
-
flexWrap: "wrap",
|
|
77
|
-
width: "100vw",
|
|
78
|
-
flex: 1,
|
|
79
|
-
alignItems: "center",
|
|
80
|
-
justifyContent: "center",
|
|
81
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
82
|
-
backgroundColor: backgroundColorStyle,
|
|
83
|
-
},
|
|
84
|
-
lg_tv: {
|
|
85
|
-
position: "absolute",
|
|
86
|
-
margin: "auto",
|
|
87
|
-
display: "flex",
|
|
88
|
-
flexWrap: "wrap",
|
|
89
|
-
width: "100vw",
|
|
90
|
-
flex: 1,
|
|
91
|
-
alignItems: "center",
|
|
92
|
-
justifyContent: "center",
|
|
93
|
-
flexDirection: directionStyles(isRTL).flexDirection,
|
|
94
|
-
backgroundColor: backgroundColorStyle,
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const backgroundImgStyles = platformSelect({
|
|
99
|
-
tvos: {
|
|
100
|
-
width: 1920,
|
|
101
|
-
height: 1080,
|
|
102
|
-
alignItems: "center",
|
|
103
|
-
justifyContent: "center",
|
|
104
|
-
},
|
|
105
|
-
android_tv: {
|
|
106
|
-
position: "absolute",
|
|
107
|
-
width: 1920,
|
|
108
|
-
height: 1080,
|
|
109
|
-
alignItems: "center",
|
|
110
|
-
justifyContent: "center",
|
|
111
|
-
},
|
|
112
|
-
web: {
|
|
113
|
-
position: "absolute",
|
|
114
|
-
margin: "auto",
|
|
115
|
-
display: "flex",
|
|
116
|
-
flexWrap: "wrap",
|
|
117
|
-
width: "100%",
|
|
118
|
-
height: "100%",
|
|
119
|
-
flex: 1,
|
|
120
|
-
alignItems: "center",
|
|
121
|
-
justifyContent: "center",
|
|
122
|
-
},
|
|
123
|
-
native: {
|
|
124
|
-
flex: 1,
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
const textContainerStyles = platformSelect({
|
|
129
|
-
tvos: {
|
|
130
|
-
width: 600,
|
|
131
|
-
height: 362,
|
|
132
|
-
marginHorizontal: 24,
|
|
133
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
134
|
-
},
|
|
135
|
-
android_tv: {
|
|
136
|
-
width: 600,
|
|
137
|
-
height: 362,
|
|
138
|
-
marginHorizontal: 24,
|
|
139
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
140
|
-
},
|
|
141
|
-
web: {
|
|
142
|
-
margin: 10,
|
|
143
|
-
height: "100vh",
|
|
144
|
-
alignItems: directionStyles(isRTL).justifyContent,
|
|
145
|
-
justifyContent: "center",
|
|
146
|
-
},
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
const audioPlayerLayoutTV = backgroundImg?.uri ? (
|
|
150
|
-
<ImageBackground
|
|
151
|
-
source={backgroundImg}
|
|
152
|
-
style={backgroundImgStyles}
|
|
153
|
-
resizeMode="cover"
|
|
154
|
-
>
|
|
155
|
-
<View style={mainContainerStyles}>
|
|
156
|
-
{!!artwork && <Artwork srcImage={artwork} config={config} />}
|
|
157
|
-
<View style={textContainerStyles}>{children}</View>
|
|
158
|
-
</View>
|
|
159
|
-
</ImageBackground>
|
|
160
|
-
) : (
|
|
161
|
-
<View style={mainContainerStyles}>
|
|
162
|
-
{!!artwork && <Artwork srcImage={artwork} config={config} />}
|
|
163
|
-
<View style={textContainerStyles}>{children}</View>
|
|
164
|
-
</View>
|
|
165
|
-
);
|
|
166
|
-
|
|
167
|
-
const audioPlayerLayoutMobile = () => {
|
|
168
|
-
fadeAudioPlayerIn();
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<View style={mainContainerStyles} pointerEvents="none">
|
|
172
|
-
<Animated.View
|
|
173
|
-
style={[
|
|
174
|
-
mainContainerStyles,
|
|
175
|
-
{
|
|
176
|
-
opacity: fadeAnimation,
|
|
177
|
-
},
|
|
178
|
-
]}
|
|
179
|
-
>
|
|
180
|
-
<ImageBackground
|
|
181
|
-
source={backgroundImg}
|
|
182
|
-
style={backgroundImgStyles}
|
|
183
|
-
resizeMode="cover"
|
|
184
|
-
>
|
|
185
|
-
<View style={mainContainerStyles} />
|
|
186
|
-
</ImageBackground>
|
|
187
|
-
</Animated.View>
|
|
188
|
-
</View>
|
|
189
|
-
);
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
const audioPlayerLayout = platformSelect({
|
|
193
|
-
tvos: audioPlayerLayoutTV,
|
|
194
|
-
android_tv: audioPlayerLayoutTV,
|
|
195
|
-
web: audioPlayerLayoutTV,
|
|
196
|
-
samsung_tv: audioPlayerLayoutTV,
|
|
197
|
-
lg_tv: audioPlayerLayoutTV,
|
|
198
|
-
ios: audioPlayerLayoutMobile(),
|
|
199
|
-
android: audioPlayerLayoutMobile(),
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
return audioPlayerLayout;
|
|
203
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, Text, TextStyle } from "react-native";
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
config: {
|
|
6
|
-
titleColor: string;
|
|
7
|
-
summaryColor: string;
|
|
8
|
-
backgroundColor: string;
|
|
9
|
-
backgroundImage: string;
|
|
10
|
-
isRTL: boolean;
|
|
11
|
-
titleFontFamily: string;
|
|
12
|
-
titleFontSize: number;
|
|
13
|
-
};
|
|
14
|
-
title: string | number;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const containerStyles = {
|
|
18
|
-
width: 600,
|
|
19
|
-
height: 100,
|
|
20
|
-
marginBottom: 12,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const textStyles = ({ titleColor, isRTL, titleFontFamily, titleFontSize }) => ({
|
|
24
|
-
textAlign: (isRTL ? "left" : "right") as TextStyle["textAlign"],
|
|
25
|
-
fontSize: titleFontSize ? Number(titleFontSize) : 38,
|
|
26
|
-
fontWeight: "600" as TextStyle["fontWeight"],
|
|
27
|
-
color: titleColor,
|
|
28
|
-
fontFamily: titleFontFamily || null,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export function Title({ title, config }: Props) {
|
|
32
|
-
return (
|
|
33
|
-
<View style={containerStyles}>
|
|
34
|
-
<Text style={textStyles(config)} numberOfLines={2}>
|
|
35
|
-
{title}
|
|
36
|
-
</Text>
|
|
37
|
-
</View>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<AudioPlayerLayout /> renders correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
pointerEvents="none"
|
|
6
|
-
style={
|
|
7
|
-
{
|
|
8
|
-
"backgroundColor": "transparent",
|
|
9
|
-
"overflow": "hidden",
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
>
|
|
13
|
-
<View
|
|
14
|
-
collapsable={false}
|
|
15
|
-
style={
|
|
16
|
-
{
|
|
17
|
-
"backgroundColor": "transparent",
|
|
18
|
-
"opacity": 0,
|
|
19
|
-
"overflow": "hidden",
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
>
|
|
23
|
-
<View
|
|
24
|
-
accessibilityIgnoresInvertColors={true}
|
|
25
|
-
style={
|
|
26
|
-
{
|
|
27
|
-
"flex": 1,
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
>
|
|
31
|
-
<Image
|
|
32
|
-
resizeMode="cover"
|
|
33
|
-
source={
|
|
34
|
-
{
|
|
35
|
-
"uri": "https://example.com",
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
style={
|
|
39
|
-
[
|
|
40
|
-
{
|
|
41
|
-
"bottom": 0,
|
|
42
|
-
"left": 0,
|
|
43
|
-
"position": "absolute",
|
|
44
|
-
"right": 0,
|
|
45
|
-
"top": 0,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"height": undefined,
|
|
49
|
-
"width": undefined,
|
|
50
|
-
},
|
|
51
|
-
undefined,
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
/>
|
|
55
|
-
<View
|
|
56
|
-
style={
|
|
57
|
-
{
|
|
58
|
-
"backgroundColor": "transparent",
|
|
59
|
-
"overflow": "hidden",
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/>
|
|
63
|
-
</View>
|
|
64
|
-
</View>
|
|
65
|
-
</View>
|
|
66
|
-
`;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<Channel /> renders correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
{
|
|
7
|
-
"height": 72,
|
|
8
|
-
"marginBottom": 30,
|
|
9
|
-
"width": 128,
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
>
|
|
13
|
-
<Image
|
|
14
|
-
fadeDuration={0}
|
|
15
|
-
source={
|
|
16
|
-
{
|
|
17
|
-
"uri": "https://example.com",
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
style={
|
|
21
|
-
{
|
|
22
|
-
"height": 72,
|
|
23
|
-
"width": 128,
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/>
|
|
27
|
-
</View>
|
|
28
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@testing-library/react-native";
|
|
3
|
-
|
|
4
|
-
import { AudioPlayerLayout } from "../AudioPlayerLayout";
|
|
5
|
-
|
|
6
|
-
const audioPlayerLayoutProps = {
|
|
7
|
-
artwork: "string",
|
|
8
|
-
config: {
|
|
9
|
-
titleColor: "white",
|
|
10
|
-
summaryColor: "white",
|
|
11
|
-
backgroundColor: "black",
|
|
12
|
-
backgroundImage: "https://example.com",
|
|
13
|
-
isRTL: true,
|
|
14
|
-
},
|
|
15
|
-
children: [],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
describe("<AudioPlayerLayout />", () => {
|
|
19
|
-
it("renders correctly", () => {
|
|
20
|
-
const { toJSON } = render(
|
|
21
|
-
<AudioPlayerLayout {...audioPlayerLayoutProps} />
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
expect(toJSON()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AudioPlayer } from "./AudioPlayer";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|