manage-app-sdk 0.0.2
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.
- package/README.md +2 -0
- package/dist/Constants/Home.js +85 -0
- package/dist/assets/AppConstant.js +293 -0
- package/dist/assets/androidResources/Connectivity.java +52 -0
- package/dist/assets/androidResources/ConnectivityPackage.java +25 -0
- package/dist/assets/fonts/VoltePlay-Bold.ttf +0 -0
- package/dist/assets/fonts/VoltePlay-Light.ttf +0 -0
- package/dist/assets/fonts/VoltePlay-Medium.ttf +0 -0
- package/dist/assets/fonts/VoltePlay-Regular.ttf +0 -0
- package/dist/assets/fonts/VoltePlay-SemiBold.ttf +0 -0
- package/dist/assets/gif/loader.gif +0 -0
- package/dist/assets/images/PartnerLogosSmall.png +0 -0
- package/dist/assets/images/Union.png +0 -0
- package/dist/assets/images/appIcon.png +0 -0
- package/dist/assets/images/desktop-alert.png +0 -0
- package/dist/assets/images/desktop-cross.png +0 -0
- package/dist/assets/images/mobile-bg.png +0 -0
- package/dist/assets/images/stepper-one-small.png +0 -0
- package/dist/assets/images/stepper-one.png +0 -0
- package/dist/assets/images/stepper-two-small.png +0 -0
- package/dist/assets/images/stepper-two.png +0 -0
- package/dist/assets/images/tablet-bg.png +0 -0
- package/dist/assets/png/Tataplay-Binge.png +0 -0
- package/dist/assets/png/arrowBack.png +0 -0
- package/dist/assets/png/backArrowPng.png +0 -0
- package/dist/assets/svg/BingeLogoSvg.js +44 -0
- package/dist/assets/svg/CrossSvg.js +32 -0
- package/dist/assets/svg/OfferSvg.js +31 -0
- package/dist/assets/svg/PlansSvg.js +75 -0
- package/dist/assets/svg/TickSvg.js +28 -0
- package/dist/assets/svg/arrowBack.js +27 -0
- package/dist/assets/svg/arrowSvg.js +31 -0
- package/dist/components/AppIcon/AppIcon.js +70 -0
- package/dist/components/AppleBanner/AppleMusicBanner.js +36 -0
- package/dist/components/AppleBanner/AppleMusicBannerStyles.js +32 -0
- package/dist/components/AppleBanner/AppleMusicBlackBanner.js +66 -0
- package/dist/components/AppsContainer/AppsContainer.js +112 -0
- package/dist/components/BottomSheet/BottomSheet.js +173 -0
- package/dist/components/BottomSheet/BottomSheetStyles.js +48 -0
- package/dist/components/Buttons/PrimaryButton/PrimaryButton.js +50 -0
- package/dist/components/Buttons/RadioButton/RadioButton.js +24 -0
- package/dist/components/Buttons/TextButton/TextButton.js +44 -0
- package/dist/components/CheckButton/CheckButton.js +36 -0
- package/dist/components/CommonModal/CommonModel.js +79 -0
- package/dist/components/CommonModal/ModalTypes.js +10 -0
- package/dist/components/Confetti/ConfettiBurst.js +120 -0
- package/dist/components/Confetti/FallingConfetti.js +190 -0
- package/dist/components/Confetti/MultiConfettiBurst.js +73 -0
- package/dist/components/Coupon/CouponCard.js +47 -0
- package/dist/components/Coupon/CouponStyles.js +54 -0
- package/dist/components/Footer/Footer.js +177 -0
- package/dist/components/Footer/MServiceFooter/MServiceFooter.js +103 -0
- package/dist/components/Footer/OnButtonFooter/OneButtonFooter.js +65 -0
- package/dist/components/Footer/PlanSummaryFooter/SummaryFooter.js +180 -0
- package/dist/components/Footer/PrimeAoFooter/PrimeAoFooter.js +193 -0
- package/dist/components/Footer/UpgradeFooter/UpgradeFooter.js +89 -0
- package/dist/components/Footer/UpgradeFooter/styles.js +73 -0
- package/dist/components/GradientBorderContainer/GradientBorderContainer.js +79 -0
- package/dist/components/GradientText/GradientText.js +60 -0
- package/dist/components/Header/ManageAppHeader.js +71 -0
- package/dist/components/HighlightedText/HighlightedText.js +53 -0
- package/dist/components/Input/OtpInput.js +105 -0
- package/dist/components/Loader/Loader.js +39 -0
- package/dist/components/MServicePaymentMethod/MServicePaymentMethod.js +395 -0
- package/dist/components/MicroDrama/MicroDramaBanner.js +67 -0
- package/dist/components/MicroDrama/MicroDramaCard.js +33 -0
- package/dist/components/MicroDrama/styles.js +29 -0
- package/dist/components/OfferCard/OfferCard.js +100 -0
- package/dist/components/PaymentMethod/PaymentMethod.js +370 -0
- package/dist/components/Plan/CurrentPlanCard.js +138 -0
- package/dist/components/Plan/PlanCard.js +268 -0
- package/dist/components/Plan/PlanCardStyles.js +371 -0
- package/dist/components/Plan/RenderAppIcons.js +115 -0
- package/dist/components/Plan/SpecialPlanCard.js +272 -0
- package/dist/components/PopUps/CancelPopUp/CancelPopUp.js +190 -0
- package/dist/components/PopUps/ConfettiAnimation.js +172 -0
- package/dist/components/PopUps/ConfettiBurst.js +142 -0
- package/dist/components/PopUps/CouponPopUp/CouponPopUp.js +185 -0
- package/dist/components/PopUps/ErrorMsgPopup/ErrorMsgPopup.js +104 -0
- package/dist/components/PopUps/InternetErrorPopUp/InternetErrorPopUp.js +122 -0
- package/dist/components/PopUps/MServicePopUp/MServicePopUp.js +155 -0
- package/dist/components/PopUps/MpinPopUp/MpinPopUp.js +193 -0
- package/dist/components/PopUps/OtpPopup/OtpPopup.js +345 -0
- package/dist/components/PopUps/PlanCancelledPopUp/PlanCancelledPopUp.js +183 -0
- package/dist/components/PopUps/PlanDetailPopup/PlanDetailPopup.js +121 -0
- package/dist/components/PopUps/PopUp/PopUp.js +171 -0
- package/dist/components/PrimeAddOn/PrimeAddOn.js +72 -0
- package/dist/components/PrimeAddOn/PrimeAddOnStyles.js +79 -0
- package/dist/components/PrimeAddOn/SummaryPage/PrimeAddOnBanner.js +109 -0
- package/dist/components/PrimeBanner/PrimeBanner.js +27 -0
- package/dist/components/PrimeBanner/PrimeBannerStyles.js +36 -0
- package/dist/components/SectionItem/SectionItem.js +42 -0
- package/dist/components/Toast/Toast.js +71 -0
- package/dist/components/Toast/ToastStyle.js +62 -0
- package/dist/navigation/Routes.js +84 -0
- package/dist/navigation/RoutesConstants.js +18 -0
- package/dist/screens/AppDiscontinue/ChooseApp.js +325 -0
- package/dist/screens/AppDiscontinue/styles.js +89 -0
- package/dist/screens/AppsReplacement/AppsReplacement.js +359 -0
- package/dist/screens/AppsReplacement/styles.js +92 -0
- package/dist/screens/ChooseYourPlan/ChooseYourPlan.js +596 -0
- package/dist/screens/ChooseYourPlan/ChooseYourPlanStyles.js +28 -0
- package/dist/screens/ChooseYourPlan/OffersCarousel.js +146 -0
- package/dist/screens/CreateSession/CreateSession.js +620 -0
- package/dist/screens/MyPlan/MyPlan.js +429 -0
- package/dist/screens/MyPlan/MyPlanStyles.js +227 -0
- package/dist/screens/PaymentStatus/PaymentStatus.js +492 -0
- package/dist/screens/PaymentStatus/styles.js +68 -0
- package/dist/screens/PlanCancellation/CancelPlan.js +127 -0
- package/dist/screens/PlanCancellation/InfiniteAutoScroll.js +67 -0
- package/dist/screens/PlanCancellation/styles.js +83 -0
- package/dist/screens/PlanSummary/PlanSummary.js +748 -0
- package/dist/screens/PlanSummary/PlanSummaryStyles.js +385 -0
- package/dist/screens/PrimePlanSummary/PrimePlanSummary.js +252 -0
- package/dist/screens/PrimePlanSummary/PrimePlanSummaryStyles.js +102 -0
- package/dist/screens/SelectApps/SelectApps.js +513 -0
- package/dist/screens/SelectApps/SelectAppsStyles.js +165 -0
- package/dist/screens/SplashScreen/SplashScreen.js +82 -0
- package/dist/services/apiCall/action.js +718 -0
- package/dist/services/apiCall/apiServiceUtils.js +136 -0
- package/dist/services/apiCall/constants.js +42 -0
- package/dist/services/apiCall/parser.js +92 -0
- package/dist/services/apiCall/reducer.js +591 -0
- package/dist/services/global/action.js +111 -0
- package/dist/services/global/commonReducer.js +97 -0
- package/dist/services/global/constants.js +22 -0
- package/dist/services/serviceCommonHandler.js +220 -0
- package/dist/store/configureStore.js +13 -0
- package/dist/store/rootReducer.js +14 -0
- package/dist/utils/commonUtils.js +381 -0
- package/dist/utils/fontUtils.js +13 -0
- package/dist/utils/string.js +101 -0
- package/package.json +53 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.showConfetti = exports.hideConfetti = exports.default = exports.confettiBurst = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _AppConstant = require("../../assets/AppConstant");
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
+
const {
|
|
12
|
+
width,
|
|
13
|
+
height
|
|
14
|
+
} = _AppConstant.AppConstant.dimension;
|
|
15
|
+
let confettiInstance = null;
|
|
16
|
+
const ConfettiPiece = ({
|
|
17
|
+
delay,
|
|
18
|
+
shouldAnimate,
|
|
19
|
+
onAnimationComplete
|
|
20
|
+
}) => {
|
|
21
|
+
const startX = Math.random() * (_AppConstant.AppConstant.dimension.width + 200);
|
|
22
|
+
const size = Math.random() * 6 + 2; // Smaller, thinner pieces
|
|
23
|
+
const fallDuration = Math.random() * 1500 + 800; // Faster fall
|
|
24
|
+
const rotateDuration = Math.random() * 1000 + 500; // Faster rotation
|
|
25
|
+
const horizontalDrift = Math.random() * 150 - 75;
|
|
26
|
+
const translateY = (0, _react.useRef)(new _reactNative.Animated.Value(-width - 100)).current;
|
|
27
|
+
const translateX = (0, _react.useRef)(new _reactNative.Animated.Value(startX)).current;
|
|
28
|
+
const rotate = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
29
|
+
const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
30
|
+
(0, _react.useEffect)(() => {
|
|
31
|
+
if (shouldAnimate) {
|
|
32
|
+
// Quick fade in
|
|
33
|
+
_reactNative.Animated.timing(opacity, {
|
|
34
|
+
toValue: 1,
|
|
35
|
+
duration: 100,
|
|
36
|
+
useNativeDriver: true
|
|
37
|
+
}).start();
|
|
38
|
+
|
|
39
|
+
// Main animation sequence
|
|
40
|
+
_reactNative.Animated.sequence([_reactNative.Animated.delay(delay), _reactNative.Animated.parallel([
|
|
41
|
+
// Faster fall animation
|
|
42
|
+
_reactNative.Animated.timing(translateY, {
|
|
43
|
+
toValue: height + 50,
|
|
44
|
+
duration: fallDuration,
|
|
45
|
+
useNativeDriver: true
|
|
46
|
+
}),
|
|
47
|
+
// Horizontal drift
|
|
48
|
+
_reactNative.Animated.timing(translateX, {
|
|
49
|
+
toValue: startX + horizontalDrift,
|
|
50
|
+
duration: fallDuration,
|
|
51
|
+
useNativeDriver: true
|
|
52
|
+
}),
|
|
53
|
+
// Faster rotation
|
|
54
|
+
_reactNative.Animated.loop(_reactNative.Animated.timing(rotate, {
|
|
55
|
+
toValue: 1,
|
|
56
|
+
duration: rotateDuration,
|
|
57
|
+
useNativeDriver: true
|
|
58
|
+
}))])]).start(() => {
|
|
59
|
+
// Quick fade out
|
|
60
|
+
_reactNative.Animated.timing(opacity, {
|
|
61
|
+
toValue: 0,
|
|
62
|
+
duration: 150,
|
|
63
|
+
useNativeDriver: true
|
|
64
|
+
}).start(() => {
|
|
65
|
+
onAnimationComplete();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, [shouldAnimate, delay, fallDuration, rotateDuration, horizontalDrift, startX]);
|
|
70
|
+
const rotateInterpolate = rotate.interpolate({
|
|
71
|
+
inputRange: [0, 1],
|
|
72
|
+
outputRange: ["0deg", `${Math.random() > 0.5 ? 360 : -360}deg`]
|
|
73
|
+
});
|
|
74
|
+
const color = colors[Math.floor(Math.random() * colors.length)];
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
76
|
+
style: [styles.confetti, {
|
|
77
|
+
width: size,
|
|
78
|
+
height: size * 3,
|
|
79
|
+
// Thin rectangular shape
|
|
80
|
+
borderRadius: 1,
|
|
81
|
+
transform: [{
|
|
82
|
+
translateX
|
|
83
|
+
}, {
|
|
84
|
+
translateY
|
|
85
|
+
}, {
|
|
86
|
+
rotate: rotateInterpolate
|
|
87
|
+
}, {
|
|
88
|
+
scale: Math.random() * 0.3 + 0.7
|
|
89
|
+
} // Smaller scale variation
|
|
90
|
+
],
|
|
91
|
+
backgroundColor: color,
|
|
92
|
+
opacity
|
|
93
|
+
}]
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const ConfettiAnimation = ({
|
|
97
|
+
count = 100
|
|
98
|
+
}) => {
|
|
99
|
+
const [isAnimating, setIsAnimating] = (0, _react.useState)(false);
|
|
100
|
+
const [animationKey, setAnimationKey] = (0, _react.useState)(0);
|
|
101
|
+
const activeAnimations = (0, _react.useRef)(0);
|
|
102
|
+
(0, _react.useEffect)(() => {
|
|
103
|
+
confettiInstance = {
|
|
104
|
+
show: () => {
|
|
105
|
+
setIsAnimating(true);
|
|
106
|
+
setAnimationKey(prev => prev + 1);
|
|
107
|
+
activeAnimations.current = count;
|
|
108
|
+
},
|
|
109
|
+
hide: () => {
|
|
110
|
+
setIsAnimating(false);
|
|
111
|
+
activeAnimations.current = 0;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return () => {
|
|
115
|
+
confettiInstance = null;
|
|
116
|
+
};
|
|
117
|
+
}, [count]);
|
|
118
|
+
const handleAnimationComplete = () => {
|
|
119
|
+
activeAnimations.current -= 1;
|
|
120
|
+
if (activeAnimations.current <= 0) {
|
|
121
|
+
setIsAnimating(false);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
if (!isAnimating) return null;
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
126
|
+
style: _reactNative.StyleSheet.absoluteFill,
|
|
127
|
+
pointerEvents: "none"
|
|
128
|
+
}, Array.from({
|
|
129
|
+
length: count
|
|
130
|
+
}, (_, index) => /*#__PURE__*/_react.default.createElement(ConfettiPiece, {
|
|
131
|
+
key: `${animationKey}-${index}`,
|
|
132
|
+
delay: Math.random() * 800 // Faster, more staggered delays
|
|
133
|
+
,
|
|
134
|
+
shouldAnimate: isAnimating,
|
|
135
|
+
onAnimationComplete: handleAnimationComplete
|
|
136
|
+
})));
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// Vibrant color palette
|
|
140
|
+
const colors = ["#A0752B", "#FDD551", "#FFFFBF", "#FDD551", "#A0752B", "#FDD551", "#FDD551"];
|
|
141
|
+
const styles = _reactNative.StyleSheet.create({
|
|
142
|
+
confetti: {
|
|
143
|
+
position: "absolute"
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
var _default = exports.default = ConfettiAnimation; // Export functions to control confetti
|
|
147
|
+
const showConfetti = () => {
|
|
148
|
+
if (confettiInstance) {
|
|
149
|
+
confettiInstance.show();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
exports.showConfetti = showConfetti;
|
|
153
|
+
const hideConfetti = () => {
|
|
154
|
+
if (confettiInstance) {
|
|
155
|
+
confettiInstance.hide();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// Burst effect with multiple waves
|
|
160
|
+
exports.hideConfetti = hideConfetti;
|
|
161
|
+
const confettiBurst = (waves = 3, delay = 300) => {
|
|
162
|
+
let currentWave = 0;
|
|
163
|
+
const triggerWave = () => {
|
|
164
|
+
showConfetti();
|
|
165
|
+
currentWave++;
|
|
166
|
+
if (currentWave < waves) {
|
|
167
|
+
setTimeout(triggerWave, delay);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
triggerWave();
|
|
171
|
+
};
|
|
172
|
+
exports.confettiBurst = confettiBurst;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.triggerRandomBursts = exports.triggerConfettiBurst = exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
+
const {
|
|
11
|
+
width,
|
|
12
|
+
height
|
|
13
|
+
} = _reactNative.Dimensions.get('window');
|
|
14
|
+
const screenDiagonal = Math.sqrt(width * width + height * height);
|
|
15
|
+
let burstInstance = null;
|
|
16
|
+
const BurstPiece = ({
|
|
17
|
+
originX,
|
|
18
|
+
originY,
|
|
19
|
+
delay,
|
|
20
|
+
onAnimationComplete
|
|
21
|
+
}) => {
|
|
22
|
+
const pieceWidth = Math.random() * 3 + 2; // thin strips
|
|
23
|
+
const pieceHeight = pieceWidth * (Math.random() * 5); // tall
|
|
24
|
+
const travelDistance = Math.random() * screenDiagonal * 0.8 + 80;
|
|
25
|
+
const angle = Math.random() * 2 * Math.PI;
|
|
26
|
+
const duration = Math.random() * 1000 + 1100;
|
|
27
|
+
const rotateDuration = Math.random() * 800 + 400;
|
|
28
|
+
const translateX = (0, _react.useRef)(new _reactNative.Animated.Value(originX)).current;
|
|
29
|
+
const translateY = (0, _react.useRef)(new _reactNative.Animated.Value(originY)).current;
|
|
30
|
+
const rotate = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
31
|
+
const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
32
|
+
(0, _react.useEffect)(() => {
|
|
33
|
+
_reactNative.Animated.sequence([_reactNative.Animated.delay(delay), _reactNative.Animated.parallel([_reactNative.Animated.timing(translateX, {
|
|
34
|
+
toValue: originX + Math.cos(angle) * travelDistance,
|
|
35
|
+
duration,
|
|
36
|
+
useNativeDriver: true
|
|
37
|
+
}), _reactNative.Animated.timing(translateY, {
|
|
38
|
+
toValue: originY + Math.sin(angle) * travelDistance,
|
|
39
|
+
duration,
|
|
40
|
+
useNativeDriver: true
|
|
41
|
+
}), _reactNative.Animated.loop(_reactNative.Animated.timing(rotate, {
|
|
42
|
+
toValue: 1,
|
|
43
|
+
duration: rotateDuration,
|
|
44
|
+
useNativeDriver: true
|
|
45
|
+
})), _reactNative.Animated.timing(opacity, {
|
|
46
|
+
toValue: 0,
|
|
47
|
+
duration,
|
|
48
|
+
delay: duration * 0.7,
|
|
49
|
+
useNativeDriver: true
|
|
50
|
+
})])]).start(() => onAnimationComplete());
|
|
51
|
+
}, [delay]);
|
|
52
|
+
const rotateInterpolate = rotate.interpolate({
|
|
53
|
+
inputRange: [0, 1],
|
|
54
|
+
outputRange: ['0deg', `${Math.random() > 0.5 ? 360 : -360}deg`]
|
|
55
|
+
});
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
57
|
+
style: [styles.confetti, {
|
|
58
|
+
width: pieceWidth,
|
|
59
|
+
height: pieceHeight,
|
|
60
|
+
transform: [{
|
|
61
|
+
translateX
|
|
62
|
+
}, {
|
|
63
|
+
translateY
|
|
64
|
+
}, {
|
|
65
|
+
rotate: rotateInterpolate
|
|
66
|
+
}],
|
|
67
|
+
backgroundColor: colors[Math.floor(Math.random() * colors.length)],
|
|
68
|
+
opacity
|
|
69
|
+
}]
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const ConfettiBurstAnimation = ({
|
|
73
|
+
count = 40
|
|
74
|
+
}) => {
|
|
75
|
+
const [bursts, setBursts] = (0, _react.useState)([]);
|
|
76
|
+
(0, _react.useEffect)(() => {
|
|
77
|
+
burstInstance = {
|
|
78
|
+
burst: (x, y) => {
|
|
79
|
+
setBursts(prev => [...prev, {
|
|
80
|
+
id: Date.now() + Math.random(),
|
|
81
|
+
origin: {
|
|
82
|
+
x,
|
|
83
|
+
y
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
},
|
|
87
|
+
burstRandom: (n = 3) => {
|
|
88
|
+
const newBursts = Array.from({
|
|
89
|
+
length: n
|
|
90
|
+
}).map(() => ({
|
|
91
|
+
id: Date.now() + Math.random(),
|
|
92
|
+
origin: {
|
|
93
|
+
x: Math.random() * width,
|
|
94
|
+
y: Math.random() * height
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
setBursts(prev => [...prev, ...newBursts]);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return () => {
|
|
101
|
+
burstInstance = null;
|
|
102
|
+
};
|
|
103
|
+
}, []);
|
|
104
|
+
const handleAnimationComplete = burstId => {
|
|
105
|
+
setBursts(prev => prev.filter(burst => burst.id !== burstId));
|
|
106
|
+
};
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
108
|
+
style: _reactNative.StyleSheet.absoluteFill,
|
|
109
|
+
pointerEvents: "none"
|
|
110
|
+
}, bursts.map(burst => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
111
|
+
key: burst.id,
|
|
112
|
+
style: _reactNative.StyleSheet.absoluteFill
|
|
113
|
+
}, Array.from({
|
|
114
|
+
length: count
|
|
115
|
+
}, (_, index) => /*#__PURE__*/_react.default.createElement(BurstPiece, {
|
|
116
|
+
key: `${burst.id}-${index}`,
|
|
117
|
+
originX: burst.origin.x,
|
|
118
|
+
originY: burst.origin.y,
|
|
119
|
+
delay: Math.random() * 200,
|
|
120
|
+
onAnimationComplete: () => handleAnimationComplete(burst.id)
|
|
121
|
+
})))));
|
|
122
|
+
};
|
|
123
|
+
const colors = ['#A0752B', '#FDD551', '#FFFFBF', '#FDD551', '#A0752B', '#FDD551', '#FDD551'];
|
|
124
|
+
const styles = _reactNative.StyleSheet.create({
|
|
125
|
+
confetti: {
|
|
126
|
+
position: 'absolute',
|
|
127
|
+
borderRadius: 1
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
var _default = exports.default = ConfettiBurstAnimation; // 🔹 Exported API
|
|
131
|
+
const triggerConfettiBurst = (x, y) => {
|
|
132
|
+
if (burstInstance) {
|
|
133
|
+
burstInstance.burst(x, y);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
exports.triggerConfettiBurst = triggerConfettiBurst;
|
|
137
|
+
const triggerRandomBursts = (n = 3) => {
|
|
138
|
+
if (burstInstance) {
|
|
139
|
+
burstInstance.burstRandom(n);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
exports.triggerRandomBursts = triggerRandomBursts;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _reactRedux = require("react-redux");
|
|
11
|
+
var _GradientBorderContainer = _interopRequireDefault(require("../../GradientBorderContainer/GradientBorderContainer"));
|
|
12
|
+
var _AppConstant = require("../../../assets/AppConstant");
|
|
13
|
+
var _action = require("../../../services/global/action");
|
|
14
|
+
var _string = require("../../../utils/string");
|
|
15
|
+
var _MultiConfettiBurst = require("../../Confetti/MultiConfettiBurst");
|
|
16
|
+
var _fontUtils = require("../../../utils/fontUtils");
|
|
17
|
+
var _GradientText = _interopRequireDefault(require("../../GradientText/GradientText"));
|
|
18
|
+
var _commonUtils = require("../../../utils/commonUtils");
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
const ratio = _AppConstant.AppConstant.dimension.aspectRatio;
|
|
21
|
+
const CouponPopUp = ({
|
|
22
|
+
pageData,
|
|
23
|
+
couponData,
|
|
24
|
+
offerName
|
|
25
|
+
}) => {
|
|
26
|
+
var _pageData$winbackPopu2, _pageData$winbackPopu4, _pageData$winbackPopu6, _pageData$winbackPopu7, _pageData$winbackPopu8, _pageData$winbackPopu9, _pageData$winbackPopu0, _pageData$winbackPopu1;
|
|
27
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
28
|
+
const scaleAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0.8)).current;
|
|
29
|
+
const opacityAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
30
|
+
const timeoutRef = (0, _react.useRef)(null);
|
|
31
|
+
const heading = (0, _react.useMemo)(() => {
|
|
32
|
+
var _pageData$winbackPopu;
|
|
33
|
+
return (0, _string.replacePlaceholderInString)(pageData === null || pageData === void 0 || (_pageData$winbackPopu = pageData.winbackPopup) === null || _pageData$winbackPopu === void 0 ? void 0 : _pageData$winbackPopu.savedAmount, "amount", couponData === null || couponData === void 0 ? void 0 : couponData.discountValue);
|
|
34
|
+
}, [pageData === null || pageData === void 0 || (_pageData$winbackPopu2 = pageData.winbackPopup) === null || _pageData$winbackPopu2 === void 0 ? void 0 : _pageData$winbackPopu2.savedAmount, couponData === null || couponData === void 0 ? void 0 : couponData.discountValue]);
|
|
35
|
+
const subHeading = (0, _react.useMemo)(() => {
|
|
36
|
+
var _pageData$winbackPopu3;
|
|
37
|
+
return (0, _commonUtils.replaceStringWithParams)(pageData === null || pageData === void 0 || (_pageData$winbackPopu3 = pageData.winbackPopup) === null || _pageData$winbackPopu3 === void 0 ? void 0 : _pageData$winbackPopu3.couponApplied, {
|
|
38
|
+
"!offerName!": couponData === null || couponData === void 0 ? void 0 : couponData.offerName,
|
|
39
|
+
"!percentage!": couponData === null || couponData === void 0 ? void 0 : couponData.amountDiscount
|
|
40
|
+
});
|
|
41
|
+
}, [pageData === null || pageData === void 0 || (_pageData$winbackPopu4 = pageData.winbackPopup) === null || _pageData$winbackPopu4 === void 0 ? void 0 : _pageData$winbackPopu4.couponApplied, offerName]);
|
|
42
|
+
const couponApplied2 = (0, _react.useMemo)(() => {
|
|
43
|
+
var _pageData$winbackPopu5;
|
|
44
|
+
return pageData === null || pageData === void 0 || (_pageData$winbackPopu5 = pageData.winbackPopup) === null || _pageData$winbackPopu5 === void 0 ? void 0 : _pageData$winbackPopu5.couponApplied2;
|
|
45
|
+
}, [pageData === null || pageData === void 0 || (_pageData$winbackPopu6 = pageData.winbackPopup) === null || _pageData$winbackPopu6 === void 0 ? void 0 : _pageData$winbackPopu6.couponApplied2]);
|
|
46
|
+
const closePopUp = () => {
|
|
47
|
+
if (timeoutRef.current) {
|
|
48
|
+
clearTimeout(timeoutRef.current);
|
|
49
|
+
timeoutRef.current = null;
|
|
50
|
+
}
|
|
51
|
+
dispatch((0, _action.hideModal)());
|
|
52
|
+
(0, _MultiConfettiBurst.stopConfettiBursts)();
|
|
53
|
+
_reactNative.Animated.parallel([_reactNative.Animated.spring(scaleAnim, {
|
|
54
|
+
toValue: 0.8,
|
|
55
|
+
friction: 10,
|
|
56
|
+
useNativeDriver: true
|
|
57
|
+
}), _reactNative.Animated.timing(opacityAnim, {
|
|
58
|
+
toValue: 0,
|
|
59
|
+
duration: 100,
|
|
60
|
+
useNativeDriver: true
|
|
61
|
+
})]).start();
|
|
62
|
+
};
|
|
63
|
+
(0, _react.useEffect)(() => {
|
|
64
|
+
scaleAnim.setValue(0.8);
|
|
65
|
+
opacityAnim.setValue(0);
|
|
66
|
+
_reactNative.Animated.parallel([_reactNative.Animated.timing(scaleAnim, {
|
|
67
|
+
toValue: 1,
|
|
68
|
+
duration: 150,
|
|
69
|
+
useNativeDriver: true
|
|
70
|
+
}), _reactNative.Animated.timing(opacityAnim, {
|
|
71
|
+
toValue: 1,
|
|
72
|
+
duration: 50,
|
|
73
|
+
useNativeDriver: true
|
|
74
|
+
})]).start();
|
|
75
|
+
|
|
76
|
+
// timeoutRef.current = setTimeout(() => {
|
|
77
|
+
// closePopUp();
|
|
78
|
+
// }, 6000);
|
|
79
|
+
|
|
80
|
+
return () => {
|
|
81
|
+
if (timeoutRef.current) {
|
|
82
|
+
clearTimeout(timeoutRef.current);
|
|
83
|
+
timeoutRef.current = null;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}, [pageData, couponData, offerName]);
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
88
|
+
style: {
|
|
89
|
+
transform: [{
|
|
90
|
+
scale: scaleAnim
|
|
91
|
+
}],
|
|
92
|
+
opacity: opacityAnim
|
|
93
|
+
}
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
95
|
+
style: styles.outerContainer
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
97
|
+
source: {
|
|
98
|
+
uri: pageData === null || pageData === void 0 || (_pageData$winbackPopu7 = pageData.winbackPopup) === null || _pageData$winbackPopu7 === void 0 ? void 0 : _pageData$winbackPopu7.saleTagImg
|
|
99
|
+
},
|
|
100
|
+
style: styles.confettiImage
|
|
101
|
+
}), /*#__PURE__*/_react.default.createElement(_GradientBorderContainer.default, {
|
|
102
|
+
borderGradientColors: ["#ffa800", "#ffe978", "#ffa800"],
|
|
103
|
+
backgroundGradientColors: ["#200042", "#170134ff", "#0a0013ff"],
|
|
104
|
+
borderWidth: 1,
|
|
105
|
+
borderRadius: 20 * ratio,
|
|
106
|
+
style: styles.mainContainer,
|
|
107
|
+
contentContainerStyle: styles.container
|
|
108
|
+
}, (pageData === null || pageData === void 0 || (_pageData$winbackPopu8 = pageData.winbackPopup) === null || _pageData$winbackPopu8 === void 0 ? void 0 : _pageData$winbackPopu8.savedAmount) && /*#__PURE__*/_react.default.createElement(_GradientText.default, {
|
|
109
|
+
colors: ["#ffa800", "#ffe978", "#ffa800"],
|
|
110
|
+
style: styles.heading
|
|
111
|
+
}, heading), (pageData === null || pageData === void 0 || (_pageData$winbackPopu9 = pageData.winbackPopup) === null || _pageData$winbackPopu9 === void 0 ? void 0 : _pageData$winbackPopu9.couponApplied) && (pageData === null || pageData === void 0 || (_pageData$winbackPopu0 = pageData.winbackPopup) === null || _pageData$winbackPopu0 === void 0 ? void 0 : _pageData$winbackPopu0.couponApplied2) && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
112
|
+
style: styles.subHeading
|
|
113
|
+
}, subHeading, couponApplied2), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
114
|
+
style: styles.button,
|
|
115
|
+
onPress: closePopUp,
|
|
116
|
+
activeOpacity: 0.8,
|
|
117
|
+
hitSlop: {
|
|
118
|
+
top: 15,
|
|
119
|
+
bottom: 15,
|
|
120
|
+
left: 15,
|
|
121
|
+
right: 15
|
|
122
|
+
}
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
124
|
+
style: styles.buttonText
|
|
125
|
+
}, pageData === null || pageData === void 0 || (_pageData$winbackPopu1 = pageData.winbackPopup) === null || _pageData$winbackPopu1 === void 0 ? void 0 : _pageData$winbackPopu1.desc)))));
|
|
126
|
+
};
|
|
127
|
+
var _default = exports.default = CouponPopUp;
|
|
128
|
+
const styles = _reactNative.StyleSheet.create({
|
|
129
|
+
outerContainer: {
|
|
130
|
+
width: ratio * ((0, _commonUtils.isTablet)() ? 450 : 320),
|
|
131
|
+
height: ratio * 160
|
|
132
|
+
},
|
|
133
|
+
mainContainer: {
|
|
134
|
+
justifyContent: "center",
|
|
135
|
+
alignItems: "center"
|
|
136
|
+
},
|
|
137
|
+
container: {
|
|
138
|
+
justifyContent: "space-around",
|
|
139
|
+
alignItems: "center",
|
|
140
|
+
paddingTop: 30 * ratio,
|
|
141
|
+
paddingHorizontal: 50 * ratio
|
|
142
|
+
},
|
|
143
|
+
linearGradient: {
|
|
144
|
+
position: "absolute",
|
|
145
|
+
top: 0,
|
|
146
|
+
right: 0,
|
|
147
|
+
left: 0,
|
|
148
|
+
bottom: 0,
|
|
149
|
+
flex: 1
|
|
150
|
+
},
|
|
151
|
+
confettiImage: {
|
|
152
|
+
width: 65 * ratio,
|
|
153
|
+
height: 65 * ratio,
|
|
154
|
+
position: "absolute",
|
|
155
|
+
top: -40 * ratio,
|
|
156
|
+
zIndex: 999,
|
|
157
|
+
alignSelf: "center"
|
|
158
|
+
},
|
|
159
|
+
detailsContainer: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
alignItems: "center"
|
|
162
|
+
},
|
|
163
|
+
heading: {
|
|
164
|
+
fontSize: _AppConstant.AppConstant.normalizeFont(20),
|
|
165
|
+
color: "#ffa800",
|
|
166
|
+
fontFamily: _fontUtils.FONTS.SemiBold,
|
|
167
|
+
textAlign: "center"
|
|
168
|
+
},
|
|
169
|
+
subHeading: {
|
|
170
|
+
fontSize: _AppConstant.AppConstant.normalizeFont(16),
|
|
171
|
+
color: "white",
|
|
172
|
+
flexWrap: "wrap",
|
|
173
|
+
textAlign: "center",
|
|
174
|
+
marginTop: 10 * ratio,
|
|
175
|
+
fontFamily: _fontUtils.FONTS.Medium
|
|
176
|
+
},
|
|
177
|
+
button: {
|
|
178
|
+
marginVertical: 15 * ratio
|
|
179
|
+
},
|
|
180
|
+
buttonText: {
|
|
181
|
+
fontSize: _AppConstant.AppConstant.normalizeFont(16),
|
|
182
|
+
color: "#f3cce3",
|
|
183
|
+
fontFamily: _fontUtils.FONTS.SemiBold
|
|
184
|
+
}
|
|
185
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _AppConstant = require("../../../assets/AppConstant");
|
|
10
|
+
var _fontUtils = require("../../../utils/fontUtils");
|
|
11
|
+
var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
|
|
12
|
+
var _commonUtils = require("../../../utils/commonUtils");
|
|
13
|
+
var _PrimaryButton = _interopRequireDefault(require("../../Buttons/PrimaryButton/PrimaryButton"));
|
|
14
|
+
var _react = require("react");
|
|
15
|
+
const ErrorMsgPopup = ({
|
|
16
|
+
modalData,
|
|
17
|
+
journeySource,
|
|
18
|
+
exitJourney,
|
|
19
|
+
onClose
|
|
20
|
+
}) => {
|
|
21
|
+
const scaleAnim = (0, _reactNative.useAnimatedValue)(0.8);
|
|
22
|
+
const opacityAnim = (0, _reactNative.useAnimatedValue)(0);
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
_reactNative.Animated.parallel([_reactNative.Animated.spring(scaleAnim, {
|
|
25
|
+
toValue: 1,
|
|
26
|
+
friction: 6,
|
|
27
|
+
useNativeDriver: true
|
|
28
|
+
}), _reactNative.Animated.timing(opacityAnim, {
|
|
29
|
+
toValue: 1,
|
|
30
|
+
duration: 250,
|
|
31
|
+
useNativeDriver: true
|
|
32
|
+
})]).start();
|
|
33
|
+
}, [scaleAnim, opacityAnim]);
|
|
34
|
+
const closeModal = () => {
|
|
35
|
+
_reactNative.Animated.parallel([_reactNative.Animated.timing(scaleAnim, {
|
|
36
|
+
toValue: 0.8,
|
|
37
|
+
duration: 150,
|
|
38
|
+
useNativeDriver: true
|
|
39
|
+
}), _reactNative.Animated.timing(opacityAnim, {
|
|
40
|
+
toValue: 0,
|
|
41
|
+
duration: 150,
|
|
42
|
+
useNativeDriver: true
|
|
43
|
+
})]).start(() => {
|
|
44
|
+
onClose();
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
48
|
+
style: [styles.mainContainer, {
|
|
49
|
+
transform: [{
|
|
50
|
+
scale: scaleAnim
|
|
51
|
+
}],
|
|
52
|
+
opacity: opacityAnim
|
|
53
|
+
}]
|
|
54
|
+
}, /*#__PURE__*/React.createElement(_reactNativeLinearGradient.default, {
|
|
55
|
+
colors: ["#200042", "#170134ff", "#0a0013ff"],
|
|
56
|
+
start: {
|
|
57
|
+
x: 0,
|
|
58
|
+
y: 0
|
|
59
|
+
},
|
|
60
|
+
end: {
|
|
61
|
+
x: 1,
|
|
62
|
+
y: 0
|
|
63
|
+
},
|
|
64
|
+
style: styles.backgroundGradient
|
|
65
|
+
}), /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
66
|
+
style: styles.subHeading
|
|
67
|
+
}, modalData), journeySource === "PULSEFTV" && /*#__PURE__*/React.createElement(_PrimaryButton.default, {
|
|
68
|
+
title: "Exit",
|
|
69
|
+
onPress: () => {
|
|
70
|
+
exitJourney();
|
|
71
|
+
closeModal();
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
var _default = exports.default = ErrorMsgPopup;
|
|
76
|
+
const ratio = _AppConstant.AppConstant.dimension.aspectRatio;
|
|
77
|
+
const styles = _reactNative.StyleSheet.create({
|
|
78
|
+
mainContainer: {
|
|
79
|
+
width: ratio * ((0, _commonUtils.isTablet)() ? 450 : 340),
|
|
80
|
+
justifyContent: "center",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
paddingHorizontal: 20 * ratio,
|
|
83
|
+
paddingVertical: 10 * ratio,
|
|
84
|
+
borderWidth: 1,
|
|
85
|
+
borderColor: "#554372",
|
|
86
|
+
borderRadius: 14 * ratio,
|
|
87
|
+
marginHorizontal: 10 * ratio
|
|
88
|
+
},
|
|
89
|
+
backgroundGradient: {
|
|
90
|
+
borderRadius: 14 * ratio,
|
|
91
|
+
position: "absolute",
|
|
92
|
+
top: 0,
|
|
93
|
+
left: 0,
|
|
94
|
+
right: 0,
|
|
95
|
+
bottom: 0
|
|
96
|
+
},
|
|
97
|
+
subHeading: {
|
|
98
|
+
fontSize: (0, _AppConstant.normalizeFont)(14),
|
|
99
|
+
color: "white",
|
|
100
|
+
marginVertical: 20 * ratio,
|
|
101
|
+
textAlign: "center",
|
|
102
|
+
fontFamily: _fontUtils.FONTS.Medium
|
|
103
|
+
}
|
|
104
|
+
});
|