@applicaster/zapp-react-native-ui-components 14.0.0-alpha.8387612031 → 14.0.0-alpha.9119252693

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 (38) hide show
  1. package/Components/AudioPlayer/AudioPlayerLayout.tsx +202 -0
  2. package/Components/AudioPlayer/mobile/Layout.tsx +6 -3
  3. package/Components/AudioPlayer/mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap +7 -1
  4. package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +1 -1
  5. package/Components/AudioPlayer/mobile/index.tsx +7 -12
  6. package/Components/AudioPlayer/tv/Artwork.tsx +3 -2
  7. package/Components/AudioPlayer/tv/Channel.tsx +7 -7
  8. package/Components/AudioPlayer/tv/Layout.tsx +100 -93
  9. package/Components/AudioPlayer/tv/Runtime.tsx +7 -1
  10. package/Components/AudioPlayer/tv/Summary.tsx +6 -2
  11. package/Components/AudioPlayer/tv/Title.tsx +6 -2
  12. package/Components/AudioPlayer/tv/__tests__/__snapshots__/Runtime.test.js.snap +2 -2
  13. package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +21 -27
  14. package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +8 -17
  15. package/Components/AudioPlayer/tv/__tests__/__snapshots__/summary.test.js.snap +1 -2
  16. package/Components/AudioPlayer/tv/__tests__/__snapshots__/title.test.js.snap +1 -2
  17. package/Components/AudioPlayer/tv/__tests__/audioPlayer.test.js +4 -0
  18. package/Components/AudioPlayer/tv/index.tsx +9 -11
  19. package/Components/Cell/index.js +6 -2
  20. package/Components/Focusable/__tests__/index.android.test.tsx +3 -0
  21. package/Components/Focusable/index.android.tsx +12 -8
  22. package/Components/HandlePlayable/HandlePlayable.tsx +11 -1
  23. package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -27
  24. package/Components/MasterCell/index.tsx +1 -1
  25. package/Components/PlayerContainer/PlayerContainer.tsx +15 -6
  26. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +9 -1
  27. package/Components/VideoModal/PlayerDetails.tsx +24 -2
  28. package/Components/VideoModal/PlayerWrapper.tsx +26 -142
  29. package/Components/VideoModal/VideoModal.tsx +3 -17
  30. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -7
  31. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +44 -240
  32. package/Components/VideoModal/hooks/index.ts +0 -2
  33. package/Components/VideoModal/hooks/useModalSize.ts +16 -2
  34. package/Components/VideoModal/utils.ts +6 -0
  35. package/Components/Viewport/VisibilitySensor/VisibilitySensor.tsx +3 -3
  36. package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/index.ts +3 -3
  37. package/package.json +5 -8
  38. package/Components/VideoModal/hooks/useBackgroundColor.ts +0 -10
@@ -0,0 +1,202 @@
1
+ import React, { useRef } from "react";
2
+ import { View, ImageBackground, Animated } 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
+ artworkBorderRadius: Option<number>;
18
+ };
19
+ children: React.ReactNode;
20
+ };
21
+
22
+ export function AudioPlayerLayout({ artwork, config, children }: 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 backgroundImageSource = { uri: backgroundImage || artwork };
36
+
37
+ const backgroundColorStyle = backgroundImageSource.uri
38
+ ? "transparent"
39
+ : backgroundColor;
40
+
41
+ const mainContainerStyles = platformSelect({
42
+ tvos: {
43
+ width: "100%",
44
+ height: "100%",
45
+ alignItems: "center",
46
+ justifyContent: "center",
47
+ flexDirection: directionStyles(isRTL).flexDirection,
48
+ backgroundColor: backgroundColorStyle,
49
+ },
50
+ android_tv: {
51
+ width: "100%",
52
+ height: "100%",
53
+ alignItems: "center",
54
+ justifyContent: "center",
55
+ flexDirection: directionStyles(isRTL).flexDirection,
56
+ backgroundColor: backgroundColorStyle,
57
+ },
58
+ web: {
59
+ width: 1920,
60
+ height: 1080,
61
+ alignItems: "center",
62
+ justifyContent: "center",
63
+ flexDirection: directionStyles(isRTL).flexDirection,
64
+ backgroundColor: backgroundColorStyle,
65
+ },
66
+ native: {
67
+ backgroundColor: backgroundColorStyle,
68
+ overflow: "hidden",
69
+ width: "100%",
70
+ height: "100%",
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: "100%",
101
+ height: "100%",
102
+ alignItems: "center",
103
+ justifyContent: "center",
104
+ },
105
+ android_tv: {
106
+ width: "100%",
107
+ height: "100%",
108
+ alignItems: "center",
109
+ justifyContent: "center",
110
+ },
111
+ web: {
112
+ position: "absolute",
113
+ margin: "auto",
114
+ display: "flex",
115
+ flexWrap: "wrap",
116
+ width: "100%",
117
+ height: "100%",
118
+ flex: 1,
119
+ alignItems: "center",
120
+ justifyContent: "center",
121
+ },
122
+ native: {
123
+ flex: 1,
124
+ },
125
+ });
126
+
127
+ const textContainerStyles = platformSelect({
128
+ tvos: {
129
+ width: 600,
130
+ height: 362,
131
+ marginHorizontal: 24,
132
+ alignItems: directionStyles(isRTL).justifyContent,
133
+ },
134
+ android_tv: {
135
+ width: 600,
136
+ height: 362,
137
+ marginHorizontal: 24,
138
+ alignItems: directionStyles(isRTL).justifyContent,
139
+ },
140
+ web: {
141
+ margin: 10,
142
+ height: "100vh",
143
+ alignItems: directionStyles(isRTL).justifyContent,
144
+ justifyContent: "center",
145
+ },
146
+ });
147
+
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
+ ) : (
160
+ <View style={mainContainerStyles}>
161
+ {!!artwork && <Artwork srcImage={artwork} config={config} />}
162
+ <View style={textContainerStyles}>{children}</View>
163
+ </View>
164
+ );
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
+ }
@@ -17,11 +17,14 @@ const styles = StyleSheet.create({
17
17
  });
18
18
 
19
19
  type Props = {
20
- backgroundImage: string;
20
+ backgroundImageSource: { uri: string };
21
21
  style: ViewStyle;
22
22
  };
23
23
 
24
- export function AudioPlayerMobileLayout({ backgroundImage, style }: Props) {
24
+ export function AudioPlayerMobileLayout({
25
+ backgroundImageSource,
26
+ style,
27
+ }: Props) {
25
28
  const fadeAnimation = useRef(new Animated.Value(0)).current;
26
29
 
27
30
  const mainContainerStyles = platformSelect({
@@ -51,7 +54,7 @@ export function AudioPlayerMobileLayout({ backgroundImage, style }: Props) {
51
54
  ]}
52
55
  >
53
56
  <ImageBackground
54
- source={{ uri: backgroundImage }}
57
+ source={backgroundImageSource}
55
58
  style={styles.flex}
56
59
  resizeMode="cover"
57
60
  >
@@ -6,7 +6,9 @@ exports[`<AudioPlayerMobileLayout /> renders correctly 1`] = `
6
6
  style={
7
7
  {
8
8
  "backgroundColor": "transparent",
9
+ "height": "100%",
9
10
  "overflow": "hidden",
11
+ "width": "100%",
10
12
  }
11
13
  }
12
14
  >
@@ -15,8 +17,10 @@ exports[`<AudioPlayerMobileLayout /> renders correctly 1`] = `
15
17
  style={
16
18
  {
17
19
  "backgroundColor": "transparent",
20
+ "height": "100%",
18
21
  "opacity": 0,
19
22
  "overflow": "hidden",
23
+ "width": "100%",
20
24
  }
21
25
  }
22
26
  >
@@ -32,7 +36,7 @@ exports[`<AudioPlayerMobileLayout /> renders correctly 1`] = `
32
36
  resizeMode="cover"
33
37
  source={
34
38
  {
35
- "uri": undefined,
39
+ "uri": "background_image_url",
36
40
  }
37
41
  }
38
42
  style={
@@ -56,7 +60,9 @@ exports[`<AudioPlayerMobileLayout /> renders correctly 1`] = `
56
60
  style={
57
61
  {
58
62
  "backgroundColor": "transparent",
63
+ "height": "100%",
59
64
  "overflow": "hidden",
65
+ "width": "100%",
60
66
  }
61
67
  }
62
68
  />
@@ -4,7 +4,7 @@ import { render } from "@testing-library/react-native";
4
4
  import { AudioPlayerMobileLayout } from "../Layout";
5
5
 
6
6
  const audioPlayerLayoutProps = {
7
- backgroundColor: "black",
7
+ backgroundImageSource: { uri: "background_image_url" },
8
8
  };
9
9
 
10
10
  describe("<AudioPlayerMobileLayout />", () => {
@@ -1,23 +1,18 @@
1
1
  import * as React from "react";
2
- import { getBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
2
+ import { useBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
3
3
 
4
4
  import { AudioPlayerMobileLayout } from "./Layout";
5
-
6
5
  import { Props } from "../types";
7
6
 
8
7
  export function AudioPlayerMobile(props: Props) {
9
- const { audio_item, plugin_configuration, style = {} } = props;
8
+ const { audio_item, style = {} } = props;
10
9
 
11
- const backgroundImage = React.useMemo(
12
- () =>
13
- getBackgroundImage({
14
- entry: audio_item,
15
- plugin_configuration,
16
- }),
17
- [audio_item, plugin_configuration]
18
- );
10
+ const backgroundImageSource = useBackgroundImage(audio_item);
19
11
 
20
12
  return (
21
- <AudioPlayerMobileLayout backgroundImage={backgroundImage} style={style} />
13
+ <AudioPlayerMobileLayout
14
+ backgroundImageSource={backgroundImageSource}
15
+ style={style}
16
+ />
22
17
  );
23
18
  }
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { View, Image, StyleSheet } from "react-native";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { QBImage } from "@applicaster/zapp-react-native-ui-components/Components/Image";
3
4
  import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
4
5
 
5
6
  const styles = StyleSheet.create({
@@ -29,7 +30,7 @@ export function Artwork({ srcImage, config }: Props) {
29
30
 
30
31
  return (
31
32
  <View style={styles.container}>
32
- <Image
33
+ <QBImage
33
34
  fadeDuration={0}
34
35
  source={{ uri: srcImage }}
35
36
  style={[styles.image, { borderRadius }]}
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { View, Image } from "react-native";
2
+ import { Image } from "react-native";
3
+ import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
3
4
 
4
5
  type Props = {
5
6
  srcImage: string;
@@ -15,17 +16,16 @@ type Props = {
15
16
  const imageStyles = {
16
17
  width: 128,
17
18
  height: 72,
18
- };
19
19
 
20
- const containerStyles = {
21
- ...imageStyles,
22
20
  marginBottom: 30,
23
21
  };
24
22
 
25
23
  export function Channel({ srcImage }: Props) {
24
+ if (isNilOrEmpty(srcImage)) {
25
+ return null;
26
+ }
27
+
26
28
  return (
27
- <View style={containerStyles}>
28
- <Image fadeDuration={0} source={{ uri: srcImage }} style={imageStyles} />
29
- </View>
29
+ <Image fadeDuration={0} source={{ uri: srcImage }} style={imageStyles} />
30
30
  );
31
31
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { View, ImageBackground, ViewStyle } from "react-native";
2
+ import { ImageBackground, View, ViewStyle } from "react-native";
3
3
 
4
4
  import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
5
5
 
@@ -11,6 +11,7 @@ type Props = {
11
11
  config: {
12
12
  titleColor: string;
13
13
  summaryColor: string;
14
+ backgroundImageOverlay?: string;
14
15
  backgroundColor: string;
15
16
  backgroundImage: Option<string>;
16
17
  isRTL: boolean;
@@ -20,13 +21,40 @@ type Props = {
20
21
  style: ViewStyle;
21
22
  };
22
23
 
24
+ const backgroundImgStyles = platformSelect({
25
+ tvos: {
26
+ width: "100%",
27
+ height: "100%",
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ },
31
+ android_tv: {
32
+ width: "100%",
33
+ height: "100%",
34
+ alignItems: "center",
35
+ justifyContent: "center",
36
+ },
37
+ web: {
38
+ position: "absolute",
39
+ margin: "auto",
40
+ display: "flex",
41
+ flexWrap: "wrap",
42
+ width: "100%",
43
+ height: "100%",
44
+ flex: 1,
45
+ alignItems: "center",
46
+ justifyContent: "center",
47
+ },
48
+ });
49
+
23
50
  export function AudioPlayerTVLayout({
24
51
  artwork,
25
52
  config,
26
53
  children,
27
54
  style,
28
55
  }: Props) {
29
- const { isRTL, backgroundColor, backgroundImage } = config;
56
+ const { backgroundColor, backgroundImage, backgroundImageOverlay, isRTL } =
57
+ config;
30
58
 
31
59
  const backgroundImageSource = { uri: backgroundImage };
32
60
 
@@ -34,108 +62,87 @@ export function AudioPlayerTVLayout({
34
62
  ? "transparent"
35
63
  : backgroundColor;
36
64
 
37
- const mainContainerStyles = platformSelect({
65
+ const textContainerStyles = platformSelect({
38
66
  tvos: {
39
- width: "100%",
40
- height: "100%",
41
- alignItems: "center",
42
67
  justifyContent: "center",
43
- flexDirection: directionStyles(isRTL).flexDirection,
44
- backgroundColor: backgroundColorStyle,
68
+ alignItems: directionStyles(isRTL).justifyContent,
45
69
  },
46
70
  android_tv: {
47
- width: "100%",
48
- height: "100%",
49
- alignItems: "center",
50
71
  justifyContent: "center",
51
- flexDirection: directionStyles(isRTL).flexDirection,
52
- backgroundColor: backgroundColorStyle,
72
+ alignItems: directionStyles(isRTL).justifyContent,
53
73
  },
54
74
  web: {
55
- width: 1920,
56
- height: 1080,
57
- alignItems: "center",
58
- justifyContent: "center",
59
- flexDirection: directionStyles(isRTL).flexDirection,
60
- backgroundColor: backgroundColorStyle,
61
- },
62
- native: {
63
- backgroundColor: backgroundColorStyle,
64
- overflow: "hidden",
65
- ...style,
66
- },
67
- samsung_tv: {
68
- position: "absolute",
69
- margin: "auto",
70
- display: "flex",
71
- flexWrap: "wrap",
72
- width: "100vw",
73
- flex: 1,
74
- alignItems: "center",
75
- justifyContent: "center",
76
- flexDirection: directionStyles(isRTL).flexDirection,
77
- backgroundColor: backgroundColorStyle,
78
- },
79
- lg_tv: {
80
- position: "absolute",
81
- margin: "auto",
82
- display: "flex",
83
- flexWrap: "wrap",
84
- width: "100vw",
85
- flex: 1,
86
- alignItems: "center",
87
75
  justifyContent: "center",
88
- flexDirection: directionStyles(isRTL).flexDirection,
89
- backgroundColor: backgroundColorStyle,
76
+ alignItems: directionStyles(isRTL).justifyContent,
90
77
  },
91
78
  });
92
79
 
93
- const backgroundImgStyles = platformSelect({
94
- tvos: {
95
- width: "100%",
96
- height: "100%",
97
- alignItems: "center",
98
- justifyContent: "center",
99
- },
100
- android_tv: {
101
- width: "100%",
102
- height: "100%",
103
- alignItems: "center",
104
- justifyContent: "center",
105
- },
106
- web: {
107
- position: "absolute",
108
- margin: "auto",
109
- display: "flex",
110
- flexWrap: "wrap",
111
- width: "100%",
112
- height: "100%",
113
- flex: 1,
114
- alignItems: "center",
115
- justifyContent: "center",
116
- },
117
- });
80
+ const mainContainerStyles = React.useMemo(
81
+ () =>
82
+ platformSelect({
83
+ tvos: {
84
+ width: "100%",
85
+ height: "100%",
86
+ alignItems: "center",
87
+ justifyContent: "center",
88
+ flexDirection: directionStyles(isRTL).flexDirection,
89
+ backgroundColor: backgroundColorStyle,
90
+ },
91
+ android_tv: {
92
+ width: "100%",
93
+ height: "100%",
94
+ alignItems: "center",
95
+ justifyContent: "center",
96
+ flexDirection: directionStyles(isRTL).flexDirection,
97
+ backgroundColor: backgroundColorStyle,
98
+ },
99
+ web: {
100
+ width: 1920,
101
+ height: 1080,
102
+ alignItems: "center",
103
+ justifyContent: "center",
104
+ flexDirection: directionStyles(isRTL).flexDirection,
105
+ backgroundColor: backgroundColorStyle,
106
+ },
107
+ native: {
108
+ backgroundColor: backgroundColorStyle,
109
+ overflow: "hidden",
110
+ ...style,
111
+ },
112
+ samsung_tv: {
113
+ position: "absolute",
114
+ margin: "auto",
115
+ display: "flex",
116
+ flexWrap: "wrap",
117
+ height: "100vh",
118
+ width: "100vw",
119
+ alignItems: "center",
120
+ justifyContent: "center",
121
+ flexDirection: directionStyles(isRTL).flexDirection,
122
+ backgroundColor: backgroundColorStyle,
123
+ },
124
+ lg_tv: {
125
+ position: "absolute",
126
+ margin: "auto",
127
+ display: "flex",
128
+ flexWrap: "wrap",
129
+ height: "100vh",
130
+ width: "100vw",
131
+ alignItems: "center",
132
+ justifyContent: "center",
133
+ flexDirection: directionStyles(isRTL).flexDirection,
134
+ backgroundColor: backgroundColorStyle,
135
+ },
136
+ }),
137
+ [backgroundColorStyle, isRTL, style]
138
+ );
118
139
 
119
- const textContainerStyles = platformSelect({
120
- tvos: {
121
- width: 600,
122
- height: 362,
123
- marginHorizontal: 24,
124
- alignItems: directionStyles(isRTL).justifyContent,
125
- },
126
- android_tv: {
127
- width: 600,
128
- height: 362,
129
- marginHorizontal: 24,
130
- alignItems: directionStyles(isRTL).justifyContent,
131
- },
132
- web: {
133
- margin: 10,
134
- height: "100vh",
135
- alignItems: directionStyles(isRTL).justifyContent,
136
- justifyContent: "center",
137
- },
138
- });
140
+ const backgroundOverlayStyles = React.useMemo(
141
+ () => ({
142
+ backgroundColor: backgroundImageOverlay,
143
+ }),
144
+ [backgroundImageOverlay]
145
+ );
139
146
 
140
147
  if (backgroundImage) {
141
148
  return (
@@ -144,7 +151,7 @@ export function AudioPlayerTVLayout({
144
151
  style={backgroundImgStyles}
145
152
  resizeMode="cover"
146
153
  >
147
- <View style={mainContainerStyles}>
154
+ <View style={[mainContainerStyles, backgroundOverlayStyles]}>
148
155
  <Artwork srcImage={artwork} config={config} />
149
156
  <View style={textContainerStyles}>{children}</View>
150
157
  </View>
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
2
  import { View, Text, ViewStyle, TextStyle } from "react-native";
3
3
  import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
4
+ import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
5
+
4
6
  import { directionStyles } from "./helpers";
5
7
 
6
8
  type Props = {
@@ -19,7 +21,6 @@ type Props = {
19
21
 
20
22
  const containerStyles = ({ isRTL }) => ({
21
23
  width: 600,
22
- height: 40,
23
24
  justifyContent: directionStyles(isRTL)
24
25
  .justifyContent as ViewStyle["justifyContent"],
25
26
  });
@@ -38,11 +39,16 @@ const textStyles = ({
38
39
  });
39
40
 
40
41
  export function Runtime({ start_time, end_time, config }: Props) {
42
+ if (isNilOrEmpty(start_time) && isNilOrEmpty(end_time)) {
43
+ return null;
44
+ }
45
+
41
46
  return (
42
47
  <View style={containerStyles({ isRTL: config.isRTL })}>
43
48
  {!!start_time && !!end_time && (
44
49
  <Text
45
50
  style={textStyles(config) as TextStyle}
51
+ numberOfLines={1}
46
52
  >{`${start_time} - ${end_time}`}</Text>
47
53
  )}
48
54
  </View>
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { View, Text, TextStyle, StyleSheet } from "react-native";
3
3
  import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
4
+ import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
4
5
 
5
6
  type Props = {
6
7
  config: {
@@ -18,7 +19,6 @@ type Props = {
18
19
  const styles = StyleSheet.create({
19
20
  container: {
20
21
  width: 600,
21
- height: 80,
22
22
  marginBottom: 30,
23
23
  },
24
24
  });
@@ -38,9 +38,13 @@ const textStyles = ({
38
38
  });
39
39
 
40
40
  export function Summary({ summary, config }: Props) {
41
+ if (isNilOrEmpty(summary)) {
42
+ return null;
43
+ }
44
+
41
45
  return (
42
46
  <View style={styles.container}>
43
- <Text style={textStyles(config)} numberOfLines={2}>
47
+ <Text style={textStyles(config)} numberOfLines={3}>
44
48
  {summary}
45
49
  </Text>
46
50
  </View>
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { View, Text, TextStyle, StyleSheet } from "react-native";
3
3
  import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
4
+ import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
4
5
 
5
6
  type Props = {
6
7
  config: {
@@ -18,7 +19,6 @@ type Props = {
18
19
  const styles = StyleSheet.create({
19
20
  container: {
20
21
  width: 600,
21
- height: 100,
22
22
  marginBottom: 12,
23
23
  },
24
24
  });
@@ -32,9 +32,13 @@ const textStyles = ({ titleColor, isRTL, titleFontFamily, titleFontSize }) => ({
32
32
  });
33
33
 
34
34
  export function Title({ title, config }: Props) {
35
+ if (isNilOrEmpty(title)) {
36
+ return null;
37
+ }
38
+
35
39
  return (
36
40
  <View style={styles.container}>
37
- <Text style={textStyles(config)} numberOfLines={2}>
41
+ <Text style={textStyles(config)} numberOfLines={3}>
38
42
  {title}
39
43
  </Text>
40
44
  </View>