@applicaster/zapp-react-native-ui-components 16.0.0-alpha.7343517668 → 16.0.0-alpha.7845362739
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/CellRendererResolver/index.ts +1 -1
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/__tests__/placement.test.ts +47 -21
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/placement.ts +34 -6
- package/Components/MasterCell/DefaultComponents/Image/hoc/utils/__tests__/withDimensions.test.ts +420 -125
- package/Components/MasterCell/DefaultComponents/Image/hoc/utils/index.ts +114 -19
- package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +19 -8
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +5 -3
- package/Components/MasterCell/DefaultComponents/PressableView.tsx +29 -9
- package/Components/MasterCell/DefaultComponents/Text/hooks/useText.ts +4 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/ActionButton.tsx +154 -100
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/AssetComponent.tsx +15 -4
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/Button.ts +56 -22
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/Spacer.ts +6 -4
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/TextLabelsContainer.ts +3 -1
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/PressableView.test.tsx +32 -21
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/index.test.ts +15 -4
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/index.ts +23 -16
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/utils/__tests__/insertButtons.test.ts +8 -3
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/utils/index.ts +2 -2
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/__tests__/insertButtonsBetweenLabels.test.ts +45 -13
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/index.ts +2 -2
- package/Components/MasterCell/contexts/PressedStateContext.ts +3 -0
- package/Components/MasterCell/hooks/index.ts +2 -0
- package/Components/MasterCell/hooks/usePressedState.ts +4 -0
- package/Components/MasterCell/index.tsx +20 -4
- package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +332 -0
- package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +402 -0
- package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +811 -0
- package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +671 -0
- package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +878 -0
- package/Components/ModalComponent/AudioPlayer/Components/index.ts +9 -0
- package/Components/ModalComponent/BottomSheetDragArea.tsx +33 -0
- package/Components/ModalComponent/BottomSheetModalContent.tsx +49 -26
- package/Components/ModalComponent/__tests__/BottomSheetDragArea.test.tsx +74 -0
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +4 -85
- package/Components/OfflineHandler/__tests__/index.test.tsx +78 -18
- package/Components/OfflineHandler/hooks.ts +123 -0
- package/Components/OfflineHandler/index.tsx +51 -73
- package/Components/OfflineHandler/utils/index.ts +1 -13
- package/Components/PlayerContainer/PlayerContainer.tsx +7 -3
- package/Components/PreloaderWrapper/index.tsx +1 -1
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +2 -0
- package/Components/ScreenFeedLoader/ScreenFeedLoader.tsx +5 -3
- package/Components/ScreenResolverFeedProvider/ScreenResolverFeedProvider.tsx +1 -1
- package/Components/TopCutoffOverlay/index.tsx +2 -2
- package/Components/Transitioner/Transitioner.tsx +28 -17
- package/package.json +5 -5
- 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 -66
- package/Components/OfflineHandler/NotificationView/utils.ts +0 -34
- /package/Components/BackgroundImage/{BackgroundImage.tv.android.tsx → BackgroundImage.android.tv.tsx} +0 -0
- /package/Components/BackgroundImage/{BackgroundImage.tv.ios.tsx → BackgroundImage.ios.tv.tsx} +0 -0
- /package/Components/MasterCell/DefaultComponents/ButtonContainerView/{index.tv.android.tsx → index.android.tv.tsx} +0 -0
|
@@ -2,6 +2,8 @@ import * as R from "ramda";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { v4 as uuid } from "uuid";
|
|
4
4
|
|
|
5
|
+
import { isHorizontalList } from "@applicaster/zapp-react-native-utils/componentsUtils";
|
|
6
|
+
import { isVideoPreviewEnabled } from "@applicaster/zapp-react-native-ui-components/Components/MasterCell/utils";
|
|
5
7
|
import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
|
|
6
8
|
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
7
9
|
import { useScreenState } from "@applicaster/zapp-react-native-utils/screenState";
|
|
@@ -35,8 +37,8 @@ type MasterCellBuilderOptions = {
|
|
|
35
37
|
containerStyle: any;
|
|
36
38
|
cellOptions?: {
|
|
37
39
|
isRTL?: boolean;
|
|
38
|
-
generateId?: () => string;
|
|
39
40
|
skipButtons?: boolean;
|
|
41
|
+
component?: ZappComponent;
|
|
40
42
|
};
|
|
41
43
|
};
|
|
42
44
|
|
|
@@ -47,7 +49,7 @@ export function masterCellBuilder({
|
|
|
47
49
|
containerStyle = defaultContainerStyle,
|
|
48
50
|
cellOptions = {},
|
|
49
51
|
}: MasterCellBuilderOptions) {
|
|
50
|
-
const {
|
|
52
|
+
const { skipButtons = false, component } = cellOptions;
|
|
51
53
|
|
|
52
54
|
const componentsMap = R.merge(defaultComponents, components);
|
|
53
55
|
const { View } = componentsMap;
|
|
@@ -100,8 +102,22 @@ export function masterCellBuilder({
|
|
|
100
102
|
|
|
101
103
|
const wrapperRef = React.useRef(null);
|
|
102
104
|
|
|
103
|
-
const cellUUID = React.useMemo<string>(
|
|
104
|
-
|
|
105
|
+
const cellUUID = React.useMemo<string>(() => {
|
|
106
|
+
const isLiveImage = isVideoPreviewEnabled({
|
|
107
|
+
enable_video_preview: component?.rules?.enable_video_preview,
|
|
108
|
+
player_screen_id: component?.rules?.player_screen_id,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const isHL = isHorizontalList(component);
|
|
112
|
+
|
|
113
|
+
return isHL && isLiveImage
|
|
114
|
+
? `${component?.id}-${component?.styles?.cell_plugin_configuration_id}`
|
|
115
|
+
: uuid();
|
|
116
|
+
}, [
|
|
117
|
+
component?.id,
|
|
118
|
+
component?.styles?.cell_plugin_configuration_id,
|
|
119
|
+
component?.rules?.enable_video_preview,
|
|
120
|
+
component?.rules?.player_screen_id,
|
|
105
121
|
screenId,
|
|
106
122
|
item?.id,
|
|
107
123
|
]);
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal Building Block — Action
|
|
3
|
+
*
|
|
4
|
+
* Single-file Expo Snack demo for the Action list item building block spec.
|
|
5
|
+
* Three forms (text only / leading icon + text / leading + text + trailing)
|
|
6
|
+
* are driven by data — no separate variants.
|
|
7
|
+
*
|
|
8
|
+
* Green (configurable): background, title, trailingIcon.chevronAsset
|
|
9
|
+
* White (hardcoded): container padding/gutter, icon size, leading icon assets,
|
|
10
|
+
* leading/trailing visibility logic from data
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import React from "react";
|
|
14
|
+
import {
|
|
15
|
+
Image,
|
|
16
|
+
Platform,
|
|
17
|
+
Pressable,
|
|
18
|
+
StyleSheet,
|
|
19
|
+
Text,
|
|
20
|
+
View,
|
|
21
|
+
} from "react-native";
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
row: {
|
|
25
|
+
flexDirection: "row",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
},
|
|
28
|
+
demoScreen: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
backgroundColor: "#1C1C1E",
|
|
31
|
+
paddingTop: 64,
|
|
32
|
+
paddingHorizontal: 16,
|
|
33
|
+
gap: 12,
|
|
34
|
+
},
|
|
35
|
+
demoHeading: {
|
|
36
|
+
color: "#FFFFFF",
|
|
37
|
+
fontSize: 20,
|
|
38
|
+
fontWeight: "600",
|
|
39
|
+
marginBottom: 8,
|
|
40
|
+
},
|
|
41
|
+
demoLabel: {
|
|
42
|
+
color: "#999999",
|
|
43
|
+
fontSize: 13,
|
|
44
|
+
marginTop: 8,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// Configuration (green / editable fields from spec)
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
export type TextTransform =
|
|
53
|
+
| "default"
|
|
54
|
+
| "lowercase"
|
|
55
|
+
| "uppercase"
|
|
56
|
+
| "capitalize";
|
|
57
|
+
|
|
58
|
+
export type BackgroundConfiguration = {
|
|
59
|
+
defaultColor: string;
|
|
60
|
+
focusedColor: string;
|
|
61
|
+
cornerRadius: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type TitleConfiguration = {
|
|
65
|
+
fontColor: string;
|
|
66
|
+
focusedFontColor: string;
|
|
67
|
+
iosFontFamily: string;
|
|
68
|
+
androidFontFamily: string;
|
|
69
|
+
fontSize: number;
|
|
70
|
+
lineHeight: number;
|
|
71
|
+
iosLetterSpacing: number;
|
|
72
|
+
androidLetterSpacing: number;
|
|
73
|
+
textTransform: TextTransform;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type TrailingIconConfiguration = {
|
|
77
|
+
chevronAsset?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type ActionConfiguration = {
|
|
81
|
+
background: BackgroundConfiguration;
|
|
82
|
+
title: TitleConfiguration;
|
|
83
|
+
trailingIcon: TrailingIconConfiguration;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const DEFAULT_BACKGROUND_CONFIGURATION: BackgroundConfiguration = {
|
|
87
|
+
defaultColor: "transparent",
|
|
88
|
+
focusedColor: "rgba(62, 62, 62, 1)",
|
|
89
|
+
cornerRadius: 12,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const DEFAULT_TITLE_CONFIGURATION: TitleConfiguration = {
|
|
93
|
+
fontColor: "#FFFFFF",
|
|
94
|
+
focusedFontColor: "#FFFFFF",
|
|
95
|
+
iosFontFamily: "SFProText-Semibold",
|
|
96
|
+
androidFontFamily: "Roboto-Medium",
|
|
97
|
+
fontSize: 15,
|
|
98
|
+
lineHeight: 24,
|
|
99
|
+
iosLetterSpacing: -0.2,
|
|
100
|
+
androidLetterSpacing: 0,
|
|
101
|
+
textTransform: "default",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const DEFAULT_TRAILING_ICON_CONFIGURATION: TrailingIconConfiguration =
|
|
105
|
+
{};
|
|
106
|
+
|
|
107
|
+
export const DEFAULT_ACTION_CONFIGURATION: ActionConfiguration = {
|
|
108
|
+
background: DEFAULT_BACKGROUND_CONFIGURATION,
|
|
109
|
+
title: DEFAULT_TITLE_CONFIGURATION,
|
|
110
|
+
trailingIcon: DEFAULT_TRAILING_ICON_CONFIGURATION,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
// Data (runtime — controls which elements are shown)
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
|
|
117
|
+
export type LeadingActionType =
|
|
118
|
+
| "addToQueue"
|
|
119
|
+
| "addToPlaylist"
|
|
120
|
+
| "favorite"
|
|
121
|
+
| "share"
|
|
122
|
+
| "sleepTimer"
|
|
123
|
+
| "playbackSpeed";
|
|
124
|
+
|
|
125
|
+
export type ActionData = {
|
|
126
|
+
title: string;
|
|
127
|
+
/** When set, leading icon is shown (Enable: On). */
|
|
128
|
+
leadingActionType?: LeadingActionType;
|
|
129
|
+
/** When true, trailing chevron is shown (Enable: On). */
|
|
130
|
+
showTrailingChevron?: boolean;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type AudioPlayerActionProps = {
|
|
134
|
+
configuration: ActionConfiguration;
|
|
135
|
+
data: ActionData;
|
|
136
|
+
focused?: boolean;
|
|
137
|
+
onPress?: () => void;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
// Hardcoded spec values (white fields)
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
|
|
144
|
+
const CONTAINER_SPEC = {
|
|
145
|
+
paddingTop: 13,
|
|
146
|
+
paddingRight: 10,
|
|
147
|
+
paddingBottom: 13,
|
|
148
|
+
paddingLeft: 10,
|
|
149
|
+
horizontalGutter: 12,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const ICON_SPEC = {
|
|
153
|
+
width: 24,
|
|
154
|
+
height: 24,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const DEFAULT_CHEVRON_ASSET =
|
|
158
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAALElEQVR42mNgGAXUBlu2bPmPjIeWBeiGDy0Lhrbrh1/qGXqZaxSMglEw0gEA4c+IpUrpYX4AAAAASUVORK5CYII=";
|
|
159
|
+
|
|
160
|
+
/** Hardcoded: action type → leading icon asset (base64 PNG). */
|
|
161
|
+
const LEADING_ICON_ASSETS: Record<LeadingActionType, string> = {
|
|
162
|
+
addToQueue:
|
|
163
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAALElEQVR42mNgGAUjE/xHAzS3gFgweC0Y+nEwGslkBRFFwTj8LBjNyaNgmAMAJTf+EEEZcS0AAAAASUVORK5CYII=",
|
|
164
|
+
addToPlaylist:
|
|
165
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAKUlEQVR42mNgGAVDBvxHA6MWjFpAvEGkglELKLdgNJmOWkA7C0YBzQAAivu+UKRR1ZIAAAAASUVORK5CYII=",
|
|
166
|
+
favorite:
|
|
167
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAKklEQVR42mNgGAWjYBTgBP+xAGLkRi0YQhbgM4wqBo9aMHgsGAWjgCAAALyAZqh4yyZZAAAAAElFTkSuQmCC",
|
|
168
|
+
share:
|
|
169
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAK0lEQVR42mNgGAVDDvxHAqMWjFowUiz4TwQYgRYQYxBFlo1aMPAWjAK6AgD2g7pUUT7VeAAAAABJRU5ErkJggg==",
|
|
170
|
+
sleepTimer:
|
|
171
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAYUlEQVR42tWUSQ4AIAgD+f+n8eJRliIQ6MmEZTSxJZokvipdXgZpAbzOO17AglIXI7XULxmCoEMwRGuWam6AdRsN4IJYTRH4PIDkhxTA92zUPNBcFDDHaOVR0RJ2LXG9QgemFVK8tpo4PwAAAABJRU5ErkJggg==",
|
|
172
|
+
playbackSpeed:
|
|
173
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAK0lEQVR42mNgGAVDDvxHAqMWjFowUiz4TwQYgRYQYxBFlo1aMPAWjAK6AgD2g7pUUT7VeAAAAABJRU5ErkJggg==",
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
function getTextTransformStyle(
|
|
177
|
+
textTransform: TextTransform
|
|
178
|
+
): "none" | "lowercase" | "uppercase" | "capitalize" {
|
|
179
|
+
return textTransform === "default" ? "none" : textTransform;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function shouldShowLeadingIcon(leadingActionType?: LeadingActionType) {
|
|
183
|
+
return !!leadingActionType;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function shouldShowTrailingIcon(showTrailingChevron?: boolean) {
|
|
187
|
+
return !!showTrailingChevron;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
// Inner components
|
|
192
|
+
// ---------------------------------------------------------------------------
|
|
193
|
+
|
|
194
|
+
type ActionContainerProps = {
|
|
195
|
+
configuration: BackgroundConfiguration;
|
|
196
|
+
focused: boolean;
|
|
197
|
+
children: React.ReactNode;
|
|
198
|
+
onPress?: () => void;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
function ActionContainer({
|
|
202
|
+
configuration,
|
|
203
|
+
focused,
|
|
204
|
+
children,
|
|
205
|
+
onPress,
|
|
206
|
+
}: ActionContainerProps) {
|
|
207
|
+
return (
|
|
208
|
+
<Pressable
|
|
209
|
+
onPress={onPress}
|
|
210
|
+
style={({ pressed }) => ({
|
|
211
|
+
backgroundColor:
|
|
212
|
+
pressed || focused
|
|
213
|
+
? configuration.focusedColor
|
|
214
|
+
: configuration.defaultColor,
|
|
215
|
+
borderRadius: configuration.cornerRadius,
|
|
216
|
+
paddingTop: CONTAINER_SPEC.paddingTop,
|
|
217
|
+
paddingRight: CONTAINER_SPEC.paddingRight,
|
|
218
|
+
paddingBottom: CONTAINER_SPEC.paddingBottom,
|
|
219
|
+
paddingLeft: CONTAINER_SPEC.paddingLeft,
|
|
220
|
+
})}
|
|
221
|
+
>
|
|
222
|
+
{children}
|
|
223
|
+
</Pressable>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
type ActionTitleProps = {
|
|
228
|
+
title: string;
|
|
229
|
+
configuration: TitleConfiguration;
|
|
230
|
+
focused: boolean;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
function ActionTitle({ title, configuration, focused }: ActionTitleProps) {
|
|
234
|
+
const letterSpacing =
|
|
235
|
+
Platform.OS === "ios"
|
|
236
|
+
? configuration.iosLetterSpacing
|
|
237
|
+
: configuration.androidLetterSpacing;
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<Text
|
|
241
|
+
style={{
|
|
242
|
+
flex: 1,
|
|
243
|
+
color: focused
|
|
244
|
+
? configuration.focusedFontColor
|
|
245
|
+
: configuration.fontColor,
|
|
246
|
+
fontSize: configuration.fontSize,
|
|
247
|
+
lineHeight: configuration.lineHeight,
|
|
248
|
+
letterSpacing,
|
|
249
|
+
fontFamily: Platform.select({
|
|
250
|
+
ios: configuration.iosFontFamily,
|
|
251
|
+
android: configuration.androidFontFamily,
|
|
252
|
+
default: configuration.androidFontFamily,
|
|
253
|
+
}),
|
|
254
|
+
textTransform: getTextTransformStyle(configuration.textTransform),
|
|
255
|
+
}}
|
|
256
|
+
numberOfLines={1}
|
|
257
|
+
>
|
|
258
|
+
{title}
|
|
259
|
+
</Text>
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
type ActionLeadingIconProps = {
|
|
264
|
+
actionType: LeadingActionType;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
function ActionLeadingIcon({ actionType }: ActionLeadingIconProps) {
|
|
268
|
+
return (
|
|
269
|
+
<Image
|
|
270
|
+
source={{ uri: LEADING_ICON_ASSETS[actionType] }}
|
|
271
|
+
style={{ width: ICON_SPEC.width, height: ICON_SPEC.height }}
|
|
272
|
+
resizeMode="contain"
|
|
273
|
+
/>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
type ActionTrailingIconProps = {
|
|
278
|
+
configuration: TrailingIconConfiguration;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
function ActionTrailingIcon({ configuration }: ActionTrailingIconProps) {
|
|
282
|
+
const asset = configuration.chevronAsset ?? DEFAULT_CHEVRON_ASSET;
|
|
283
|
+
|
|
284
|
+
return (
|
|
285
|
+
<Image
|
|
286
|
+
source={{ uri: asset }}
|
|
287
|
+
style={{ width: ICON_SPEC.width, height: ICON_SPEC.height }}
|
|
288
|
+
resizeMode="contain"
|
|
289
|
+
/>
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// ---------------------------------------------------------------------------
|
|
294
|
+
// AudioPlayerAction
|
|
295
|
+
// ---------------------------------------------------------------------------
|
|
296
|
+
|
|
297
|
+
export function AudioPlayerAction({
|
|
298
|
+
configuration,
|
|
299
|
+
data,
|
|
300
|
+
focused = false,
|
|
301
|
+
onPress,
|
|
302
|
+
}: AudioPlayerActionProps) {
|
|
303
|
+
const { background, title, trailingIcon } = configuration;
|
|
304
|
+
const { title: label, leadingActionType, showTrailingChevron } = data;
|
|
305
|
+
|
|
306
|
+
const showLeading = shouldShowLeadingIcon(leadingActionType);
|
|
307
|
+
const showTrailing = shouldShowTrailingIcon(showTrailingChevron);
|
|
308
|
+
|
|
309
|
+
return (
|
|
310
|
+
<ActionContainer
|
|
311
|
+
configuration={background}
|
|
312
|
+
focused={focused}
|
|
313
|
+
onPress={onPress}
|
|
314
|
+
>
|
|
315
|
+
<View style={styles.row}>
|
|
316
|
+
{showLeading ? (
|
|
317
|
+
<>
|
|
318
|
+
<ActionLeadingIcon actionType={leadingActionType} />
|
|
319
|
+
<View style={{ width: CONTAINER_SPEC.horizontalGutter }} />
|
|
320
|
+
</>
|
|
321
|
+
) : null}
|
|
322
|
+
<ActionTitle title={label} configuration={title} focused={focused} />
|
|
323
|
+
{showTrailing ? (
|
|
324
|
+
<>
|
|
325
|
+
<View style={{ width: CONTAINER_SPEC.horizontalGutter }} />
|
|
326
|
+
<ActionTrailingIcon configuration={trailingIcon} />
|
|
327
|
+
</>
|
|
328
|
+
) : null}
|
|
329
|
+
</View>
|
|
330
|
+
</ActionContainer>
|
|
331
|
+
);
|
|
332
|
+
}
|