react-magic-card 0.1.10 → 0.1.11

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,12 +70,28 @@ const MagicStraight = ({ images, height, width, start, controller, wheelDelay, v
70
70
  // Swipe Function of the mobile.
71
71
  const handleTouchMove = (0, react_1.useCallback)((e) => {
72
72
  const touch = e.touches[0];
73
- const delta = hasPick ? touch.clientX : touch.clientY;
74
- if (hasPick ? delta < touchStartX : delta < touchStartY)
73
+ const delta = hasPick
74
+ ? touch.clientX
75
+ : !vertical
76
+ ? touch.clientX
77
+ : touch.clientY;
78
+ if (hasPick
79
+ ? delta < touchStartX
80
+ : !vertical
81
+ ? delta < touchStartX
82
+ : delta < touchStartY)
75
83
  shiftLeft();
76
- if (hasPick ? delta > touchStartX : delta > touchStartY)
84
+ if (hasPick
85
+ ? delta > touchStartX
86
+ : !vertical
87
+ ? delta > touchStartX
88
+ : delta > touchStartY)
77
89
  shiftRight();
78
- hasPick ? setTouchStartX(delta) : setTouchStartY(delta);
90
+ hasPick
91
+ ? setTouchStartX(delta)
92
+ : !vertical
93
+ ? setTouchStartX(delta)
94
+ : setTouchStartY(delta);
79
95
  }, [hasPick, shiftLeft, shiftRight, touchStartX, touchStartY, vertical]);
80
96
  // Main functional, exit function if ref and hasDelayed does not exist.
81
97
  (0, react_1.useEffect)(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-magic-card",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "image gallery component with framer motion",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",