@applicaster/zapp-react-native-ui-components 13.0.0-rc.70 → 13.0.0-rc.71

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.
@@ -70,7 +70,12 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
70
70
  const { maximiseVideoModal, minimiseVideoModal, videoModalState } =
71
71
  useNavigation();
72
72
 
73
- const { mode: videoModalMode, item: videoModalItem } = videoModalState;
73
+ const {
74
+ mode: videoModalMode,
75
+ previousMode: previousVideoModalMode,
76
+ item: videoModalItem,
77
+ } = videoModalState;
78
+
74
79
  const isMaximizedModal: boolean = videoModalMode === "MAXIMIZED";
75
80
  const isMinimizedModal: boolean = videoModalMode === "MINIMIZED";
76
81
  const previousItemId = usePrevious(videoModalItem?.id);
@@ -121,7 +126,7 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
121
126
  const preparedTranslationY =
122
127
  Math.abs(translationY) - lastScrollYValue.current;
123
128
 
124
- if (videoModalMode === "MAXIMIZED") {
129
+ if (isMaximizedModal) {
125
130
  const endOffsetY =
126
131
  lastSnap + preparedTranslationY + dragToss * velocityY + 150;
127
132
 
@@ -137,14 +142,14 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
137
142
 
138
143
  setLastSnap(destSnapPoint);
139
144
 
140
- if (destSnapPoint === modalSnapPoints[0]) {
145
+ if (destSnapPoint === modalSnapPoints[0] && isMinimizedModal) {
141
146
  translateYOffset.extractOffset();
142
147
  translateYOffset.setValue(preparedTranslationY);
143
148
  translateYOffset.flattenOffset();
144
149
  dragScrollY.setValue(0);
145
150
 
146
151
  setPlayerAnimationState(PlayerAnimationStateEnum.maximize);
147
- } else {
152
+ } else if (destSnapPoint !== modalSnapPoints[0] && isMaximizedModal) {
148
153
  setPlayerAnimationState(PlayerAnimationStateEnum.minimize);
149
154
  }
150
155
  } else {
@@ -168,7 +173,13 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
168
173
  resetPlayerAnimationState();
169
174
  }
170
175
  },
171
- [lastSnap, modalSnapPoints, playerAnimationState, videoModalMode]
176
+ [
177
+ lastSnap,
178
+ modalSnapPoints,
179
+ playerAnimationState,
180
+ isMinimizedModal,
181
+ isMaximizedModal,
182
+ ]
172
183
  );
173
184
 
174
185
  const onScroll = React.useCallback(({ nativeEvent }) => {
@@ -219,17 +230,18 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
219
230
  }, []);
220
231
 
221
232
  React.useEffect(() => {
222
- const { mode, previousMode, item } = videoModalState;
223
-
224
233
  if (
225
- mode === "MAXIMIZED" &&
234
+ videoModalMode === "MAXIMIZED" &&
226
235
  !enableGesture &&
227
236
  scrollPosition.current === 0
228
237
  ) {
229
238
  setIEnableGesture(true);
230
239
  }
231
240
 
232
- if (mode === "MINIMIZED" && previousMode === "MAXIMIZED") {
241
+ if (
242
+ videoModalMode === "MINIMIZED" &&
243
+ previousVideoModalMode === "MAXIMIZED"
244
+ ) {
233
245
  // set animation to the minimize values if moving from the player to another screen
234
246
  if (playerAnimationState === null) {
235
247
  setScrollModalAnimatedValue(
@@ -247,14 +259,16 @@ export const AnimatedScrollModalComponent = ({ children }: Props) => {
247
259
  }
248
260
  } else if (
249
261
  playerAnimationState === null &&
250
- ((previousItemId === item?.id &&
251
- mode === "MAXIMIZED" &&
252
- (previousMode === "MINIMIZED" || previousMode === "MAXIMIZED")) ||
253
- (previousItemId !== item?.id && mode !== "FULLSCREEN"))
262
+ ((previousItemId === videoModalItem?.id &&
263
+ videoModalMode === "MAXIMIZED" &&
264
+ (previousVideoModalMode === "MINIMIZED" ||
265
+ previousVideoModalMode === "MAXIMIZED")) ||
266
+ (previousItemId !== videoModalItem?.id &&
267
+ videoModalMode !== "FULLSCREEN"))
254
268
  ) {
255
269
  setPlayerAnimationState(PlayerAnimationStateEnum.maximize);
256
270
  }
257
- }, [videoModalState]);
271
+ }, [videoModalMode, previousVideoModalMode, videoModalItem]);
258
272
 
259
273
  React.useEffect(() => {
260
274
  if (playerAnimationState === PlayerAnimationStateEnum.minimize) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.0-rc.70",
3
+ "version": "13.0.0-rc.71",
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",
@@ -32,10 +32,10 @@
32
32
  "redux-mock-store": "^1.5.3"
33
33
  },
34
34
  "dependencies": {
35
- "@applicaster/applicaster-types": "13.0.0-rc.70",
36
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.70",
37
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.70",
38
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.70",
35
+ "@applicaster/applicaster-types": "13.0.0-rc.71",
36
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.71",
37
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.71",
38
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.71",
39
39
  "promise": "^8.3.0",
40
40
  "react-router-native": "^5.1.2",
41
41
  "url": "^0.11.0",