@applicaster/zapp-react-native-ui-components 14.0.0-alpha.1661204539 → 14.0.0-alpha.2332850672
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/Artwork.tsx +17 -12
- package/Components/AudioPlayer/AudioPlayer.tsx +48 -11
- package/Components/AudioPlayer/AudioPlayerMobileLayout.tsx +61 -0
- package/Components/AudioPlayer/{AudioPlayerLayout.tsx → AudioPlayerTVLayout.tsx} +31 -72
- package/Components/AudioPlayer/Runtime.tsx +2 -1
- package/Components/AudioPlayer/Summary.tsx +12 -9
- package/Components/AudioPlayer/Title.tsx +12 -9
- package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +2 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +9 -4
- package/Components/AudioPlayer/__tests__/__snapshots__/{audioPlayerLayout.test.js.snap → audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +1 -1
- package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +1 -1
- package/Components/AudioPlayer/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/helpers.tsx +2 -2
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +0 -2
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +1 -0
- package/Components/MasterCell/utils/behaviorProvider.ts +12 -67
- package/Components/MasterCell/utils/index.ts +3 -13
- package/Components/PlayerContainer/PlayerContainer.tsx +24 -38
- package/Components/River/ComponentsMap/ComponentsMap.tsx +1 -5
- package/Components/River/RiverItem.tsx +8 -8
- package/Components/River/TV/River.tsx +0 -3
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +0 -6
- package/Components/TopMarginApplicator/TopMarginApplicator.tsx +16 -15
- 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/Decorators/RiverFeedLoader/index.tsx +2 -8
- package/Decorators/RiverFeedLoader/utils/index.ts +2 -7
- package/Decorators/ZappPipesDataConnector/index.tsx +2 -16
- package/index.d.ts +0 -1
- package/package.json +5 -5
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { View, Image } from "react-native";
|
|
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
|
+
});
|
|
3
14
|
|
|
4
15
|
type Props = {
|
|
5
16
|
srcImage: string;
|
|
@@ -9,25 +20,19 @@ type Props = {
|
|
|
9
20
|
backgroundColor: string;
|
|
10
21
|
backgroundImage: string;
|
|
11
22
|
isRTL: boolean;
|
|
23
|
+
artworkBorderRadius: Option<number>;
|
|
12
24
|
};
|
|
13
25
|
};
|
|
14
26
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const imageStyles = {
|
|
20
|
-
width: 400,
|
|
21
|
-
height: 400,
|
|
22
|
-
};
|
|
27
|
+
export function Artwork({ srcImage, config }: Props) {
|
|
28
|
+
const borderRadius = toNumberWithDefaultZero(config.artworkBorderRadius);
|
|
23
29
|
|
|
24
|
-
export function Artwork({ srcImage }: Props) {
|
|
25
30
|
return (
|
|
26
|
-
<View style={
|
|
31
|
+
<View style={styles.container}>
|
|
27
32
|
<Image
|
|
28
33
|
fadeDuration={0}
|
|
29
34
|
source={{ uri: srcImage }}
|
|
30
|
-
style={
|
|
35
|
+
style={[styles.image, { borderRadius }]}
|
|
31
36
|
resizeMode="cover"
|
|
32
37
|
/>
|
|
33
38
|
</View>
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
platformSelect,
|
|
5
|
+
isTV,
|
|
6
|
+
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
4
7
|
|
|
5
8
|
import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
9
|
+
import { getBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
|
|
10
|
+
|
|
11
|
+
import { AudioPlayerMobileLayout } from "./AudioPlayerMobileLayout";
|
|
12
|
+
import { AudioPlayerTVLayout } from "./AudioPlayerTVLayout";
|
|
6
13
|
|
|
7
|
-
import { AudioPlayerLayout } from "./AudioPlayerLayout";
|
|
8
14
|
import { Channel } from "./Channel";
|
|
9
15
|
import { Title } from "./Title";
|
|
10
16
|
import { Summary } from "./Summary";
|
|
@@ -52,9 +58,20 @@ type Props = {
|
|
|
52
58
|
};
|
|
53
59
|
|
|
54
60
|
export function AudioPlayer(props: Props) {
|
|
55
|
-
const { audio_item, plugin_configuration, style } = props;
|
|
61
|
+
const { audio_item, plugin_configuration, style = {} } = props;
|
|
56
62
|
const { extensions, title, summary } = audio_item;
|
|
57
63
|
|
|
64
|
+
const mobileConfig = useMemo(() => {
|
|
65
|
+
const backgroundImage = getBackgroundImage({
|
|
66
|
+
entry: audio_item,
|
|
67
|
+
plugin_configuration,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
backgroundImage,
|
|
72
|
+
};
|
|
73
|
+
}, [audio_item, plugin_configuration]);
|
|
74
|
+
|
|
58
75
|
const getProp = useCallback(
|
|
59
76
|
getPropertyFromEntryOrConfig({
|
|
60
77
|
entry: audio_item,
|
|
@@ -63,15 +80,17 @@ export function AudioPlayer(props: Props) {
|
|
|
63
80
|
[audio_item, plugin_configuration]
|
|
64
81
|
);
|
|
65
82
|
|
|
66
|
-
const
|
|
83
|
+
const tvConfig = useMemo(() => {
|
|
67
84
|
// Checking if we are recieving items from the DSP
|
|
68
85
|
const titleColor = getProp("audio_player_title_color");
|
|
69
86
|
const summaryColor = getProp("audio_player_summary_color");
|
|
70
87
|
const backgroundColor = getProp("audio_player_background_color");
|
|
71
88
|
const backgroundImage = getProp("audio_player_background_image");
|
|
89
|
+
const backgroundImageKey = getProp("audio_player_background_image_key");
|
|
72
90
|
const artworkAspectRatio = getProp("audio_player_artwork_aspect_ratio");
|
|
73
91
|
const channelIcon = getProp("audio_player_channel_icon");
|
|
74
92
|
const rtlFlag = getProp("audio_player_rtl");
|
|
93
|
+
const artworkBorderRadius = getProp("audio_player_artwork_border_radius");
|
|
75
94
|
|
|
76
95
|
const audioPlayerBackgroundImageDefaultColor = getProp(
|
|
77
96
|
"audio_player_background_image_default_color"
|
|
@@ -144,6 +163,7 @@ export function AudioPlayer(props: Props) {
|
|
|
144
163
|
summaryColor,
|
|
145
164
|
backgroundColor,
|
|
146
165
|
backgroundImage,
|
|
166
|
+
backgroundImageKey,
|
|
147
167
|
isRTL,
|
|
148
168
|
titleFontFamily,
|
|
149
169
|
titleFontSize,
|
|
@@ -154,19 +174,36 @@ export function AudioPlayer(props: Props) {
|
|
|
154
174
|
artworkAspectRatio,
|
|
155
175
|
channelIcon,
|
|
156
176
|
audioPlayerBackgroundImageDefaultColor,
|
|
177
|
+
artworkBorderRadius,
|
|
157
178
|
};
|
|
158
179
|
}, [getProp]);
|
|
159
180
|
|
|
160
181
|
const artwork = imageSrcFromMediaItem(audio_item, [
|
|
161
|
-
|
|
182
|
+
tvConfig?.artworkAspectRatio,
|
|
162
183
|
]);
|
|
163
184
|
|
|
185
|
+
console.log("debug_2", "AudioPlayer", {
|
|
186
|
+
tvConfig,
|
|
187
|
+
mobileConfig,
|
|
188
|
+
audio_item,
|
|
189
|
+
plugin_configuration,
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
if (isTV()) {
|
|
193
|
+
return (
|
|
194
|
+
<AudioPlayerTVLayout artwork={artwork} config={tvConfig} style={style}>
|
|
195
|
+
<Channel srcImage={tvConfig?.channelIcon} config={tvConfig} />
|
|
196
|
+
<Title title={title} config={tvConfig} />
|
|
197
|
+
<Summary summary={summary} config={tvConfig} />
|
|
198
|
+
<Runtime {...extensions} config={tvConfig} />
|
|
199
|
+
</AudioPlayerTVLayout>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
164
203
|
return (
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<Runtime {...extensions} config={config} />
|
|
170
|
-
</AudioPlayerLayout>
|
|
204
|
+
<AudioPlayerMobileLayout
|
|
205
|
+
backgroundImage={mobileConfig.backgroundImage}
|
|
206
|
+
style={style}
|
|
207
|
+
/>
|
|
171
208
|
);
|
|
172
209
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 styles = StyleSheet.create({
|
|
12
|
+
flex: {
|
|
13
|
+
flex: 1,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
type Props = {
|
|
18
|
+
backgroundImage: string;
|
|
19
|
+
style: ViewStyle;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function AudioPlayerMobileLayout({ backgroundImage, style }: Props) {
|
|
23
|
+
const fadeAnimation = useRef(new Animated.Value(0)).current;
|
|
24
|
+
|
|
25
|
+
const mainContainerStyles = platformSelect({
|
|
26
|
+
native: {
|
|
27
|
+
backgroundColor: "transparent",
|
|
28
|
+
overflow: "hidden",
|
|
29
|
+
...style,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
Animated.timing(fadeAnimation, {
|
|
35
|
+
toValue: 1,
|
|
36
|
+
duration: 3000,
|
|
37
|
+
useNativeDriver: true,
|
|
38
|
+
}).start();
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<View style={mainContainerStyles} pointerEvents="none">
|
|
43
|
+
<Animated.View
|
|
44
|
+
style={[
|
|
45
|
+
mainContainerStyles,
|
|
46
|
+
{
|
|
47
|
+
opacity: fadeAnimation,
|
|
48
|
+
},
|
|
49
|
+
]}
|
|
50
|
+
>
|
|
51
|
+
<ImageBackground
|
|
52
|
+
source={{ uri: backgroundImage }}
|
|
53
|
+
style={styles.flex}
|
|
54
|
+
resizeMode="cover"
|
|
55
|
+
>
|
|
56
|
+
<View style={mainContainerStyles} />
|
|
57
|
+
</ImageBackground>
|
|
58
|
+
</Animated.View>
|
|
59
|
+
</View>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { View, ImageBackground,
|
|
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
|
|
|
@@ -14,22 +14,18 @@ type Props = {
|
|
|
14
14
|
backgroundColor: string;
|
|
15
15
|
backgroundImage: 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
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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:
|
|
44
|
-
height:
|
|
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
|
-
|
|
52
|
-
|
|
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:
|
|
101
|
-
height:
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
140
|
+
if (backgroundImageSource?.uri) {
|
|
141
|
+
return (
|
|
142
|
+
<ImageBackground
|
|
143
|
+
source={backgroundImageSource}
|
|
144
|
+
style={backgroundImgStyles}
|
|
145
|
+
resizeMode="cover"
|
|
146
|
+
>
|
|
147
|
+
<View style={mainContainerStyles}>
|
|
148
|
+
{!!artwork && <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
157
|
{!!artwork && <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:
|
|
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
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 ? "
|
|
30
|
-
fontSize:
|
|
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={
|
|
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
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 ? "
|
|
25
|
-
fontSize:
|
|
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={
|
|
36
|
+
<View style={styles.container}>
|
|
34
37
|
<Text style={textStyles(config)} numberOfLines={2}>
|
|
35
38
|
{title}
|
|
36
39
|
</Text>
|
|
@@ -20,7 +20,7 @@ exports[`<Runtime /> LTR renders correctly 1`] = `
|
|
|
20
20
|
"fontSize": 20,
|
|
21
21
|
"justifyContent": "flex-start",
|
|
22
22
|
"opacity": 0.8,
|
|
23
|
-
"textAlign": "
|
|
23
|
+
"textAlign": "left",
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
>
|
|
@@ -49,7 +49,7 @@ exports[`<Runtime /> RTL renders correctly 1`] = `
|
|
|
49
49
|
"fontSize": 20,
|
|
50
50
|
"justifyContent": "flex-end",
|
|
51
51
|
"opacity": 0.8,
|
|
52
|
-
"textAlign": "
|
|
52
|
+
"textAlign": "right",
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<
|
|
3
|
+
exports[`<AudioPlayerMobileLayout /> renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
pointerEvents="none"
|
|
6
6
|
style={
|
|
@@ -32,7 +32,7 @@ exports[`<AudioPlayerLayout /> renders correctly 1`] = `
|
|
|
32
32
|
resizeMode="cover"
|
|
33
33
|
source={
|
|
34
34
|
{
|
|
35
|
-
"uri":
|
|
35
|
+
"uri": undefined,
|
|
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 "../AudioPlayerMobileLayout";
|
|
5
|
+
|
|
6
|
+
const audioPlayerLayoutProps = {
|
|
7
|
+
backgroundColor: "black",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
describe("<AudioPlayerMobileLayout />", () => {
|
|
11
|
+
it("renders correctly", () => {
|
|
12
|
+
const { toJSON } = render(
|
|
13
|
+
<AudioPlayerMobileLayout {...audioPlayerLayoutProps} />
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
expect(toJSON()).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -26,14 +26,14 @@ export function getPropertyFromEntryOrConfig({ entry, plugin_configuration }) {
|
|
|
26
26
|
const LTR = {
|
|
27
27
|
flexDirection: "row",
|
|
28
28
|
justifyContent: "flex-start",
|
|
29
|
-
textAlign: "
|
|
29
|
+
textAlign: "left",
|
|
30
30
|
alignItems: "flex-end",
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const RTL = {
|
|
34
34
|
flexDirection: "row-reverse",
|
|
35
35
|
justifyContent: "flex-end",
|
|
36
|
-
textAlign: "
|
|
36
|
+
textAlign: "right",
|
|
37
37
|
alignItems: "flex-start",
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -30,7 +30,6 @@ export const GeneralContentScreen = ({
|
|
|
30
30
|
isScreenWrappedInContainer,
|
|
31
31
|
componentsMapExtraProps = {},
|
|
32
32
|
focused,
|
|
33
|
-
extraOffset,
|
|
34
33
|
parentFocus,
|
|
35
34
|
containerHeight,
|
|
36
35
|
preferredFocus = false,
|
|
@@ -122,7 +121,6 @@ export const GeneralContentScreen = ({
|
|
|
122
121
|
isScreenWrappedInContainer={isScreenWrappedInContainer}
|
|
123
122
|
parentFocus={parentFocus}
|
|
124
123
|
focused={focused}
|
|
125
|
-
extraOffset={extraOffset}
|
|
126
124
|
containerHeight={containerHeight}
|
|
127
125
|
preferredFocus={preferredFocus}
|
|
128
126
|
{...componentsMapExtraProps}
|