@applicaster/zapp-react-native-ui-components 12.0.0-alpha.5933014273 → 12.0.0-alpha.6158046395

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 (37) hide show
  1. package/Components/Cell/Cell.tsx +8 -1
  2. package/Components/Focusable/__tests__/index.android.test.tsx +72 -0
  3. package/Components/Focusable/index.android.tsx +15 -9
  4. package/Components/FocusableList/FocusableChild.ts +2 -2
  5. package/Components/FocusableList/index.tsx +11 -12
  6. package/Components/FocusableScrollView/index.tsx +1 -1
  7. package/Components/Image/Image.android.tsx +1 -1
  8. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +11 -5
  9. package/Components/MasterCell/DefaultComponents/CellBadge/index.tsx +6 -1
  10. package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +2 -3
  11. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +6 -5
  12. package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +2 -2
  13. package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
  14. package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
  15. package/Components/MasterCell/utils/index.ts +3 -4
  16. package/Components/PlayerContainer/PlayerContainer.tsx +14 -8
  17. package/Components/Transitioner/Transitioner.tsx +13 -3
  18. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +5 -0
  19. package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +3 -9
  20. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +38 -40
  21. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +9 -6
  22. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +28 -26
  23. package/Components/VideoModal/PlayerDetails.tsx +16 -2
  24. package/Components/VideoModal/PlayerWrapper.tsx +40 -10
  25. package/Components/VideoModal/VideoModal.tsx +33 -27
  26. package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +7 -0
  27. package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +2 -0
  28. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +56 -10
  29. package/Components/ZappFrameworkComponents/BarView/BarView.tsx +4 -1
  30. package/Components/ZappFrameworkComponents/BarView/Buttons/BackButton.tsx +7 -2
  31. package/Components/ZappFrameworkComponents/BarView/Buttons/CloseButton.tsx +7 -2
  32. package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +87 -0
  33. package/Components/ZappFrameworkComponents/Buttons/ActionButton.tsx +9 -4
  34. package/Contexts/CachedDimensionsContext/index.ts +13 -9
  35. package/Contexts/ConfirmDialogState/index.ts +1 -1
  36. package/Contexts/ScreenContext/index.tsx +6 -1
  37. package/package.json +5 -5
@@ -37,11 +37,14 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
37
37
  setStartComponentsAnimation,
38
38
  } = useModalAnimationContext();
39
39
 
40
- const { videoModalState } = useNavigation();
40
+ const {
41
+ videoModalState: { mode: videoModalMode },
42
+ } = useNavigation();
43
+
41
44
  const { isLanguageOverlayVisible } = React.useContext(PlayerContainerContext);
42
45
 
43
- const isMaximazedModal = videoModalState.mode === "MAXIMIZED";
44
- const isMinimizedModal = videoModalState.mode === "MINIMIZED";
46
+ const isMaximazedModal = videoModalMode === "MAXIMIZED";
47
+ const isMinimizedModal = videoModalMode === "MINIMIZED";
45
48
 
46
49
  const isEnablePanGesture =
47
50
  !isLanguageOverlayVisible && (isMaximazedModal || isMinimizedModal);
@@ -59,7 +62,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
59
62
  const preparedTranslationY = Math.abs(translationY);
60
63
  const dragToss = 0.05;
61
64
 
62
- if (videoModalState.mode === "MAXIMIZED") {
65
+ if (videoModalMode === "MAXIMIZED") {
63
66
  if (translationY > 0) {
64
67
  const endOffsetY =
65
68
  lastSnap + preparedTranslationY + dragToss * velocityY + 200;
@@ -84,7 +87,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
84
87
  setPlayerAnimationState(PlayerAnimationStateEnum.minimize);
85
88
  }
86
89
  }
87
- } else if (videoModalState.mode === "MINIMIZED") {
90
+ } else if (videoModalMode === "MINIMIZED") {
88
91
  if (translationY < 0) {
89
92
  // from mini to full
90
93
  setLastSnap(modalSnapPoints[0]);
@@ -100,7 +103,7 @@ export const AnimatedVideoPlayer = ({ children }: Props) => {
100
103
  }
101
104
  }
102
105
  },
103
- [lastSnap, modalSnapPoints, videoModalState.mode]
106
+ [lastSnap, modalSnapPoints, videoModalMode]
104
107
  );
105
108
 
106
109
  React.useEffect(() => {
@@ -60,9 +60,14 @@ export const AnimationView = ({
60
60
  const {
61
61
  width: screenWidth,
62
62
  deviceInfo: { isTablet, isTabletLandscape },
63
- } = useDimensions("window", { deviceInfo: true });
63
+ } = useDimensions("window", {
64
+ deviceInfo: true,
65
+ updateForInactiveScreens: true,
66
+ });
64
67
 
65
68
  const { videoModalState } = useNavigation();
69
+ const { mode: videoModalMode, item: videoModalItem } = videoModalState;
70
+
66
71
  const insets = useSafeAreaInsets();
67
72
  const bottomTabBarHeight = useGetBottomTabBarHeight() + (insets.bottom || 0);
68
73
  const minimisedWidth = defaultAspectRatioWidth(minimisedHeight);
@@ -85,9 +90,9 @@ export const AnimationView = ({
85
90
 
86
91
  const isAudioItem = React.useMemo(
87
92
  () =>
88
- videoModalState.item?.content?.type?.includes?.("audio") ||
89
- videoModalState.item?.type?.value === "audio",
90
- [videoModalState.item]
93
+ videoModalItem?.content?.type?.includes?.("audio") ||
94
+ videoModalItem?.type?.value === "audio",
95
+ [videoModalItem]
91
96
  );
92
97
 
93
98
  const inlineAudioPlayer = additionalData.inlineAudioPlayer;
@@ -226,10 +231,8 @@ export const AnimationView = ({
226
231
  );
227
232
 
228
233
  const getInitialValue = React.useCallback(() => {
229
- const mode =
230
- videoModalState.mode === "PIP"
231
- ? videoModalState.previousMode
232
- : videoModalState.mode;
234
+ const { mode: videoModalMode, previousMode } = videoModalState;
235
+ const mode = videoModalMode === "PIP" ? previousMode : videoModalMode;
233
236
 
234
237
  switch (mode) {
235
238
  case "MINIMIZED":
@@ -263,7 +266,7 @@ export const AnimationView = ({
263
266
  isTablet,
264
267
  isTabletLandscape,
265
268
  isRTL,
266
- fromMiniPlayer: videoModalState.mode === "MINIMIZED",
269
+ fromMiniPlayer: videoModalMode === "MINIMIZED",
267
270
  inlineAudioPlayer,
268
271
  }),
269
272
  [
@@ -273,7 +276,7 @@ export const AnimationView = ({
273
276
  defaultValue,
274
277
  moveUpValue,
275
278
  moveComponentHorizontalValue,
276
- videoModalState.mode,
279
+ videoModalMode,
277
280
  ]
278
281
  );
279
282
 
@@ -301,19 +304,23 @@ export const AnimationView = ({
301
304
  typeof additionalData.height === "number" && additionalData.height;
302
305
  }
303
306
 
304
- if (defaultValue.x === 0 && width && height) {
307
+ if (
308
+ videoModalMode === "MAXIMIZED" &&
309
+ defaultValue.x !== screenWidth &&
310
+ width &&
311
+ height
312
+ ) {
305
313
  const value = { x: width, y: height };
306
314
  setDefaultValue(value);
307
315
  animatedValue.setValue(value);
308
316
  }
309
317
  }
310
- }, [additionalData, screenWidth]);
318
+ }, [screenWidth]);
311
319
 
312
320
  React.useEffect(() => {
313
- if (
314
- videoModalState.mode === "MINIMIZED" &&
315
- videoModalState.previousMode === "MAXIMIZED"
316
- ) {
321
+ const { mode, previousMode } = videoModalState;
322
+
323
+ if (mode === "MINIMIZED" && previousMode === "MAXIMIZED") {
317
324
  // set animation to the minimize values if moving from the player to another screen
318
325
  if (playerAnimationState === null) {
319
326
  const value = getAnimationValue(
@@ -330,7 +337,7 @@ export const AnimationView = ({
330
337
  if (
331
338
  playerAnimationState === PlayerAnimationStateEnum.minimize &&
332
339
  startComponentsAnimation &&
333
- videoModalState.mode === "MAXIMIZED"
340
+ videoModalMode === "MAXIMIZED"
334
341
  ) {
335
342
  Animated.timing(
336
343
  animatedValue,
@@ -339,12 +346,7 @@ export const AnimationView = ({
339
346
  } else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
340
347
  animatedValue.setValue(defaultValue);
341
348
  }
342
- }, [
343
- playerAnimationState,
344
- startComponentsAnimation,
345
- videoModalState.mode,
346
- defaultValue,
347
- ]);
349
+ }, [playerAnimationState, startComponentsAnimation, defaultValue]);
348
350
 
349
351
  React.useEffect(() => {
350
352
  const dragVideoPlayerYListenerId = dragVideoPlayerY.addListener(
@@ -406,9 +408,9 @@ export const AnimationView = ({
406
408
  ref={animationComponentRef}
407
409
  style={[
408
410
  ...preparedStyles,
409
- (videoModalState.mode === "MAXIMIZED" ||
410
- videoModalState.mode === "MINIMIZED" ||
411
- (videoModalState.mode === "PIP" && isAppActive)) &&
411
+ (videoModalMode === "MAXIMIZED" ||
412
+ videoModalMode === "MINIMIZED" ||
413
+ (videoModalMode === "PIP" && isAppActive)) &&
412
414
  getAnimationStyle(animationType, animatedValue),
413
415
  ]}
414
416
  >
@@ -1,9 +1,17 @@
1
1
  import React, { useEffect, useRef } from "react";
2
- import { StyleProp, ViewStyle, Animated, Easing } from "react-native";
2
+ import {
3
+ StyleProp,
4
+ ViewStyle,
5
+ Animated,
6
+ Easing,
7
+ Dimensions,
8
+ } from "react-native";
3
9
  import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
4
10
  import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
5
11
  import { useSafeAreaInsets } from "react-native-safe-area-context";
6
12
 
13
+ const { width: SCREEN_WIDTH } = Dimensions.get("screen");
14
+
7
15
  type Configuration = {
8
16
  [key: string]: any;
9
17
  modal_background_color?: string;
@@ -15,6 +23,7 @@ type Props = {
15
23
  configuration: Configuration;
16
24
  isTabletLandscape: boolean;
17
25
  isAudioPlayer?: boolean;
26
+ isTablet: boolean;
18
27
  };
19
28
 
20
29
  const containerStyle = ({
@@ -31,6 +40,7 @@ export const PlayerDetails = ({
31
40
  configuration,
32
41
  isTabletLandscape,
33
42
  isAudioPlayer,
43
+ isTablet,
34
44
  }: Props) => {
35
45
  const screenData = useTargetScreenData(entry);
36
46
  const insets = useSafeAreaInsets();
@@ -77,7 +87,11 @@ export const PlayerDetails = ({
77
87
  transform: [{ translateY }],
78
88
  opacity,
79
89
  },
80
- // isAudioPlayer && audioMarginStyle,
90
+ {
91
+ // workaround for avoid wrong text-height after going back to portrait rotation
92
+ // we don't see this view in landscape mode, so we are able to use fixed width from portrait mode
93
+ width: isTablet ? undefined : SCREEN_WIDTH,
94
+ },
81
95
  ]}
82
96
  >
83
97
  {screenData && (
@@ -7,7 +7,6 @@ import {
7
7
  ViewStyle,
8
8
  } from "react-native";
9
9
  import { Edge, SafeAreaView } from "react-native-safe-area-context";
10
-
11
10
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
12
11
  import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
13
12
  import { PlayerDetails } from "./PlayerDetails";
@@ -23,6 +22,8 @@ import {
23
22
  ComponentAnimationType,
24
23
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
25
24
 
25
+ const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
26
+
26
27
  type DimensionsT = {
27
28
  width: number | string;
28
29
  height: number | string | undefined;
@@ -69,10 +70,8 @@ const directionStyles = (isTabletLandscape: boolean): ViewStyle => {
69
70
  };
70
71
 
71
72
  const getScreenAspectRatio = () => {
72
- const { width, height } = Dimensions.get("screen");
73
-
74
- const longEdge = Math.max(width, height);
75
- const shortEdge = Math.min(width, height);
73
+ const longEdge = Math.max(SCREEN_WIDTH, SCREEN_HEIGHT);
74
+ const shortEdge = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT);
76
75
 
77
76
  return longEdge / shortEdge;
78
77
  };
@@ -125,10 +124,37 @@ const getTabletWidth = (
125
124
  return Number(width) - sidebarWidth;
126
125
  };
127
126
 
128
- export const PlayerWrapper = (props: Props) => {
127
+ const getStyles = (baseStyle, isMobile, isPortrait) => {
128
+ if (isMobile && isPortrait) {
129
+ return { width: SCREEN_WIDTH, height: SCREEN_HEIGHT };
130
+ }
131
+
132
+ if (isMobile && !isPortrait) {
133
+ return { width: SCREEN_HEIGHT, height: SCREEN_WIDTH };
134
+ }
135
+
136
+ return baseStyle;
137
+ };
138
+
139
+ const showDetails = (isMobile: boolean, docked: boolean): boolean => {
140
+ // for mobile we always show details. Mounting of it very heavy operation.
141
+ if (isMobile) {
142
+ return true;
143
+ }
144
+
145
+ // workaround for tablets we need to mount/unmount in order to avoid PlayerDetails content dissappearing
146
+ // FIXME - find out the reason of dissapearing of content
147
+ if (docked) {
148
+ return false;
149
+ }
150
+
151
+ return true;
152
+ };
153
+
154
+ const PlayerWrapperComponent = (props: Props) => {
129
155
  const {
130
156
  entry,
131
- style,
157
+ style: baseStyle,
132
158
  containerStyle,
133
159
  inline,
134
160
  docked,
@@ -143,6 +169,8 @@ export const PlayerWrapper = (props: Props) => {
143
169
 
144
170
  const isInlineModal = inline && isModal;
145
171
 
172
+ const style = getStyles(baseStyle, !isTablet, isInlineModal);
173
+
146
174
  const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
147
175
 
148
176
  const tabletWidth = getTabletWidth(configuration, style);
@@ -224,8 +252,9 @@ export const PlayerWrapper = (props: Props) => {
224
252
  </AnimatedVideoPlayerComponent>
225
253
  </AnimationComponent>
226
254
  </View>
255
+
227
256
  <AnimatedScrollModal>
228
- {isInlineModal && !docked ? (
257
+ {showDetails(!isTablet, docked) && (
229
258
  <AnimationComponent
230
259
  animationType={ComponentAnimationType.componentFade}
231
260
  style={defaultStyles.flex}
@@ -235,10 +264,9 @@ export const PlayerWrapper = (props: Props) => {
235
264
  style={defaultStyles.playerDetails}
236
265
  entry={entry}
237
266
  isTabletLandscape={isTabletLandscape}
267
+ isTablet={isTablet}
238
268
  />
239
269
  </AnimationComponent>
240
- ) : (
241
- <View style={defaultStyles.playerDetails} />
242
270
  )}
243
271
  </AnimatedScrollModal>
244
272
  </ScreenContextProvider>
@@ -249,3 +277,5 @@ export const PlayerWrapper = (props: Props) => {
249
277
  </PathnameContext.Provider>
250
278
  );
251
279
  };
280
+
281
+ export const PlayerWrapper = PlayerWrapperComponent;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import * as R from "ramda";
3
- import { StyleSheet, View } from "react-native";
3
+ import { StyleSheet, View, StatusBar } from "react-native";
4
4
 
5
5
  import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
6
6
  import {
@@ -129,32 +129,38 @@ const VideoModalComponent = () => {
129
129
  const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${item?.id}`;
130
130
 
131
131
  return (
132
- <PathnameContext.Provider value={pathname}>
133
- <ScreenContextProvider pathname={pathname}>
134
- {itemIdHooksFinished === item?.id ? (
135
- <AnimatedPlayerModalWrapper
136
- style={[
137
- styles.container,
138
- {
139
- backgroundColor,
140
- },
141
- ]}
142
- >
143
- <HandlePlayable
144
- item={item}
145
- isModal={mode !== "PIP"}
146
- modalHeight={modalSize.height}
147
- modalWidth={modalSize.width}
148
- mode={mode}
149
- />
150
- </AnimatedPlayerModalWrapper>
151
- ) : (
152
- <View style={styles.loaderContainer}>
153
- <Spinner />
154
- </View>
155
- )}
156
- </ScreenContextProvider>
157
- </PathnameContext.Provider>
132
+ <>
133
+ {/* TODO: Workaround to avoid unnecessary UI effect when switching from portrait to fullscreen */}
134
+ <StatusBar hidden={false} />
135
+ {/* TODO: Workaround to avoid unnecessary UI effect when switching from portrait to fullscreen */}
136
+
137
+ <PathnameContext.Provider value={pathname}>
138
+ <ScreenContextProvider pathname={pathname}>
139
+ {itemIdHooksFinished === item?.id ? (
140
+ <AnimatedPlayerModalWrapper
141
+ style={[
142
+ styles.container,
143
+ {
144
+ backgroundColor,
145
+ },
146
+ ]}
147
+ >
148
+ <HandlePlayable
149
+ item={item}
150
+ isModal={mode !== "PIP"}
151
+ modalHeight={modalSize.height}
152
+ modalWidth={modalSize.width}
153
+ mode={mode}
154
+ />
155
+ </AnimatedPlayerModalWrapper>
156
+ ) : (
157
+ <View style={styles.loaderContainer}>
158
+ <Spinner />
159
+ </View>
160
+ )}
161
+ </ScreenContextProvider>
162
+ </PathnameContext.Provider>
163
+ </>
158
164
  );
159
165
  };
160
166
 
@@ -8,6 +8,13 @@ const props = {
8
8
  configuration: { modal_background_color: "transparent" },
9
9
  };
10
10
 
11
+ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/layout", () => ({
12
+ useDimensions: jest.fn(() => ({
13
+ width: 20,
14
+ height: 30,
15
+ })),
16
+ }));
17
+
11
18
  jest.mock("react-native-safe-area-context", () => ({
12
19
  useSafeAreaInsets: jest.fn(() => ({
13
20
  top: 20,
@@ -9,6 +9,7 @@ exports[`PlayerDetails renders properly 1`] = `
9
9
  "flex": 1,
10
10
  "marginTop": -8,
11
11
  "paddingTop": -8,
12
+ "width": 750,
12
13
  }
13
14
  }
14
15
  >
@@ -29,6 +30,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
29
30
  "flex": 1,
30
31
  "marginTop": -20,
31
32
  "paddingTop": 40,
33
+ "width": 750,
32
34
  }
33
35
  }
34
36
  >
@@ -27,8 +27,8 @@ exports[`PlayerWrapper renders inline 1`] = `
27
27
  "backgroundColor": "transparent",
28
28
  },
29
29
  Object {
30
- "height": 800,
31
- "width": 300,
30
+ "height": 1334,
31
+ "width": 750,
32
32
  },
33
33
  Object {},
34
34
  ]
@@ -91,6 +91,7 @@ exports[`PlayerWrapper renders inline 1`] = `
91
91
  "id": "test",
92
92
  }
93
93
  }
94
+ isTablet={false}
94
95
  isTabletLandscape={false}
95
96
  style={
96
97
  Object {
@@ -132,8 +133,8 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
132
133
  "backgroundColor": "transparent",
133
134
  },
134
135
  Object {
135
- "height": undefined,
136
- "width": 300,
136
+ "height": 1334,
137
+ "width": 750,
137
138
  },
138
139
  Object {},
139
140
  ]
@@ -177,13 +178,35 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
177
178
  testID="test-player-container"
178
179
  />
179
180
  <View
181
+ animationType="componentFade"
180
182
  style={
181
183
  Object {
182
184
  "flex": 1,
183
- "paddingTop": 20,
184
185
  }
185
186
  }
186
- />
187
+ >
188
+ <View
189
+ configuration={
190
+ Object {
191
+ "tablet_landscape_player_container_background_color": "red",
192
+ "tablet_landscape_sidebar_width": "35%",
193
+ }
194
+ }
195
+ entry={
196
+ Object {
197
+ "id": "test",
198
+ }
199
+ }
200
+ isTablet={false}
201
+ isTabletLandscape={false}
202
+ style={
203
+ Object {
204
+ "flex": 1,
205
+ "paddingTop": 20,
206
+ }
207
+ }
208
+ />
209
+ </View>
187
210
  </View>
188
211
  </RNCSafeAreaView>
189
212
  </RNCSafeAreaProvider>
@@ -296,6 +319,7 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
296
319
  "id": "test",
297
320
  }
298
321
  }
322
+ isTablet={true}
299
323
  isTabletLandscape={true}
300
324
  style={
301
325
  Object {
@@ -337,8 +361,8 @@ exports[`PlayerWrapper renders properly 1`] = `
337
361
  "backgroundColor": "transparent",
338
362
  },
339
363
  Object {
340
- "height": 800,
341
- "width": 300,
364
+ "height": 750,
365
+ "width": 1334,
342
366
  },
343
367
  Object {},
344
368
  ]
@@ -382,13 +406,35 @@ exports[`PlayerWrapper renders properly 1`] = `
382
406
  testID="test-player-container"
383
407
  />
384
408
  <View
409
+ animationType="componentFade"
385
410
  style={
386
411
  Object {
387
412
  "flex": 1,
388
- "paddingTop": 20,
389
413
  }
390
414
  }
391
- />
415
+ >
416
+ <View
417
+ configuration={
418
+ Object {
419
+ "tablet_landscape_player_container_background_color": "red",
420
+ "tablet_landscape_sidebar_width": "35%",
421
+ }
422
+ }
423
+ entry={
424
+ Object {
425
+ "id": "test",
426
+ }
427
+ }
428
+ isTablet={false}
429
+ isTabletLandscape={false}
430
+ style={
431
+ Object {
432
+ "flex": 1,
433
+ "paddingTop": 20,
434
+ }
435
+ }
436
+ />
437
+ </View>
392
438
  </View>
393
439
  </RNCSafeAreaView>
394
440
  </RNCSafeAreaProvider>
@@ -45,7 +45,10 @@ const BarView = ({ screenStyles, barState = defaultState }: Props) => {
45
45
  );
46
46
 
47
47
  return (
48
- <SafeAreaView style={[style.view, isRTL ? style.rtlStyle : {}]}>
48
+ <SafeAreaView
49
+ style={[style.view, isRTL ? style.rtlStyle : {}]}
50
+ testID="BarView-safeAreaView"
51
+ >
49
52
  {backButton}
50
53
  <BarTitle title={barState.title} screenStyles={screenStyles} />
51
54
  {closeButton}
@@ -11,12 +11,16 @@ const renderEmptyView = () => {
11
11
  return <View style={emptyViewStyle} />;
12
12
  };
13
13
 
14
- type FloatingButtonProps = {
14
+ type FloatingButtonProps = Testable & {
15
15
  onPress: () => void;
16
16
  screenStyles: any;
17
17
  };
18
18
 
19
- const BackButton = ({ onPress, screenStyles }: FloatingButtonProps) => {
19
+ const BackButton = ({
20
+ onPress,
21
+ screenStyles,
22
+ testID = "backButton",
23
+ }: FloatingButtonProps) => {
20
24
  const containerStyle: any = {};
21
25
 
22
26
  if (!onPress) {
@@ -25,6 +29,7 @@ const BackButton = ({ onPress, screenStyles }: FloatingButtonProps) => {
25
29
 
26
30
  return (
27
31
  <ActionButton
32
+ testID={`${testID}-actionButton`}
28
33
  onPress={onPress}
29
34
  buttonStyles={containerStyle}
30
35
  imageUrl={screenStyles.back_button_image}
@@ -11,12 +11,16 @@ const renderEmptyView = () => {
11
11
  return <View style={emptyViewStyle} />;
12
12
  };
13
13
 
14
- type CloseButtonProps = {
14
+ type CloseButtonProps = Testable & {
15
15
  onPress: () => void;
16
16
  screenStyles?: any;
17
17
  };
18
18
 
19
- const CloseButton = ({ onPress, screenStyles }: CloseButtonProps) => {
19
+ const CloseButton = ({
20
+ onPress,
21
+ screenStyles,
22
+ testID = "closeButton",
23
+ }: CloseButtonProps) => {
20
24
  const containerStyle: any = {};
21
25
 
22
26
  if (!onPress) {
@@ -25,6 +29,7 @@ const CloseButton = ({ onPress, screenStyles }: CloseButtonProps) => {
25
29
 
26
30
  return (
27
31
  <ActionButton
32
+ testID={`${testID}-actionButton`}
28
33
  onPress={onPress}
29
34
  buttonStyles={containerStyle}
30
35
  imageUrl={screenStyles.close_button_image}