@applicaster/zapp-react-native-ui-components 14.0.0-alpha.1054425138 → 14.0.0-alpha.1216545755

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.
Files changed (50) hide show
  1. package/Components/AudioPlayer/index.tsx +15 -0
  2. package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
  3. package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
  4. package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
  5. package/Components/AudioPlayer/mobile/index.tsx +18 -0
  6. package/Components/AudioPlayer/tv/Artwork.tsx +40 -0
  7. package/Components/AudioPlayer/{AudioPlayerLayout.tsx → tv/Layout.tsx} +34 -75
  8. package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +2 -1
  9. package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +12 -9
  10. package/Components/AudioPlayer/{Title.tsx → tv/Title.tsx} +12 -9
  11. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +9 -4
  12. package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +170 -0
  13. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +1 -1
  14. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +1 -1
  15. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
  16. package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +3 -4
  17. package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +14 -59
  18. package/Components/AudioPlayer/types.ts +40 -0
  19. package/Components/GeneralContentScreen/GeneralContentScreen.tsx +0 -2
  20. package/Components/MasterCell/DefaultComponents/Text/index.tsx +1 -0
  21. package/Components/MasterCell/utils/behaviorProvider.ts +23 -10
  22. package/Components/MasterCell/utils/index.ts +12 -2
  23. package/Components/PlayerContainer/PlayerContainer.tsx +22 -39
  24. package/Components/PlayerImageBackground/index.tsx +1 -1
  25. package/Components/River/ComponentsMap/ComponentsMap.tsx +1 -5
  26. package/Components/River/RiverItem.tsx +8 -8
  27. package/Components/River/TV/River.tsx +0 -3
  28. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +0 -6
  29. package/Components/TopMarginApplicator/TopMarginApplicator.tsx +16 -15
  30. package/Components/Transitioner/Scene.tsx +1 -0
  31. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +60 -0
  32. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +17 -55
  33. package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +15 -26
  34. package/Contexts/ScreenDataContext/index.tsx +2 -0
  35. package/Decorators/RiverFeedLoader/index.tsx +2 -2
  36. package/Decorators/ZappPipesDataConnector/index.tsx +4 -5
  37. package/index.d.ts +0 -1
  38. package/package.json +5 -5
  39. package/Components/AudioPlayer/Artwork.tsx +0 -35
  40. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
  41. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
  42. package/Components/AudioPlayer/index.ts +0 -1
  43. package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +0 -0
  44. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
  45. package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +2 -2
  46. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/channel.test.js.snap +0 -0
  47. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
  48. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
  49. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
  50. /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
3
+
4
+ import { AudioPlayerTV } from "./tv";
5
+ import { AudioPlayerMobile } from "./mobile";
6
+
7
+ import { Props } from "./types";
8
+
9
+ export function AudioPlayer(props: Props) {
10
+ if (isTV()) {
11
+ return <AudioPlayerTV {...props} />;
12
+ }
13
+
14
+ return <AudioPlayerMobile {...props} />;
15
+ }
@@ -0,0 +1,66 @@
1
+ import React, { useRef } from "react";
2
+ import {
3
+ View,
4
+ ImageBackground,
5
+ Animated,
6
+ ViewStyle,
7
+ StyleSheet,
8
+ } from "react-native";
9
+ import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
10
+
11
+ const THREE_SECONDS = 3000;
12
+
13
+ const styles = StyleSheet.create({
14
+ flex: {
15
+ flex: 1,
16
+ },
17
+ });
18
+
19
+ type Props = {
20
+ backgroundImageSource: { uri: string };
21
+ style: ViewStyle;
22
+ };
23
+
24
+ export function AudioPlayerMobileLayout({
25
+ backgroundImageSource,
26
+ style,
27
+ }: Props) {
28
+ const fadeAnimation = useRef(new Animated.Value(0)).current;
29
+
30
+ const mainContainerStyles = platformSelect({
31
+ native: {
32
+ backgroundColor: "transparent",
33
+ overflow: "hidden",
34
+ ...style,
35
+ },
36
+ });
37
+
38
+ React.useEffect(() => {
39
+ Animated.timing(fadeAnimation, {
40
+ toValue: 1,
41
+ duration: THREE_SECONDS,
42
+ useNativeDriver: true,
43
+ }).start();
44
+ }, []);
45
+
46
+ return (
47
+ <View style={mainContainerStyles} pointerEvents="none">
48
+ <Animated.View
49
+ style={[
50
+ mainContainerStyles,
51
+ {
52
+ opacity: fadeAnimation,
53
+ },
54
+ ]}
55
+ >
56
+ <ImageBackground
57
+ source={backgroundImageSource}
58
+ style={styles.flex}
59
+ resizeMode="cover"
60
+ >
61
+ <View style={mainContainerStyles} />
62
+ </ImageBackground>
63
+ </Animated.View>
64
+ </View>
65
+ );
66
+ }
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<AudioPlayer /> renders correctly 1`] = `
3
+ exports[`<AudioPlayerMobileLayout /> renders correctly 1`] = `
4
4
  <View
5
5
  pointerEvents="none"
6
6
  style={
@@ -32,7 +32,7 @@ exports[`<AudioPlayer /> renders correctly 1`] = `
32
32
  resizeMode="cover"
33
33
  source={
34
34
  {
35
- "uri": "https://example.com",
35
+ "uri": "background_image_url",
36
36
  }
37
37
  }
38
38
  style={
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { render } from "@testing-library/react-native";
3
+
4
+ import { AudioPlayerMobileLayout } from "../Layout";
5
+
6
+ const audioPlayerLayoutProps = {
7
+ backgroundImageSource: { uri: "background_image_url" },
8
+ };
9
+
10
+ describe("<AudioPlayerMobileLayout />", () => {
11
+ it("renders correctly", () => {
12
+ const { toJSON } = render(
13
+ <AudioPlayerMobileLayout {...audioPlayerLayoutProps} />
14
+ );
15
+
16
+ expect(toJSON()).toMatchSnapshot();
17
+ });
18
+ });
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { useBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
3
+
4
+ import { AudioPlayerMobileLayout } from "./Layout";
5
+ import { Props } from "../types";
6
+
7
+ export function AudioPlayerMobile(props: Props) {
8
+ const { audio_item, style = {} } = props;
9
+
10
+ const backgroundImageSource = useBackgroundImage(audio_item);
11
+
12
+ return (
13
+ <AudioPlayerMobileLayout
14
+ backgroundImageSource={backgroundImageSource}
15
+ style={style}
16
+ />
17
+ );
18
+ }
@@ -0,0 +1,40 @@
1
+ import React from "react";
2
+ import { View, Image, StyleSheet } from "react-native";
3
+ import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
4
+
5
+ const styles = StyleSheet.create({
6
+ container: {
7
+ marginHorizontal: 24,
8
+ },
9
+ image: {
10
+ width: 400,
11
+ height: 400,
12
+ },
13
+ });
14
+
15
+ type Props = {
16
+ srcImage: string;
17
+ config?: {
18
+ titleColor: string;
19
+ summaryColor: string;
20
+ backgroundColor: string;
21
+ backgroundImage: string;
22
+ isRTL: boolean;
23
+ artworkBorderRadius: Option<number>;
24
+ };
25
+ };
26
+
27
+ export function Artwork({ srcImage, config }: Props) {
28
+ const borderRadius = toNumberWithDefaultZero(config.artworkBorderRadius);
29
+
30
+ return (
31
+ <View style={styles.container}>
32
+ <Image
33
+ fadeDuration={0}
34
+ source={{ uri: srcImage }}
35
+ style={[styles.image, { borderRadius }]}
36
+ resizeMode="cover"
37
+ />
38
+ </View>
39
+ );
40
+ }
@@ -1,5 +1,5 @@
1
- import React, { useRef } from "react";
2
- import { View, ImageBackground, Animated, ViewStyle } from "react-native";
1
+ import * as React from "react";
2
+ import { View, ImageBackground, ViewStyle } from "react-native";
3
3
 
4
4
  import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
5
5
 
@@ -7,29 +7,25 @@ import { Artwork } from "./Artwork";
7
7
  import { directionStyles } from "./helpers";
8
8
 
9
9
  type Props = {
10
- artwork?: string;
10
+ artwork: string;
11
11
  config: {
12
12
  titleColor: string;
13
13
  summaryColor: string;
14
14
  backgroundColor: string;
15
- backgroundImage: string;
15
+ backgroundImage: Option<string>;
16
16
  isRTL: boolean;
17
+ artworkBorderRadius: Option<number>;
17
18
  };
18
19
  children: React.ReactNode;
19
20
  style: ViewStyle;
20
21
  };
21
22
 
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
-
23
+ export function AudioPlayerTVLayout({
24
+ artwork,
25
+ config,
26
+ children,
27
+ style,
28
+ }: Props) {
33
29
  const { isRTL, backgroundColor, backgroundImage } = config;
34
30
 
35
31
  const backgroundImageSource = { uri: backgroundImage };
@@ -40,17 +36,16 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
40
36
 
41
37
  const mainContainerStyles = platformSelect({
42
38
  tvos: {
43
- width: 1920,
44
- height: 1080,
39
+ width: "100%",
40
+ height: "100%",
45
41
  alignItems: "center",
46
42
  justifyContent: "center",
47
43
  flexDirection: directionStyles(isRTL).flexDirection,
48
44
  backgroundColor: backgroundColorStyle,
49
45
  },
50
46
  android_tv: {
51
- position: "absolute",
52
- width: 1920,
53
- height: 1080,
47
+ width: "100%",
48
+ height: "100%",
54
49
  alignItems: "center",
55
50
  justifyContent: "center",
56
51
  flexDirection: directionStyles(isRTL).flexDirection,
@@ -97,8 +92,8 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
97
92
 
98
93
  const backgroundImgStyles = platformSelect({
99
94
  tvos: {
100
- width: 1920,
101
- height: 1080,
95
+ width: "100%",
96
+ height: "100%",
102
97
  alignItems: "center",
103
98
  justifyContent: "center",
104
99
  },
@@ -119,9 +114,6 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
119
114
  alignItems: "center",
120
115
  justifyContent: "center",
121
116
  },
122
- native: {
123
- flex: 1,
124
- },
125
117
  });
126
118
 
127
119
  const textContainerStyles = platformSelect({
@@ -145,58 +137,25 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
145
137
  },
146
138
  });
147
139
 
148
- const audioPlayerLayoutTV = backgroundImageSource?.uri ? (
149
- <ImageBackground
150
- source={backgroundImageSource}
151
- style={backgroundImgStyles}
152
- resizeMode="cover"
153
- >
154
- <View style={mainContainerStyles}>
155
- {!!artwork && <Artwork srcImage={artwork} config={config} />}
156
- <View style={textContainerStyles}>{children}</View>
157
- </View>
158
- </ImageBackground>
159
- ) : (
140
+ if (backgroundImage) {
141
+ return (
142
+ <ImageBackground
143
+ source={backgroundImageSource}
144
+ style={backgroundImgStyles}
145
+ resizeMode="cover"
146
+ >
147
+ <View style={mainContainerStyles}>
148
+ <Artwork srcImage={artwork} config={config} />
149
+ <View style={textContainerStyles}>{children}</View>
150
+ </View>
151
+ </ImageBackground>
152
+ );
153
+ }
154
+
155
+ return (
160
156
  <View style={mainContainerStyles}>
161
- {!!artwork && <Artwork srcImage={artwork} config={config} />}
157
+ <Artwork srcImage={artwork} config={config} />
162
158
  <View style={textContainerStyles}>{children}</View>
163
159
  </View>
164
160
  );
165
-
166
- const audioPlayerLayoutMobile = () => {
167
- fadeAudioPlayerIn();
168
-
169
- return (
170
- <View style={mainContainerStyles} pointerEvents="none">
171
- <Animated.View
172
- style={[
173
- mainContainerStyles,
174
- {
175
- opacity: fadeAnimation,
176
- },
177
- ]}
178
- >
179
- <ImageBackground
180
- source={backgroundImageSource}
181
- style={backgroundImgStyles}
182
- resizeMode="cover"
183
- >
184
- <View style={mainContainerStyles} />
185
- </ImageBackground>
186
- </Animated.View>
187
- </View>
188
- );
189
- };
190
-
191
- const audioPlayerLayout = platformSelect({
192
- tvos: audioPlayerLayoutTV,
193
- android_tv: audioPlayerLayoutTV,
194
- web: audioPlayerLayoutTV,
195
- samsung_tv: audioPlayerLayoutTV,
196
- lg_tv: audioPlayerLayoutTV,
197
- ios: audioPlayerLayoutMobile(),
198
- android: audioPlayerLayoutMobile(),
199
- });
200
-
201
- return audioPlayerLayout;
202
161
  }
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { View, Text, ViewStyle, TextStyle } from "react-native";
3
+ import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
3
4
  import { directionStyles } from "./helpers";
4
5
 
5
6
  type Props = {
@@ -31,7 +32,7 @@ const textStyles = ({
31
32
  }) => ({
32
33
  color: summaryColor,
33
34
  opacity: 0.8,
34
- fontSize: runTimeFontSize ? Number(runTimeFontSize) : 20,
35
+ fontSize: toNumberWithDefault(20, runTimeFontSize),
35
36
  fontFamily: runTimeFontFamily || null,
36
37
  ...directionStyles(isRTL),
37
38
  });
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { View, Text, TextStyle } from "react-native";
2
+ import { View, Text, TextStyle, StyleSheet } from "react-native";
3
+ import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
3
4
 
4
5
  type Props = {
5
6
  config: {
@@ -14,11 +15,13 @@ type Props = {
14
15
  summary: string | number;
15
16
  };
16
17
 
17
- const containerStyles = {
18
- width: 600,
19
- height: 80,
20
- marginBottom: 30,
21
- };
18
+ const styles = StyleSheet.create({
19
+ container: {
20
+ width: 600,
21
+ height: 80,
22
+ marginBottom: 30,
23
+ },
24
+ });
22
25
 
23
26
  const textStyles = ({
24
27
  summaryColor,
@@ -26,8 +29,8 @@ const textStyles = ({
26
29
  summaryFontFamily,
27
30
  summaryFontSize,
28
31
  }) => ({
29
- textAlign: (isRTL ? "left" : "right") as TextStyle["textAlign"],
30
- fontSize: summaryFontSize ? Number(summaryFontSize) : 20,
32
+ textAlign: (isRTL ? "right" : "left") as TextStyle["textAlign"],
33
+ fontSize: toNumberWithDefault(20, summaryFontSize),
31
34
  color: summaryColor,
32
35
  fontWeight: "600" as TextStyle["fontWeight"],
33
36
  opacity: 0.8,
@@ -36,7 +39,7 @@ const textStyles = ({
36
39
 
37
40
  export function Summary({ summary, config }: Props) {
38
41
  return (
39
- <View style={containerStyles}>
42
+ <View style={styles.container}>
40
43
  <Text style={textStyles(config)} numberOfLines={2}>
41
44
  {summary}
42
45
  </Text>
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { View, Text, TextStyle } from "react-native";
2
+ import { View, Text, TextStyle, StyleSheet } from "react-native";
3
+ import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
3
4
 
4
5
  type Props = {
5
6
  config: {
@@ -14,15 +15,17 @@ type Props = {
14
15
  title: string | number;
15
16
  };
16
17
 
17
- const containerStyles = {
18
- width: 600,
19
- height: 100,
20
- marginBottom: 12,
21
- };
18
+ const styles = StyleSheet.create({
19
+ container: {
20
+ width: 600,
21
+ height: 100,
22
+ marginBottom: 12,
23
+ },
24
+ });
22
25
 
23
26
  const textStyles = ({ titleColor, isRTL, titleFontFamily, titleFontSize }) => ({
24
- textAlign: (isRTL ? "left" : "right") as TextStyle["textAlign"],
25
- fontSize: titleFontSize ? Number(titleFontSize) : 38,
27
+ textAlign: (isRTL ? "right" : "left") as TextStyle["textAlign"],
28
+ fontSize: toNumberWithDefault(38, titleFontSize),
26
29
  fontWeight: "600" as TextStyle["fontWeight"],
27
30
  color: titleColor,
28
31
  fontFamily: titleFontFamily || null,
@@ -30,7 +33,7 @@ const textStyles = ({ titleColor, isRTL, titleFontFamily, titleFontSize }) => ({
30
33
 
31
34
  export function Title({ title, config }: Props) {
32
35
  return (
33
- <View style={containerStyles}>
36
+ <View style={styles.container}>
34
37
  <Text style={textStyles(config)} numberOfLines={2}>
35
38
  {title}
36
39
  </Text>
@@ -17,10 +17,15 @@ exports[`<Artwork /> renders correctly 1`] = `
17
17
  }
18
18
  }
19
19
  style={
20
- {
21
- "height": 400,
22
- "width": 400,
23
- }
20
+ [
21
+ {
22
+ "height": 400,
23
+ "width": 400,
24
+ },
25
+ {
26
+ "borderRadius": 0,
27
+ },
28
+ ]
24
29
  }
25
30
  />
26
31
  </View>
@@ -0,0 +1,170 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<AudioPlayerTV /> renders correctly 1`] = `
4
+ <View
5
+ accessibilityIgnoresInvertColors={true}
6
+ >
7
+ <Image
8
+ resizeMode="cover"
9
+ source={
10
+ {
11
+ "uri": "https://example.com",
12
+ }
13
+ }
14
+ style={
15
+ [
16
+ {
17
+ "bottom": 0,
18
+ "left": 0,
19
+ "position": "absolute",
20
+ "right": 0,
21
+ "top": 0,
22
+ },
23
+ {
24
+ "height": undefined,
25
+ "width": undefined,
26
+ },
27
+ undefined,
28
+ ]
29
+ }
30
+ />
31
+ <View
32
+ style={
33
+ {
34
+ "backgroundColor": "transparent",
35
+ "overflow": "hidden",
36
+ }
37
+ }
38
+ >
39
+ <View
40
+ style={
41
+ {
42
+ "marginHorizontal": 24,
43
+ }
44
+ }
45
+ >
46
+ <Image
47
+ fadeDuration={0}
48
+ resizeMode="cover"
49
+ source={
50
+ {
51
+ "uri": "artwork_url",
52
+ }
53
+ }
54
+ style={
55
+ [
56
+ {
57
+ "height": 400,
58
+ "width": 400,
59
+ },
60
+ {
61
+ "borderRadius": 0,
62
+ },
63
+ ]
64
+ }
65
+ />
66
+ </View>
67
+ <View>
68
+ <View
69
+ style={
70
+ {
71
+ "height": 72,
72
+ "marginBottom": 30,
73
+ "width": 128,
74
+ }
75
+ }
76
+ >
77
+ <Image
78
+ fadeDuration={0}
79
+ source={
80
+ {
81
+ "uri": "https://example.com",
82
+ }
83
+ }
84
+ style={
85
+ {
86
+ "height": 72,
87
+ "width": 128,
88
+ }
89
+ }
90
+ />
91
+ </View>
92
+ <View
93
+ style={
94
+ {
95
+ "height": 100,
96
+ "marginBottom": 12,
97
+ "width": 600,
98
+ }
99
+ }
100
+ >
101
+ <Text
102
+ numberOfLines={2}
103
+ style={
104
+ {
105
+ "color": "white",
106
+ "fontFamily": null,
107
+ "fontSize": 38,
108
+ "fontWeight": "600",
109
+ "textAlign": "right",
110
+ }
111
+ }
112
+ >
113
+ tittle
114
+ </Text>
115
+ </View>
116
+ <View
117
+ style={
118
+ {
119
+ "height": 80,
120
+ "marginBottom": 30,
121
+ "width": 600,
122
+ }
123
+ }
124
+ >
125
+ <Text
126
+ numberOfLines={2}
127
+ style={
128
+ {
129
+ "color": "white",
130
+ "fontFamily": null,
131
+ "fontSize": 20,
132
+ "fontWeight": "600",
133
+ "opacity": 0.8,
134
+ "textAlign": "right",
135
+ }
136
+ }
137
+ >
138
+ Summary
139
+ </Text>
140
+ </View>
141
+ <View
142
+ style={
143
+ {
144
+ "height": 40,
145
+ "justifyContent": "flex-end",
146
+ "width": 600,
147
+ }
148
+ }
149
+ >
150
+ <Text
151
+ style={
152
+ {
153
+ "alignItems": "flex-start",
154
+ "color": "white",
155
+ "flexDirection": "row-reverse",
156
+ "fontFamily": null,
157
+ "fontSize": 20,
158
+ "justifyContent": "flex-end",
159
+ "opacity": 0.8,
160
+ "textAlign": "right",
161
+ }
162
+ }
163
+ >
164
+ 10:10 - 11:11
165
+ </Text>
166
+ </View>
167
+ </View>
168
+ </View>
169
+ </View>
170
+ `;
@@ -19,7 +19,7 @@ exports[`<Summary /> renders correctly 1`] = `
19
19
  "fontSize": 20,
20
20
  "fontWeight": "600",
21
21
  "opacity": 0.8,
22
- "textAlign": "left",
22
+ "textAlign": "right",
23
23
  }
24
24
  }
25
25
  >
@@ -18,7 +18,7 @@ exports[`<Title /> renders correctly 1`] = `
18
18
  "fontFamily": null,
19
19
  "fontSize": 38,
20
20
  "fontWeight": "600",
21
- "textAlign": "left",
21
+ "textAlign": "right",
22
22
  }
23
23
  }
24
24
  >
@@ -1,7 +1,11 @@
1
1
  import React from "react";
2
2
  import { render } from "@testing-library/react-native";
3
3
 
4
- import { AudioPlayer } from "../AudioPlayer";
4
+ import { AudioPlayerTV } from "..";
5
+
6
+ jest.mock("@applicaster/zapp-react-native-utils/audioPlayerUtils", () => ({
7
+ useArtworkImage: jest.fn(() => "artwork_url"),
8
+ }));
5
9
 
6
10
  const audioPlayerProps = {
7
11
  audio_item: {
@@ -45,9 +49,9 @@ const audioPlayerProps = {
45
49
  styles: {},
46
50
  };
47
51
 
48
- describe("<AudioPlayer />", () => {
52
+ describe("<AudioPlayerTV />", () => {
49
53
  it("renders correctly", () => {
50
- const { toJSON } = render(<AudioPlayer {...audioPlayerProps} />);
54
+ const { toJSON } = render(<AudioPlayerTV {...audioPlayerProps} />);
51
55
  expect(toJSON()).toMatchSnapshot();
52
56
  });
53
57
  });