@applicaster/zapp-react-native-ui-components 15.1.15-alpha.4236143002 → 15.1.15

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 (24) hide show
  1. package/Components/GeneralContentScreen/GeneralContentScreenHookAdapter.tsx +15 -0
  2. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/factory.test.ts +32 -0
  3. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/index.ts +1 -2
  4. package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +1 -23
  5. package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +1 -36
  6. package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +1 -26
  7. package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +30 -25
  8. package/Components/ModalComponent/AudioPlayer/Components/NowPlayingHeaderSection.tsx +7 -2
  9. package/Components/ModalComponent/AudioPlayer/Components/__tests__/Item.test.tsx +48 -1
  10. package/Components/ModalComponent/AudioPlayer/Components/index.ts +0 -2
  11. package/Components/ModalComponent/AudioPlayer/utils/__tests__/mergeStyles.test.ts +18 -0
  12. package/Components/ModalComponent/AudioPlayer/utils/mergeStyles.ts +54 -0
  13. package/Components/ModalComponent/BottomSheetModalContent.tsx +92 -51
  14. package/Components/ModalComponent/SortableList.tsx +38 -23
  15. package/Components/ModalComponent/__tests__/BottomSheetModalContent.test.tsx +17 -0
  16. package/Components/ModalComponent/index.tsx +7 -9
  17. package/Components/River/ComponentsMap/ComponentsMap.tsx +87 -60
  18. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +139 -75
  19. package/Components/River/__tests__/componentsMap.test.js +8 -3
  20. package/Components/Screen/navigationHandler.ts +8 -8
  21. package/Contexts/ModalNavigationContext/__tests__/index.test.tsx +15 -0
  22. package/Contexts/ModalNavigationContext/index.tsx +2 -2
  23. package/package.json +5 -5
  24. package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +0 -314
@@ -13,95 +13,125 @@ exports[`componentsMap renders renders components map correctly 1`] = `
13
13
  >
14
14
  <RCTScrollView
15
15
  ListFooterComponent={
16
- <Memo(RiverFooterComponent)
17
- flatListHeight={null}
18
- loadingState={
19
- BehaviorSubject {
20
- "_value": {
21
- "done": false,
22
- "index": -1,
23
- "waitForAllComponents": false,
24
- },
25
- "closed": false,
26
- "currentObservers": null,
27
- "hasError": false,
28
- "isStopped": false,
29
- "observers": [
30
- SafeSubscriber {
31
- "_finalizers": [
32
- Subscription {
33
- "_finalizers": null,
34
- "_parentage": [Circular],
35
- "closed": false,
36
- "initialTeardown": [Function],
37
- },
38
- ],
39
- "_parentage": null,
40
- "closed": false,
41
- "destination": ConsumerObserver {
42
- "partialObserver": {
43
- "complete": undefined,
44
- "error": undefined,
45
- "next": [Function],
46
- },
47
- },
48
- "initialTeardown": undefined,
49
- "isStopped": false,
16
+ <React.Fragment>
17
+ <Memo(RiverFooterComponent)
18
+ flatListHeight={null}
19
+ loadingState={
20
+ BehaviorSubject {
21
+ "_value": {
22
+ "done": false,
23
+ "index": -1,
24
+ "waitForAllComponents": false,
50
25
  },
51
- SafeSubscriber {
52
- "_finalizers": [
53
- Subscription {
54
- "_finalizers": null,
55
- "_parentage": [Circular],
56
- "closed": false,
57
- "initialTeardown": [Function],
58
- },
59
- ],
60
- "_parentage": null,
61
- "closed": false,
62
- "destination": ConsumerObserver {
63
- "partialObserver": {
64
- "complete": undefined,
65
- "error": undefined,
66
- "next": [Function],
26
+ "closed": false,
27
+ "currentObservers": null,
28
+ "hasError": false,
29
+ "isStopped": false,
30
+ "observers": [
31
+ SafeSubscriber {
32
+ "_finalizers": [
33
+ Subscription {
34
+ "_finalizers": null,
35
+ "_parentage": [Circular],
36
+ "closed": false,
37
+ "initialTeardown": [Function],
38
+ },
39
+ ],
40
+ "_parentage": null,
41
+ "closed": false,
42
+ "destination": ConsumerObserver {
43
+ "partialObserver": {
44
+ "complete": undefined,
45
+ "error": undefined,
46
+ "next": [Function],
47
+ },
67
48
  },
49
+ "initialTeardown": undefined,
50
+ "isStopped": false,
68
51
  },
69
- "initialTeardown": undefined,
70
- "isStopped": false,
71
- },
72
- SafeSubscriber {
73
- "_finalizers": [
74
- Subscription {
75
- "_finalizers": null,
76
- "_parentage": [Circular],
77
- "closed": false,
78
- "initialTeardown": [Function],
52
+ SafeSubscriber {
53
+ "_finalizers": [
54
+ Subscription {
55
+ "_finalizers": null,
56
+ "_parentage": [Circular],
57
+ "closed": false,
58
+ "initialTeardown": [Function],
59
+ },
60
+ ],
61
+ "_parentage": null,
62
+ "closed": false,
63
+ "destination": ConsumerObserver {
64
+ "partialObserver": {
65
+ "complete": undefined,
66
+ "error": undefined,
67
+ "next": [Function],
68
+ },
79
69
  },
80
- ],
81
- "_parentage": null,
82
- "closed": false,
83
- "destination": ConsumerObserver {
84
- "partialObserver": {
85
- "complete": undefined,
86
- "error": undefined,
87
- "next": [Function],
70
+ "initialTeardown": undefined,
71
+ "isStopped": false,
72
+ },
73
+ SafeSubscriber {
74
+ "_finalizers": [
75
+ Subscription {
76
+ "_finalizers": null,
77
+ "_parentage": [Circular],
78
+ "closed": false,
79
+ "initialTeardown": [Function],
80
+ },
81
+ ],
82
+ "_parentage": null,
83
+ "closed": false,
84
+ "destination": ConsumerObserver {
85
+ "partialObserver": {
86
+ "complete": undefined,
87
+ "error": undefined,
88
+ "next": [Function],
89
+ },
88
90
  },
91
+ "initialTeardown": undefined,
92
+ "isStopped": false,
89
93
  },
90
- "initialTeardown": undefined,
91
- "isStopped": false,
92
- },
93
- ],
94
- "thrownError": null,
94
+ ],
95
+ "thrownError": null,
96
+ }
97
+ }
98
+ />
99
+ <View
100
+ edges={
101
+ {
102
+ "bottom": "off",
103
+ }
104
+ }
105
+ mode="margin"
106
+ style={
107
+ {
108
+ "height": 0.5,
109
+ "paddingBottom": undefined,
110
+ }
111
+ }
112
+ />
113
+ </React.Fragment>
114
+ }
115
+ ListHeaderComponent={
116
+ <View
117
+ edges={
118
+ {
119
+ "top": "off",
120
+ }
121
+ }
122
+ mode="margin"
123
+ style={
124
+ {
125
+ "height": 0.5,
126
+ "paddingTop": undefined,
95
127
  }
96
128
  }
97
129
  />
98
130
  }
99
131
  contentContainerStyle={
100
132
  {
101
- "paddingBottom": undefined,
102
133
  "paddingLeft": undefined,
103
134
  "paddingRight": undefined,
104
- "paddingTop": undefined,
105
135
  }
106
136
  }
107
137
  data={
@@ -150,10 +180,30 @@ exports[`componentsMap renders renders components map correctly 1`] = `
150
180
  }
151
181
  }
152
182
  stickyHeaderIndices={[]}
183
+ testID="components-map-flat-list"
153
184
  viewabilityConfigCallbackPairs={[]}
154
185
  windowSize={12}
155
186
  >
156
187
  <View>
188
+ <View
189
+ collapsable={false}
190
+ onLayout={[Function]}
191
+ >
192
+ <View
193
+ edges={
194
+ {
195
+ "top": "off",
196
+ }
197
+ }
198
+ mode="margin"
199
+ style={
200
+ {
201
+ "height": 0.5,
202
+ "paddingTop": undefined,
203
+ }
204
+ }
205
+ />
206
+ </View>
157
207
  <View
158
208
  onFocusCapture={[Function]}
159
209
  onLayout={[Function]}
@@ -196,6 +246,20 @@ exports[`componentsMap renders renders components map correctly 1`] = `
196
246
  size="large"
197
247
  />
198
248
  </View>
249
+ <View
250
+ edges={
251
+ {
252
+ "bottom": "off",
253
+ }
254
+ }
255
+ mode="margin"
256
+ style={
257
+ {
258
+ "height": 0.5,
259
+ "paddingBottom": undefined,
260
+ }
261
+ }
262
+ />
199
263
  </View>
200
264
  </View>
201
265
  </RCTScrollView>
@@ -11,9 +11,14 @@ jest.mock(
11
11
  () => () => null
12
12
  );
13
13
 
14
- jest.mock("react-native-safe-area-context", () => ({
15
- useSafeAreaInsets: () => ({ top: 50 }),
16
- }));
14
+ jest.mock("react-native-safe-area-context", () => {
15
+ const { View } = jest.requireActual("react-native");
16
+
17
+ return {
18
+ SafeAreaView: View,
19
+ useSafeAreaInsets: () => ({ top: 50 }),
20
+ };
21
+ });
17
22
 
18
23
  jest.mock("react-native", () => {
19
24
  const RN = jest.genMockFromModule("react-native");
@@ -18,10 +18,9 @@ function shouldShowNavigation(route, screenData) {
18
18
  return false;
19
19
  }
20
20
 
21
- if (
22
- screenData.type === "qb_search_screen" ||
23
- screenData?.targetScreen?.type === "qb_search_screen"
24
- ) {
21
+ const currentScreenData = screenData?.targetScreen || screenData;
22
+
23
+ if (currentScreenData.type === "qb_search_screen") {
25
24
  return false;
26
25
  }
27
26
 
@@ -31,10 +30,11 @@ function shouldShowNavigation(route, screenData) {
31
30
  return hookPlugin?.showNavBar || hookPlugin?.presentFullScreen !== true;
32
31
  }
33
32
 
34
- if (
35
- screenData?.general?.allow_screen_plugin_presentation ||
36
- screenData?.targetScreen?.general?.allow_screen_plugin_presentation
37
- ) {
33
+ if (currentScreenData?.general?.hide_menu) {
34
+ return false;
35
+ }
36
+
37
+ if (currentScreenData?.general?.allow_screen_plugin_presentation) {
38
38
  return false;
39
39
  }
40
40
 
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { render } from "@testing-library/react-native";
3
+ import { withModalNavigationContextProvider } from "../";
4
+
5
+ describe("withModalNavigationContextProvider", () => {
6
+ it("does not re-render the wrapped component when props are unchanged", () => {
7
+ const Component = jest.fn(() => null);
8
+ const WrappedComponent = withModalNavigationContextProvider(Component);
9
+ const { rerender } = render(<WrappedComponent title="Modal" />);
10
+
11
+ rerender(<WrappedComponent title="Modal" />);
12
+
13
+ expect(Component).toHaveBeenCalledTimes(1);
14
+ });
15
+ });
@@ -6,11 +6,11 @@ export function useModalNavigationContext() {
6
6
  }
7
7
 
8
8
  export function withModalNavigationContextProvider(Component) {
9
- return function WrappedWithModalNavigationContextProvider(props) {
9
+ return React.memo(function WrappedWithModalNavigationContextProvider(props) {
10
10
  return (
11
11
  <ModalNavigationContext.Provider value={true}>
12
12
  <Component {...props} />
13
13
  </ModalNavigationContext.Provider>
14
14
  );
15
- };
15
+ });
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "15.1.15-alpha.4236143002",
3
+ "version": "15.1.15",
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",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "15.1.15-alpha.4236143002",
32
- "@applicaster/zapp-react-native-bridge": "15.1.15-alpha.4236143002",
33
- "@applicaster/zapp-react-native-redux": "15.1.15-alpha.4236143002",
34
- "@applicaster/zapp-react-native-utils": "15.1.15-alpha.4236143002",
31
+ "@applicaster/applicaster-types": "15.1.15",
32
+ "@applicaster/zapp-react-native-bridge": "15.1.15",
33
+ "@applicaster/zapp-react-native-redux": "15.1.15",
34
+ "@applicaster/zapp-react-native-utils": "15.1.15",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "react-native-sortables": "1.7.1",
@@ -1,314 +0,0 @@
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
- });
29
-
30
- // ---------------------------------------------------------------------------
31
- // Configuration (green / editable fields from spec)
32
- // ---------------------------------------------------------------------------
33
-
34
- export type TextTransform =
35
- | "default"
36
- | "lowercase"
37
- | "uppercase"
38
- | "capitalize";
39
-
40
- export type BackgroundConfiguration = {
41
- defaultColor: string;
42
- focusedColor: string;
43
- cornerRadius: number;
44
- };
45
-
46
- export type TitleConfiguration = {
47
- fontColor: string;
48
- focusedFontColor: string;
49
- iosFontFamily: string;
50
- androidFontFamily: string;
51
- fontSize: number;
52
- lineHeight: number;
53
- iosLetterSpacing: number;
54
- androidLetterSpacing: number;
55
- textTransform: TextTransform;
56
- };
57
-
58
- export type TrailingIconConfiguration = {
59
- chevronAsset?: string;
60
- };
61
-
62
- export type ActionConfiguration = {
63
- background: BackgroundConfiguration;
64
- title: TitleConfiguration;
65
- trailingIcon: TrailingIconConfiguration;
66
- };
67
-
68
- export const DEFAULT_BACKGROUND_CONFIGURATION: BackgroundConfiguration = {
69
- defaultColor: "transparent",
70
- focusedColor: "rgba(62, 62, 62, 1)",
71
- cornerRadius: 12,
72
- };
73
-
74
- export const DEFAULT_TITLE_CONFIGURATION: TitleConfiguration = {
75
- fontColor: "#FFFFFF",
76
- focusedFontColor: "#FFFFFF",
77
- iosFontFamily: "SFProText-Semibold",
78
- androidFontFamily: "Roboto-Medium",
79
- fontSize: 15,
80
- lineHeight: 24,
81
- iosLetterSpacing: -0.2,
82
- androidLetterSpacing: 0,
83
- textTransform: "default",
84
- };
85
-
86
- export const DEFAULT_TRAILING_ICON_CONFIGURATION: TrailingIconConfiguration =
87
- {};
88
-
89
- export const DEFAULT_ACTION_CONFIGURATION: ActionConfiguration = {
90
- background: DEFAULT_BACKGROUND_CONFIGURATION,
91
- title: DEFAULT_TITLE_CONFIGURATION,
92
- trailingIcon: DEFAULT_TRAILING_ICON_CONFIGURATION,
93
- };
94
-
95
- // ---------------------------------------------------------------------------
96
- // Data (runtime — controls which elements are shown)
97
- // ---------------------------------------------------------------------------
98
-
99
- export type LeadingActionType =
100
- | "addToQueue"
101
- | "addToPlaylist"
102
- | "favorite"
103
- | "share"
104
- | "sleepTimer"
105
- | "playbackSpeed";
106
-
107
- export type ActionData = {
108
- title: string;
109
- /** When set, leading icon is shown (Enable: On). */
110
- leadingActionType?: LeadingActionType;
111
- /** When true, trailing chevron is shown (Enable: On). */
112
- showTrailingChevron?: boolean;
113
- };
114
-
115
- export type AudioPlayerActionProps = {
116
- configuration: ActionConfiguration;
117
- data: ActionData;
118
- focused?: boolean;
119
- onPress?: () => void;
120
- };
121
-
122
- // ---------------------------------------------------------------------------
123
- // Hardcoded spec values (white fields)
124
- // ---------------------------------------------------------------------------
125
-
126
- const CONTAINER_SPEC = {
127
- paddingTop: 13,
128
- paddingRight: 10,
129
- paddingBottom: 13,
130
- paddingLeft: 10,
131
- horizontalGutter: 12,
132
- };
133
-
134
- const ICON_SPEC = {
135
- width: 24,
136
- height: 24,
137
- };
138
-
139
- const DEFAULT_CHEVRON_ASSET =
140
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAALElEQVR42mNgGAXUBlu2bPmPjIeWBeiGDy0Lhrbrh1/qGXqZaxSMglEw0gEA4c+IpUrpYX4AAAAASUVORK5CYII=";
141
-
142
- /** Hardcoded: action type → leading icon asset (base64 PNG). */
143
- const LEADING_ICON_ASSETS: Record<LeadingActionType, string> = {
144
- addToQueue:
145
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAALElEQVR42mNgGAUjE/xHAzS3gFgweC0Y+nEwGslkBRFFwTj8LBjNyaNgmAMAJTf+EEEZcS0AAAAASUVORK5CYII=",
146
- addToPlaylist:
147
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAKUlEQVR42mNgGAVDBvxHA6MWjFpAvEGkglELKLdgNJmOWkA7C0YBzQAAivu+UKRR1ZIAAAAASUVORK5CYII=",
148
- favorite:
149
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAKklEQVR42mNgGAWjYBTgBP+xAGLkRi0YQhbgM4wqBo9aMHgsGAWjgCAAALyAZqh4yyZZAAAAAElFTkSuQmCC",
150
- share:
151
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAK0lEQVR42mNgGAVDDvxHAqMWjFowUiz4TwQYgRYQYxBFlo1aMPAWjAK6AgD2g7pUUT7VeAAAAABJRU5ErkJggg==",
152
- sleepTimer:
153
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAYUlEQVR42tWUSQ4AIAgD+f+n8eJRliIQ6MmEZTSxJZokvipdXgZpAbzOO17AglIXI7XULxmCoEMwRGuWam6AdRsN4IJYTRH4PIDkhxTA92zUPNBcFDDHaOVR0RJ2LXG9QgemFVK8tpo4PwAAAABJRU5ErkJggg==",
154
- playbackSpeed:
155
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAK0lEQVR42mNgGAVDDvxHAqMWjFowUiz4TwQYgRYQYxBFlo1aMPAWjAK6AgD2g7pUUT7VeAAAAABJRU5ErkJggg==",
156
- };
157
-
158
- function getTextTransformStyle(
159
- textTransform: TextTransform
160
- ): "none" | "lowercase" | "uppercase" | "capitalize" {
161
- return textTransform === "default" ? "none" : textTransform;
162
- }
163
-
164
- function shouldShowLeadingIcon(leadingActionType?: LeadingActionType) {
165
- return !!leadingActionType;
166
- }
167
-
168
- function shouldShowTrailingIcon(showTrailingChevron?: boolean) {
169
- return !!showTrailingChevron;
170
- }
171
-
172
- // ---------------------------------------------------------------------------
173
- // Inner components
174
- // ---------------------------------------------------------------------------
175
-
176
- type ActionContainerProps = {
177
- configuration: BackgroundConfiguration;
178
- focused: boolean;
179
- children: React.ReactNode;
180
- onPress?: () => void;
181
- };
182
-
183
- function ActionContainer({
184
- configuration,
185
- focused,
186
- children,
187
- onPress,
188
- }: ActionContainerProps) {
189
- return (
190
- <Pressable
191
- onPress={onPress}
192
- style={({ pressed }) => ({
193
- backgroundColor:
194
- pressed || focused
195
- ? configuration.focusedColor
196
- : configuration.defaultColor,
197
- borderRadius: configuration.cornerRadius,
198
- paddingTop: CONTAINER_SPEC.paddingTop,
199
- paddingRight: CONTAINER_SPEC.paddingRight,
200
- paddingBottom: CONTAINER_SPEC.paddingBottom,
201
- paddingLeft: CONTAINER_SPEC.paddingLeft,
202
- })}
203
- >
204
- {children}
205
- </Pressable>
206
- );
207
- }
208
-
209
- type ActionTitleProps = {
210
- title: string;
211
- configuration: TitleConfiguration;
212
- focused: boolean;
213
- };
214
-
215
- function ActionTitle({ title, configuration, focused }: ActionTitleProps) {
216
- const letterSpacing =
217
- Platform.OS === "ios"
218
- ? configuration.iosLetterSpacing
219
- : configuration.androidLetterSpacing;
220
-
221
- return (
222
- <Text
223
- style={{
224
- flex: 1,
225
- color: focused
226
- ? configuration.focusedFontColor
227
- : configuration.fontColor,
228
- fontSize: configuration.fontSize,
229
- lineHeight: configuration.lineHeight,
230
- letterSpacing,
231
- fontFamily: Platform.select({
232
- ios: configuration.iosFontFamily,
233
- android: configuration.androidFontFamily,
234
- default: configuration.androidFontFamily,
235
- }),
236
- textTransform: getTextTransformStyle(configuration.textTransform),
237
- }}
238
- numberOfLines={1}
239
- >
240
- {title}
241
- </Text>
242
- );
243
- }
244
-
245
- type ActionLeadingIconProps = {
246
- actionType: LeadingActionType;
247
- };
248
-
249
- function ActionLeadingIcon({ actionType }: ActionLeadingIconProps) {
250
- return (
251
- <Image
252
- source={{ uri: LEADING_ICON_ASSETS[actionType] }}
253
- style={{ width: ICON_SPEC.width, height: ICON_SPEC.height }}
254
- resizeMode="contain"
255
- />
256
- );
257
- }
258
-
259
- type ActionTrailingIconProps = {
260
- configuration: TrailingIconConfiguration;
261
- };
262
-
263
- function ActionTrailingIcon({ configuration }: ActionTrailingIconProps) {
264
- const asset = configuration.chevronAsset ?? DEFAULT_CHEVRON_ASSET;
265
-
266
- return (
267
- <Image
268
- source={{ uri: asset }}
269
- style={{ width: ICON_SPEC.width, height: ICON_SPEC.height }}
270
- resizeMode="contain"
271
- />
272
- );
273
- }
274
-
275
- // ---------------------------------------------------------------------------
276
- // AudioPlayerAction
277
- // ---------------------------------------------------------------------------
278
-
279
- export function AudioPlayerAction({
280
- configuration,
281
- data,
282
- focused = false,
283
- onPress,
284
- }: AudioPlayerActionProps) {
285
- const { background, title, trailingIcon } = configuration;
286
- const { title: label, leadingActionType, showTrailingChevron } = data;
287
-
288
- const showLeading = shouldShowLeadingIcon(leadingActionType);
289
- const showTrailing = shouldShowTrailingIcon(showTrailingChevron);
290
-
291
- return (
292
- <ActionContainer
293
- configuration={background}
294
- focused={focused}
295
- onPress={onPress}
296
- >
297
- <View style={styles.row}>
298
- {showLeading ? (
299
- <>
300
- <ActionLeadingIcon actionType={leadingActionType} />
301
- <View style={{ width: CONTAINER_SPEC.horizontalGutter }} />
302
- </>
303
- ) : null}
304
- <ActionTitle title={label} configuration={title} focused={focused} />
305
- {showTrailing ? (
306
- <>
307
- <View style={{ width: CONTAINER_SPEC.horizontalGutter }} />
308
- <ActionTrailingIcon configuration={trailingIcon} />
309
- </>
310
- ) : null}
311
- </View>
312
- </ActionContainer>
313
- );
314
- }