@applicaster/zapp-react-native-ui-components 12.0.0-alpha.4620237415 → 12.0.0-alpha.4739493702

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 +1 -8
  2. package/Components/Focusable/index.android.tsx +9 -15
  3. package/Components/FocusableList/FocusableChild.ts +2 -2
  4. package/Components/FocusableList/index.tsx +12 -11
  5. package/Components/FocusableScrollView/index.tsx +1 -1
  6. package/Components/Image/Image.android.tsx +1 -1
  7. package/Components/MasterCell/DefaultComponents/CellBadge/index.tsx +1 -6
  8. package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +0 -12
  9. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +5 -6
  10. package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +2 -2
  11. package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
  12. package/Components/MasterCell/utils/index.ts +4 -3
  13. package/Components/PlayerContainer/PlayerContainer.tsx +8 -14
  14. package/Components/Transitioner/Transitioner.tsx +3 -13
  15. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +0 -5
  16. package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +9 -3
  17. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +40 -38
  18. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +6 -9
  19. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +26 -28
  20. package/Components/VideoModal/PlayerDetails.tsx +2 -16
  21. package/Components/VideoModal/PlayerWrapper.tsx +10 -40
  22. package/Components/VideoModal/VideoModal.tsx +27 -33
  23. package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +0 -7
  24. package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +0 -2
  25. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +10 -56
  26. package/Components/ZappFrameworkComponents/BarView/BarView.tsx +1 -4
  27. package/Components/ZappFrameworkComponents/BarView/Buttons/BackButton.tsx +2 -7
  28. package/Components/ZappFrameworkComponents/BarView/Buttons/CloseButton.tsx +2 -7
  29. package/Components/ZappFrameworkComponents/Buttons/ActionButton.tsx +4 -9
  30. package/Contexts/CachedDimensionsContext/index.ts +9 -13
  31. package/Contexts/ConfirmDialogState/index.ts +1 -1
  32. package/Contexts/ScreenContext/index.tsx +1 -6
  33. package/const.ts +0 -6
  34. package/index.js +0 -3
  35. package/package.json +5 -5
  36. package/Components/Focusable/__tests__/index.android.test.tsx +0 -72
  37. package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +0 -87
@@ -60,14 +60,9 @@ export const AnimationView = ({
60
60
  const {
61
61
  width: screenWidth,
62
62
  deviceInfo: { isTablet, isTabletLandscape },
63
- } = useDimensions("window", {
64
- deviceInfo: true,
65
- updateForInactiveScreens: true,
66
- });
63
+ } = useDimensions("window", { deviceInfo: true });
67
64
 
68
65
  const { videoModalState } = useNavigation();
69
- const { mode: videoModalMode, item: videoModalItem } = videoModalState;
70
-
71
66
  const insets = useSafeAreaInsets();
72
67
  const bottomTabBarHeight = useGetBottomTabBarHeight() + (insets.bottom || 0);
73
68
  const minimisedWidth = defaultAspectRatioWidth(minimisedHeight);
@@ -90,9 +85,9 @@ export const AnimationView = ({
90
85
 
91
86
  const isAudioItem = React.useMemo(
92
87
  () =>
93
- videoModalItem?.content?.type?.includes?.("audio") ||
94
- videoModalItem?.type?.value === "audio",
95
- [videoModalItem]
88
+ videoModalState.item?.content?.type?.includes?.("audio") ||
89
+ videoModalState.item?.type?.value === "audio",
90
+ [videoModalState.item]
96
91
  );
97
92
 
98
93
  const inlineAudioPlayer = additionalData.inlineAudioPlayer;
@@ -231,8 +226,10 @@ export const AnimationView = ({
231
226
  );
232
227
 
233
228
  const getInitialValue = React.useCallback(() => {
234
- const { mode: videoModalMode, previousMode } = videoModalState;
235
- const mode = videoModalMode === "PIP" ? previousMode : videoModalMode;
229
+ const mode =
230
+ videoModalState.mode === "PIP"
231
+ ? videoModalState.previousMode
232
+ : videoModalState.mode;
236
233
 
237
234
  switch (mode) {
238
235
  case "MINIMIZED":
@@ -266,7 +263,7 @@ export const AnimationView = ({
266
263
  isTablet,
267
264
  isTabletLandscape,
268
265
  isRTL,
269
- fromMiniPlayer: videoModalMode === "MINIMIZED",
266
+ fromMiniPlayer: videoModalState.mode === "MINIMIZED",
270
267
  inlineAudioPlayer,
271
268
  }),
272
269
  [
@@ -276,7 +273,7 @@ export const AnimationView = ({
276
273
  defaultValue,
277
274
  moveUpValue,
278
275
  moveComponentHorizontalValue,
279
- videoModalMode,
276
+ videoModalState.mode,
280
277
  ]
281
278
  );
282
279
 
@@ -304,23 +301,19 @@ export const AnimationView = ({
304
301
  typeof additionalData.height === "number" && additionalData.height;
305
302
  }
306
303
 
307
- if (
308
- videoModalMode === "MAXIMIZED" &&
309
- defaultValue.x !== screenWidth &&
310
- width &&
311
- height
312
- ) {
304
+ if (defaultValue.x === 0 && width && height) {
313
305
  const value = { x: width, y: height };
314
306
  setDefaultValue(value);
315
307
  animatedValue.setValue(value);
316
308
  }
317
309
  }
318
- }, [screenWidth]);
310
+ }, [additionalData, screenWidth]);
319
311
 
320
312
  React.useEffect(() => {
321
- const { mode, previousMode } = videoModalState;
322
-
323
- if (mode === "MINIMIZED" && previousMode === "MAXIMIZED") {
313
+ if (
314
+ videoModalState.mode === "MINIMIZED" &&
315
+ videoModalState.previousMode === "MAXIMIZED"
316
+ ) {
324
317
  // set animation to the minimize values if moving from the player to another screen
325
318
  if (playerAnimationState === null) {
326
319
  const value = getAnimationValue(
@@ -337,7 +330,7 @@ export const AnimationView = ({
337
330
  if (
338
331
  playerAnimationState === PlayerAnimationStateEnum.minimize &&
339
332
  startComponentsAnimation &&
340
- videoModalMode === "MAXIMIZED"
333
+ videoModalState.mode === "MAXIMIZED"
341
334
  ) {
342
335
  Animated.timing(
343
336
  animatedValue,
@@ -346,7 +339,12 @@ export const AnimationView = ({
346
339
  } else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
347
340
  animatedValue.setValue(defaultValue);
348
341
  }
349
- }, [playerAnimationState, startComponentsAnimation, defaultValue]);
342
+ }, [
343
+ playerAnimationState,
344
+ startComponentsAnimation,
345
+ videoModalState.mode,
346
+ defaultValue,
347
+ ]);
350
348
 
351
349
  React.useEffect(() => {
352
350
  const dragVideoPlayerYListenerId = dragVideoPlayerY.addListener(
@@ -408,9 +406,9 @@ export const AnimationView = ({
408
406
  ref={animationComponentRef}
409
407
  style={[
410
408
  ...preparedStyles,
411
- (videoModalMode === "MAXIMIZED" ||
412
- videoModalMode === "MINIMIZED" ||
413
- (videoModalMode === "PIP" && isAppActive)) &&
409
+ (videoModalState.mode === "MAXIMIZED" ||
410
+ videoModalState.mode === "MINIMIZED" ||
411
+ (videoModalState.mode === "PIP" && isAppActive)) &&
414
412
  getAnimationStyle(animationType, animatedValue),
415
413
  ]}
416
414
  >
@@ -1,17 +1,9 @@
1
1
  import React, { useEffect, useRef } from "react";
2
- import {
3
- StyleProp,
4
- ViewStyle,
5
- Animated,
6
- Easing,
7
- Dimensions,
8
- } from "react-native";
2
+ import { StyleProp, ViewStyle, Animated, Easing } from "react-native";
9
3
  import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
10
4
  import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
11
5
  import { useSafeAreaInsets } from "react-native-safe-area-context";
12
6
 
13
- const { width: SCREEN_WIDTH } = Dimensions.get("screen");
14
-
15
7
  type Configuration = {
16
8
  [key: string]: any;
17
9
  modal_background_color?: string;
@@ -23,7 +15,6 @@ type Props = {
23
15
  configuration: Configuration;
24
16
  isTabletLandscape: boolean;
25
17
  isAudioPlayer?: boolean;
26
- isTablet: boolean;
27
18
  };
28
19
 
29
20
  const containerStyle = ({
@@ -40,7 +31,6 @@ export const PlayerDetails = ({
40
31
  configuration,
41
32
  isTabletLandscape,
42
33
  isAudioPlayer,
43
- isTablet,
44
34
  }: Props) => {
45
35
  const screenData = useTargetScreenData(entry);
46
36
  const insets = useSafeAreaInsets();
@@ -87,11 +77,7 @@ export const PlayerDetails = ({
87
77
  transform: [{ translateY }],
88
78
  opacity,
89
79
  },
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
- },
80
+ // isAudioPlayer && audioMarginStyle,
95
81
  ]}
96
82
  >
97
83
  {screenData && (
@@ -7,6 +7,7 @@ import {
7
7
  ViewStyle,
8
8
  } from "react-native";
9
9
  import { Edge, SafeAreaView } from "react-native-safe-area-context";
10
+
10
11
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
11
12
  import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
12
13
  import { PlayerDetails } from "./PlayerDetails";
@@ -22,8 +23,6 @@ import {
22
23
  ComponentAnimationType,
23
24
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
24
25
 
25
- const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
26
-
27
26
  type DimensionsT = {
28
27
  width: number | string;
29
28
  height: number | string | undefined;
@@ -70,8 +69,10 @@ const directionStyles = (isTabletLandscape: boolean): ViewStyle => {
70
69
  };
71
70
 
72
71
  const getScreenAspectRatio = () => {
73
- const longEdge = Math.max(SCREEN_WIDTH, SCREEN_HEIGHT);
74
- const shortEdge = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT);
72
+ const { width, height } = Dimensions.get("screen");
73
+
74
+ const longEdge = Math.max(width, height);
75
+ const shortEdge = Math.min(width, height);
75
76
 
76
77
  return longEdge / shortEdge;
77
78
  };
@@ -124,37 +125,10 @@ const getTabletWidth = (
124
125
  return Number(width) - sidebarWidth;
125
126
  };
126
127
 
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) => {
128
+ export const PlayerWrapper = (props: Props) => {
155
129
  const {
156
130
  entry,
157
- style: baseStyle,
131
+ style,
158
132
  containerStyle,
159
133
  inline,
160
134
  docked,
@@ -169,8 +143,6 @@ const PlayerWrapperComponent = (props: Props) => {
169
143
 
170
144
  const isInlineModal = inline && isModal;
171
145
 
172
- const style = getStyles(baseStyle, !isTablet, isInlineModal);
173
-
174
146
  const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
175
147
 
176
148
  const tabletWidth = getTabletWidth(configuration, style);
@@ -252,9 +224,8 @@ const PlayerWrapperComponent = (props: Props) => {
252
224
  </AnimatedVideoPlayerComponent>
253
225
  </AnimationComponent>
254
226
  </View>
255
-
256
227
  <AnimatedScrollModal>
257
- {showDetails(!isTablet, docked) && (
228
+ {isInlineModal && !docked ? (
258
229
  <AnimationComponent
259
230
  animationType={ComponentAnimationType.componentFade}
260
231
  style={defaultStyles.flex}
@@ -264,9 +235,10 @@ const PlayerWrapperComponent = (props: Props) => {
264
235
  style={defaultStyles.playerDetails}
265
236
  entry={entry}
266
237
  isTabletLandscape={isTabletLandscape}
267
- isTablet={isTablet}
268
238
  />
269
239
  </AnimationComponent>
240
+ ) : (
241
+ <View style={defaultStyles.playerDetails} />
270
242
  )}
271
243
  </AnimatedScrollModal>
272
244
  </ScreenContextProvider>
@@ -277,5 +249,3 @@ const PlayerWrapperComponent = (props: Props) => {
277
249
  </PathnameContext.Provider>
278
250
  );
279
251
  };
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, StatusBar } from "react-native";
3
+ import { StyleSheet, View } from "react-native";
4
4
 
5
5
  import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
6
6
  import {
@@ -129,38 +129,32 @@ const VideoModalComponent = () => {
129
129
  const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${item?.id}`;
130
130
 
131
131
  return (
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
- </>
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>
164
158
  );
165
159
  };
166
160
 
@@ -8,13 +8,6 @@ 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
-
18
11
  jest.mock("react-native-safe-area-context", () => ({
19
12
  useSafeAreaInsets: jest.fn(() => ({
20
13
  top: 20,
@@ -9,7 +9,6 @@ exports[`PlayerDetails renders properly 1`] = `
9
9
  "flex": 1,
10
10
  "marginTop": -8,
11
11
  "paddingTop": -8,
12
- "width": 750,
13
12
  }
14
13
  }
15
14
  >
@@ -30,7 +29,6 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
30
29
  "flex": 1,
31
30
  "marginTop": -20,
32
31
  "paddingTop": 40,
33
- "width": 750,
34
32
  }
35
33
  }
36
34
  >
@@ -27,8 +27,8 @@ exports[`PlayerWrapper renders inline 1`] = `
27
27
  "backgroundColor": "transparent",
28
28
  },
29
29
  Object {
30
- "height": 1334,
31
- "width": 750,
30
+ "height": 800,
31
+ "width": 300,
32
32
  },
33
33
  Object {},
34
34
  ]
@@ -91,7 +91,6 @@ exports[`PlayerWrapper renders inline 1`] = `
91
91
  "id": "test",
92
92
  }
93
93
  }
94
- isTablet={false}
95
94
  isTabletLandscape={false}
96
95
  style={
97
96
  Object {
@@ -133,8 +132,8 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
133
132
  "backgroundColor": "transparent",
134
133
  },
135
134
  Object {
136
- "height": 1334,
137
- "width": 750,
135
+ "height": undefined,
136
+ "width": 300,
138
137
  },
139
138
  Object {},
140
139
  ]
@@ -178,35 +177,13 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
178
177
  testID="test-player-container"
179
178
  />
180
179
  <View
181
- animationType="componentFade"
182
180
  style={
183
181
  Object {
184
182
  "flex": 1,
183
+ "paddingTop": 20,
185
184
  }
186
185
  }
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>
186
+ />
210
187
  </View>
211
188
  </RNCSafeAreaView>
212
189
  </RNCSafeAreaProvider>
@@ -319,7 +296,6 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
319
296
  "id": "test",
320
297
  }
321
298
  }
322
- isTablet={true}
323
299
  isTabletLandscape={true}
324
300
  style={
325
301
  Object {
@@ -361,8 +337,8 @@ exports[`PlayerWrapper renders properly 1`] = `
361
337
  "backgroundColor": "transparent",
362
338
  },
363
339
  Object {
364
- "height": 750,
365
- "width": 1334,
340
+ "height": 800,
341
+ "width": 300,
366
342
  },
367
343
  Object {},
368
344
  ]
@@ -406,35 +382,13 @@ exports[`PlayerWrapper renders properly 1`] = `
406
382
  testID="test-player-container"
407
383
  />
408
384
  <View
409
- animationType="componentFade"
410
385
  style={
411
386
  Object {
412
387
  "flex": 1,
388
+ "paddingTop": 20,
413
389
  }
414
390
  }
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>
391
+ />
438
392
  </View>
439
393
  </RNCSafeAreaView>
440
394
  </RNCSafeAreaProvider>
@@ -45,10 +45,7 @@ const BarView = ({ screenStyles, barState = defaultState }: Props) => {
45
45
  );
46
46
 
47
47
  return (
48
- <SafeAreaView
49
- style={[style.view, isRTL ? style.rtlStyle : {}]}
50
- testID="BarView-safeAreaView"
51
- >
48
+ <SafeAreaView style={[style.view, isRTL ? style.rtlStyle : {}]}>
52
49
  {backButton}
53
50
  <BarTitle title={barState.title} screenStyles={screenStyles} />
54
51
  {closeButton}
@@ -11,16 +11,12 @@ const renderEmptyView = () => {
11
11
  return <View style={emptyViewStyle} />;
12
12
  };
13
13
 
14
- type FloatingButtonProps = Testable & {
14
+ type FloatingButtonProps = {
15
15
  onPress: () => void;
16
16
  screenStyles: any;
17
17
  };
18
18
 
19
- const BackButton = ({
20
- onPress,
21
- screenStyles,
22
- testID = "backButton",
23
- }: FloatingButtonProps) => {
19
+ const BackButton = ({ onPress, screenStyles }: FloatingButtonProps) => {
24
20
  const containerStyle: any = {};
25
21
 
26
22
  if (!onPress) {
@@ -29,7 +25,6 @@ const BackButton = ({
29
25
 
30
26
  return (
31
27
  <ActionButton
32
- testID={`${testID}-actionButton`}
33
28
  onPress={onPress}
34
29
  buttonStyles={containerStyle}
35
30
  imageUrl={screenStyles.back_button_image}
@@ -11,16 +11,12 @@ const renderEmptyView = () => {
11
11
  return <View style={emptyViewStyle} />;
12
12
  };
13
13
 
14
- type CloseButtonProps = Testable & {
14
+ type CloseButtonProps = {
15
15
  onPress: () => void;
16
16
  screenStyles?: any;
17
17
  };
18
18
 
19
- const CloseButton = ({
20
- onPress,
21
- screenStyles,
22
- testID = "closeButton",
23
- }: CloseButtonProps) => {
19
+ const CloseButton = ({ onPress, screenStyles }: CloseButtonProps) => {
24
20
  const containerStyle: any = {};
25
21
 
26
22
  if (!onPress) {
@@ -29,7 +25,6 @@ const CloseButton = ({
29
25
 
30
26
  return (
31
27
  <ActionButton
32
- testID={`${testID}-actionButton`}
33
28
  onPress={onPress}
34
29
  buttonStyles={containerStyle}
35
30
  imageUrl={screenStyles.close_button_image}
@@ -28,7 +28,7 @@ styles: {
28
28
  }
29
29
  */
30
30
 
31
- type ActionButtonProps = Testable & {
31
+ type ActionButtonProps = {
32
32
  onPress: () => void;
33
33
  buttonStyles: any;
34
34
  imageUrl: string;
@@ -46,16 +46,11 @@ const ActionButton = ({
46
46
  buttonStyles,
47
47
  imageUrl,
48
48
  imageStyle = closeButtonStyle,
49
- testID,
50
49
  }: ActionButtonProps) => {
51
50
  return (
52
- <View style={buttonStyles} testID={testID}>
53
- <TouchableOpacity onPress={onPress} testID={`${testID}-touchable`}>
54
- <Image
55
- source={{ uri: imageUrl }}
56
- style={imageStyle}
57
- testID={`${testID}-image`}
58
- />
51
+ <View style={buttonStyles}>
52
+ <TouchableOpacity onPress={onPress}>
53
+ <Image source={{ uri: imageUrl }} style={imageStyle} />
59
54
  </TouchableOpacity>
60
55
  </View>
61
56
  );
@@ -1,6 +1,5 @@
1
1
  import { create, useStore } from "zustand";
2
2
  import { produce } from "immer";
3
- import { useCallback, useMemo } from "react";
4
3
 
5
4
  type Dimensions = {
6
5
  width: Option<number>;
@@ -32,19 +31,16 @@ export const useCachedDimensions = (id: string) => {
32
31
  dimensionsStore
33
32
  ) as DimensionsState;
34
33
 
35
- const getCachedDimensions = useCallback(() => {
34
+ const getCachedDimensions = () => {
36
35
  return dimensions[id] || initialDimensions();
37
- }, [dimensions?.[id], id]);
36
+ };
38
37
 
39
- const handleSetCachedDimensions = useCallback((newDimensions) => {
38
+ const handleSetCachedDimensions = (newDimensions) => {
40
39
  setCachedDimensions(id, newDimensions);
41
- }, []);
42
-
43
- return useMemo(
44
- () => ({
45
- getCachedDimensions,
46
- setCachedDimensions: handleSetCachedDimensions,
47
- }),
48
- [getCachedDimensions, handleSetCachedDimensions]
49
- );
40
+ };
41
+
42
+ return {
43
+ getCachedDimensions,
44
+ setCachedDimensions: handleSetCachedDimensions,
45
+ };
50
46
  };
@@ -2,7 +2,7 @@ import { createStore } from "zustand/vanilla";
2
2
  import { useStore } from "zustand";
3
3
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
4
4
 
5
- export interface ConfirmationDialogState {
5
+ interface ConfirmationDialogState {
6
6
  isDialogVisible: boolean;
7
7
  messages: string;
8
8
  confirmAction: () => void;
@@ -177,12 +177,7 @@ export function withScreenContext(Component: React.ComponentType<any>) {
177
177
  return function WithScreenContextWrapper(props) {
178
178
  return (
179
179
  <ScreenContext.Consumer>
180
- {useCallback(
181
- (value) => (
182
- <Component {...props} screenContext={value} />
183
- ),
184
- [Component, props]
185
- )}
180
+ {(value) => <Component {...props} screenContext={value} />}
186
181
  </ScreenContext.Consumer>
187
182
  );
188
183
  };
package/const.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { ViewStyle } from "react-native";
2
-
3
1
  export const tvPluginsWithCellRenderer = [
4
2
  "group-qb",
5
3
  "gallery-qb",
@@ -7,7 +5,3 @@ export const tvPluginsWithCellRenderer = [
7
5
  "hero-qb",
8
6
  "list-qb",
9
7
  ];
10
-
11
- // Can't be used in StyleSheet.create, need to be inline/defined as a constant
12
- // https://github.com/necolas/react-native-web/issues/1427
13
- export const flatListOverflowStyle: ViewStyle = { overflow: "visible" };