@propel-nsl/propel-react-native-sdk 1.0.0

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 (221) hide show
  1. package/assets/fonts/Lexend-Black.ttf +0 -0
  2. package/assets/fonts/Lexend-Bold.ttf +0 -0
  3. package/assets/fonts/Lexend-ExtraBold.ttf +0 -0
  4. package/assets/fonts/Lexend-ExtraLight.ttf +0 -0
  5. package/assets/fonts/Lexend-Light.ttf +0 -0
  6. package/assets/fonts/Lexend-Medium.ttf +0 -0
  7. package/assets/fonts/Lexend-Regular.ttf +0 -0
  8. package/assets/fonts/Lexend-SemiBold.ttf +0 -0
  9. package/assets/fonts/Lexend-Thin.ttf +0 -0
  10. package/assets/images/HomeGoods.png +0 -0
  11. package/assets/images/accessories.png +0 -0
  12. package/assets/images/amazon.png +0 -0
  13. package/assets/images/apnaClubLogo.png +0 -0
  14. package/assets/images/apparel.png +0 -0
  15. package/assets/images/backgroundblue.png +0 -0
  16. package/assets/images/bannerCard.png +0 -0
  17. package/assets/images/bottomWave.png +0 -0
  18. package/assets/images/coin_1_1.png +0 -0
  19. package/assets/images/flipkart.png +0 -0
  20. package/assets/images/frame_1171278967.png +0 -0
  21. package/assets/images/gift.png +0 -0
  22. package/assets/images/herobanner.png +0 -0
  23. package/assets/images/hinduPencilsLogo.png +0 -0
  24. package/assets/images/icons/addwhiteicon.png +0 -0
  25. package/assets/images/icons/arrow-back.png +0 -0
  26. package/assets/images/icons/arrowgreen.png +0 -0
  27. package/assets/images/icons/arrowred.png +0 -0
  28. package/assets/images/icons/arrowright.png +0 -0
  29. package/assets/images/icons/arrowup.png +0 -0
  30. package/assets/images/icons/blackarrowdown.png +0 -0
  31. package/assets/images/icons/blackarrowup.png +0 -0
  32. package/assets/images/icons/blackcross.png +0 -0
  33. package/assets/images/icons/call.png +0 -0
  34. package/assets/images/icons/camera.png +0 -0
  35. package/assets/images/icons/cart.png +0 -0
  36. package/assets/images/icons/chat.png +0 -0
  37. package/assets/images/icons/circleblack.png +0 -0
  38. package/assets/images/icons/copy.png +0 -0
  39. package/assets/images/icons/cross.png +0 -0
  40. package/assets/images/icons/delete.png +0 -0
  41. package/assets/images/icons/delivery.png +0 -0
  42. package/assets/images/icons/eVoucher.png +0 -0
  43. package/assets/images/icons/editIcon.png +0 -0
  44. package/assets/images/icons/email.png +0 -0
  45. package/assets/images/icons/eye.png +0 -0
  46. package/assets/images/icons/faq.png +0 -0
  47. package/assets/images/icons/filtericon.png +0 -0
  48. package/assets/images/icons/greyDownArrow.png +0 -0
  49. package/assets/images/icons/help.png +0 -0
  50. package/assets/images/icons/home.png +0 -0
  51. package/assets/images/icons/homeinactive.png +0 -0
  52. package/assets/images/icons/i_blackicon.png +0 -0
  53. package/assets/images/icons/i_icon.png +0 -0
  54. package/assets/images/icons/location.png +0 -0
  55. package/assets/images/icons/logout.png +0 -0
  56. package/assets/images/icons/minus.png +0 -0
  57. package/assets/images/icons/myOrders.png +0 -0
  58. package/assets/images/icons/orders.png +0 -0
  59. package/assets/images/icons/pencillogo.png +0 -0
  60. package/assets/images/icons/pending.png +0 -0
  61. package/assets/images/icons/plus.png +0 -0
  62. package/assets/images/icons/redCross.png +0 -0
  63. package/assets/images/icons/redCrossicon.png +0 -0
  64. package/assets/images/icons/redWarningicon.png +0 -0
  65. package/assets/images/icons/redeem.png +0 -0
  66. package/assets/images/icons/redeemactive.png +0 -0
  67. package/assets/images/icons/redemptionHistory.png +0 -0
  68. package/assets/images/icons/redhelpicon.png +0 -0
  69. package/assets/images/icons/search.png +0 -0
  70. package/assets/images/icons/stopwatch.png +0 -0
  71. package/assets/images/icons/successTick.gif +0 -0
  72. package/assets/images/icons/tick.png +0 -0
  73. package/assets/images/icons/tnc.png +0 -0
  74. package/assets/images/icons/user.png +0 -0
  75. package/assets/images/icons/userredicon.png +0 -0
  76. package/assets/images/icons/wavecorner.png +0 -0
  77. package/assets/images/logo.png +0 -0
  78. package/assets/images/myntra_copy.png +0 -0
  79. package/assets/images/nike.png +0 -0
  80. package/assets/images/oq3p0u0_1.png +0 -0
  81. package/assets/images/profileicon.png +0 -0
  82. package/assets/images/topWave.png +0 -0
  83. package/assets/images/zagglePropelLogo.png +0 -0
  84. package/index.ts +23 -0
  85. package/lib/index.ts +25 -0
  86. package/package.json +70 -0
  87. package/src/PropelSDKScreen.tsx +98 -0
  88. package/src/SDKApp.tsx +540 -0
  89. package/src/bridge/SDKBridge.ts +104 -0
  90. package/src/bridge/index.ts +3 -0
  91. package/src/components/SDKBackHandler.tsx +187 -0
  92. package/src/components/SDKProfile.tsx +87 -0
  93. package/src/components/SDKProfileWrapper.tsx +51 -0
  94. package/src/constants.ts +10 -0
  95. package/src/contexts/SDKContext.tsx +72 -0
  96. package/src/hooks/useSDKBackNavigation.ts +61 -0
  97. package/src/navigation/SDKMainTabNavigator.tsx +315 -0
  98. package/src/navigation/SDKNavigator.tsx +41 -0
  99. package/src/redux/store.ts +32 -0
  100. package/src/screens/Dashboard/index.tsx +531 -0
  101. package/src/screens/Dashboard/styles.ts +512 -0
  102. package/src/screens/DeliveryAddress/index.tsx +221 -0
  103. package/src/screens/DeliveryAddress/styles.ts +122 -0
  104. package/src/screens/E-Vouchers/index.tsx +157 -0
  105. package/src/screens/E-Vouchers/styles.ts +106 -0
  106. package/src/screens/Faq/Faq.constants.ts +164 -0
  107. package/src/screens/Faq/index.tsx +114 -0
  108. package/src/screens/Faq/styles.ts +131 -0
  109. package/src/screens/Help/index.tsx +128 -0
  110. package/src/screens/Help/styles.ts +121 -0
  111. package/src/screens/Login/index.tsx +215 -0
  112. package/src/screens/Login/styles.ts +134 -0
  113. package/src/screens/MyCart/MyCart.constants.ts +13 -0
  114. package/src/screens/MyCart/index.tsx +318 -0
  115. package/src/screens/MyCart/styles.ts +249 -0
  116. package/src/screens/MyOrders/index.tsx +87 -0
  117. package/src/screens/MyOrders/styles.ts +281 -0
  118. package/src/screens/MyProfile/index.tsx +72 -0
  119. package/src/screens/MyProfile/styles.ts +47 -0
  120. package/src/screens/NewDeliveryAddress/index.tsx +360 -0
  121. package/src/screens/NewDeliveryAddress/styles.ts +68 -0
  122. package/src/screens/Onboarding/index.tsx +57 -0
  123. package/src/screens/Onboarding/styles.ts +60 -0
  124. package/src/screens/OrdersDetails/index.tsx +333 -0
  125. package/src/screens/OrdersDetails/styles.ts +262 -0
  126. package/src/screens/OtpVerification/index.tsx +283 -0
  127. package/src/screens/OtpVerification/styles.ts +197 -0
  128. package/src/screens/PaymentMethod/index.tsx +389 -0
  129. package/src/screens/PaymentMethod/styles.ts +246 -0
  130. package/src/screens/PointsLog/index.tsx +286 -0
  131. package/src/screens/PointsLog/styles.ts +156 -0
  132. package/src/screens/ProductDetails/index.tsx +682 -0
  133. package/src/screens/ProductDetails/styles.ts +372 -0
  134. package/src/screens/Profile/index.tsx +368 -0
  135. package/src/screens/Profile/styles.ts +158 -0
  136. package/src/screens/RedemptionHistory/RedemptionHistory.constants.ts +4 -0
  137. package/src/screens/RedemptionHistory/index.tsx +304 -0
  138. package/src/screens/RedemptionHistory/styles.ts +84 -0
  139. package/src/screens/Reedem/index.tsx +345 -0
  140. package/src/screens/Reedem/styles.ts +269 -0
  141. package/src/screens/TnC/TnC.constants.ts +169 -0
  142. package/src/screens/TnC/index.tsx +83 -0
  143. package/src/screens/TnC/styles.ts +88 -0
  144. package/src/screens/TransactionSuccessful/index.tsx +77 -0
  145. package/src/screens/TransactionSuccessful/styles.ts +77 -0
  146. package/src/screens/Verification/index.tsx +58 -0
  147. package/src/screens/Verification/styles.ts +74 -0
  148. package/src/screens/index.ts +23 -0
  149. package/src/types/index.ts +46 -0
  150. package/src-app/components/AmountBreakDownModal/index.tsx +86 -0
  151. package/src-app/components/AmountBreakDownModal/styles.ts +110 -0
  152. package/src-app/components/BottomNavIcons.tsx +125 -0
  153. package/src-app/components/Button.tsx +120 -0
  154. package/src-app/components/Card.tsx +47 -0
  155. package/src-app/components/ConfirmPopup/ConfirmPopup.constants.ts +25 -0
  156. package/src-app/components/ConfirmPopup/index.tsx +48 -0
  157. package/src-app/components/ConfirmPopup/styles.ts +167 -0
  158. package/src-app/components/CustomButton/index.tsx +67 -0
  159. package/src-app/components/CustomButton/styles.ts +44 -0
  160. package/src-app/components/CustomCard/index.tsx +221 -0
  161. package/src-app/components/CustomCard/styles.ts +184 -0
  162. package/src-app/components/CustomError/index.tsx +54 -0
  163. package/src-app/components/CustomError/styles.ts +41 -0
  164. package/src-app/components/CustomImage/index.tsx +37 -0
  165. package/src-app/components/CustomImage/styles.ts +5 -0
  166. package/src-app/components/CustomLoader/index.tsx +45 -0
  167. package/src-app/components/CustomLoader/styles.ts +35 -0
  168. package/src-app/components/CustomMessagePopUp/index.tsx +51 -0
  169. package/src-app/components/CustomMessagePopUp/styles.ts +74 -0
  170. package/src-app/components/CustomProductCard/index.tsx +13 -0
  171. package/src-app/components/CustomProductCard/styles.ts +5 -0
  172. package/src-app/components/FilterModal.tsx +372 -0
  173. package/src-app/components/Footer/index.tsx +23 -0
  174. package/src-app/components/Footer/styles.ts +37 -0
  175. package/src-app/components/Icon.tsx +80 -0
  176. package/src-app/components/Logout/index.tsx +82 -0
  177. package/src-app/components/Logout/styles.ts +116 -0
  178. package/src-app/components/MobileHeader.tsx +141 -0
  179. package/src-app/components/NoDataFound/index.tsx +18 -0
  180. package/src-app/components/NoDataFound/styles.ts +26 -0
  181. package/src-app/components/OTPModal.tsx +747 -0
  182. package/src-app/components/ProfileField.tsx +47 -0
  183. package/src-app/components/QuantityModal/index.tsx +113 -0
  184. package/src-app/components/QuantityModal/styles.ts +84 -0
  185. package/src-app/components/TabBarIcons.tsx +110 -0
  186. package/src-app/components/TextInput.tsx +79 -0
  187. package/src-app/components/ToastConfig.tsx +60 -0
  188. package/src-app/components/index.ts +18 -0
  189. package/src-app/config/env.ts +22 -0
  190. package/src-app/constants/Fonts.ts +12 -0
  191. package/src-app/constants/Formatter.ts +39 -0
  192. package/src-app/constants/HtmlSanitization.ts +46 -0
  193. package/src-app/constants/Images.ts +81 -0
  194. package/src-app/constants/Labels.ts +8 -0
  195. package/src-app/constants/Messages.ts +108 -0
  196. package/src-app/constants/Routes.ts +17 -0
  197. package/src-app/constants/Scaling.ts +5 -0
  198. package/src-app/constants/Text.ts +8 -0
  199. package/src-app/constants/offSets.ts +18 -0
  200. package/src-app/hooks/useAppDispatch.ts +4 -0
  201. package/src-app/hooks/useAppSelector.ts +4 -0
  202. package/src-app/hooks/useBackHandler.ts +47 -0
  203. package/src-app/hooks/useScreenBackHandler.ts +91 -0
  204. package/src-app/navigation/AppNavigator.tsx +34 -0
  205. package/src-app/navigation/MainTabNavigator.tsx +294 -0
  206. package/src-app/redux/authSaga.ts +605 -0
  207. package/src-app/redux/authSlice.ts +754 -0
  208. package/src-app/redux/rootSaga.ts +6 -0
  209. package/src-app/redux/store.ts +25 -0
  210. package/src-app/services/api.ts +14 -0
  211. package/src-app/services/endpoints.ts +33 -0
  212. package/src-app/services/index.ts +574 -0
  213. package/src-app/services/sdkCredentials.ts +44 -0
  214. package/src-app/styles/colors.ts +85 -0
  215. package/src-app/styles/shared.ts +112 -0
  216. package/src-app/types/authTypes.ts +155 -0
  217. package/src-app/types/navigation.ts +99 -0
  218. package/src-app/utils/Validation.ts +48 -0
  219. package/src-app/utils/filterPins.ts +29 -0
  220. package/src-app/utils/navigationUtils.ts +43 -0
  221. package/src-app/utils/useHardwareBack.ts +21 -0
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, ViewStyle, TextStyle } from 'react-native';
3
+ import FontFamily from '../constants/Fonts';
4
+
5
+ interface ProfileFieldProps {
6
+ label: string;
7
+ value: string;
8
+ containerStyle?: ViewStyle;
9
+ labelStyle?: TextStyle;
10
+ }
11
+
12
+ const ProfileField: React.FC<ProfileFieldProps> = ({
13
+ label,
14
+ value,
15
+ containerStyle,
16
+ labelStyle,
17
+ }) => {
18
+ return (
19
+ <View style={[styles.inputContainer, containerStyle]}>
20
+ <Text style={[styles.label, labelStyle]}>{label}</Text>
21
+ <Text style={[styles.label, labelStyle]}>{value}</Text>
22
+ </View>
23
+ );
24
+ };
25
+
26
+ const styles = StyleSheet.create({
27
+ inputContainer: {
28
+ borderWidth: 1,
29
+ borderColor: '#D1D5DB',
30
+ borderRadius: 12,
31
+ backgroundColor: '#F3F4F7',
32
+ paddingHorizontal: 20,
33
+ marginBottom: '7%',
34
+ },
35
+ content: {
36
+ padding: 20,
37
+ },
38
+ label: {
39
+ fontFamily: FontFamily.LEXEND_REGULAR,
40
+ fontSize: 12,
41
+ fontWeight: 400,
42
+ color: '#6B7280',
43
+ paddingVertical: 10,
44
+ },
45
+ });
46
+
47
+ export default ProfileField;
@@ -0,0 +1,113 @@
1
+ import React, { useRef, useEffect, useState } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ ScrollView,
6
+ TouchableOpacity,
7
+ TouchableWithoutFeedback,
8
+ } from 'react-native';
9
+ import styles from './styles';
10
+ import CustomButton from '../CustomButton';
11
+ import { VSCALE } from '../../constants/Scaling';
12
+ import { colors } from '../../styles/colors';
13
+
14
+ interface OTPModalProps {
15
+ visible: boolean;
16
+ onClose: () => void;
17
+ onSelectQuantity: (quantity: number, index: number) => void;
18
+ onCancel: () => void;
19
+ onUpdate: () => void;
20
+ selectedQuantity: number;
21
+ }
22
+
23
+ const QuantityModal: React.FC<OTPModalProps> = ({
24
+ visible,
25
+ onClose,
26
+ onSelectQuantity,
27
+ onCancel,
28
+ onUpdate,
29
+ selectedQuantity,
30
+ }) => {
31
+ const scrollViewRef = useRef<ScrollView>(null);
32
+ const [isButtonClicked, setIsButtonClicked] = useState<number | null>(null);
33
+
34
+ useEffect(() => {
35
+ if (visible && selectedQuantity !== null) {
36
+ const defaultIndex = selectedQuantity - 1;
37
+ setIsButtonClicked(defaultIndex);
38
+
39
+ // Scroll to selected item
40
+ setTimeout(() => {
41
+ scrollViewRef.current?.scrollTo({
42
+ x: defaultIndex * VSCALE(45),
43
+ animated: true,
44
+ });
45
+ }, 100);
46
+ }
47
+ }, [visible, selectedQuantity]);
48
+
49
+ const quantityArray = Array.from({ length: 20 }, (_, i) => i + 1);
50
+
51
+ const handleQuantity = (quantity: number, index: number) => {
52
+ setIsButtonClicked(index);
53
+ onSelectQuantity(quantity, index);
54
+ };
55
+
56
+ if (!visible) return null;
57
+
58
+ return (
59
+ <View style={styles.absoluteContainer} pointerEvents="box-none">
60
+ <TouchableWithoutFeedback onPress={onClose}>
61
+ <View style={styles.overlay} />
62
+ </TouchableWithoutFeedback>
63
+ <View style={styles.modalContainer}>
64
+ <View style={styles.handleBar} />
65
+ <Text style={styles.title}>Quantity</Text>
66
+
67
+ <ScrollView
68
+ ref={scrollViewRef}
69
+ horizontal
70
+ showsHorizontalScrollIndicator={false}
71
+ contentContainerStyle={{ paddingHorizontal: 10 }}
72
+ >
73
+ {quantityArray.map((item, index) => (
74
+ <TouchableOpacity
75
+ key={index}
76
+ activeOpacity={0.7}
77
+ onPress={() => handleQuantity(item, index)}
78
+ style={[
79
+ styles.quantityContainer,
80
+ isButtonClicked === index &&
81
+ styles.quantityContainerActive,
82
+ ]}
83
+ >
84
+ <Text style={styles.amountPoints}>{item}</Text>
85
+ </TouchableOpacity>
86
+ ))}
87
+ </ScrollView>
88
+
89
+ <View style={styles.row}>
90
+ <CustomButton
91
+ customButtonContainerStyle={{ width: VSCALE(120) }}
92
+ buttonStyle={{
93
+ backgroundColor: 'white',
94
+ borderWidth: 1,
95
+ borderColor: colors.black,
96
+ }}
97
+ title="Cancel"
98
+ onPress={onCancel}
99
+ textStyle={{ color: colors.black, left: VSCALE(0) }}
100
+ />
101
+ <CustomButton
102
+ customButtonContainerStyle={{ width: VSCALE(120) }}
103
+ title="Update"
104
+ onPress={onUpdate}
105
+ textStyle={{ right: VSCALE(0) }}
106
+ />
107
+ </View>
108
+ </View>
109
+ </View>
110
+ );
111
+ };
112
+
113
+ export default QuantityModal;
@@ -0,0 +1,84 @@
1
+ import { Platform, StyleSheet, Dimensions } from 'react-native';
2
+ import FontFamily from '../../constants/Fonts';
3
+ import { VSCALE, SCALE } from '../../constants/Scaling';
4
+ import { colors } from '../../styles/colors';
5
+
6
+ const { height: screenHeight, width: screenWidth } = Dimensions.get('window');
7
+
8
+ const styles = StyleSheet.create({
9
+ absoluteContainer: {
10
+ position: 'absolute',
11
+ top: 0,
12
+ left: 0,
13
+ right: 0,
14
+ bottom: 0,
15
+ width: screenWidth,
16
+ height: screenHeight,
17
+ justifyContent: 'flex-end',
18
+ zIndex: 50000,
19
+ elevation: 50000,
20
+ },
21
+ overlay: {
22
+ position: 'absolute',
23
+ top: 0,
24
+ left: 0,
25
+ right: 0,
26
+ bottom: 0,
27
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
28
+ },
29
+ modalContainer: {
30
+ width: '100%',
31
+ maxWidth: '100%',
32
+ height: Platform.OS === 'ios' ? VSCALE(230) : VSCALE(250),
33
+ backgroundColor: '#FFFFFF',
34
+ borderTopLeftRadius: SCALE(30),
35
+ borderTopRightRadius: SCALE(30),
36
+ paddingHorizontal: SCALE(20),
37
+ paddingTop: VSCALE(15),
38
+ },
39
+ handleBar: {
40
+ width: SCALE(48),
41
+ height: VSCALE(4),
42
+ backgroundColor: colors.outline,
43
+ borderRadius: SCALE(6),
44
+ alignSelf: 'center',
45
+ marginBottom: VSCALE(27),
46
+ },
47
+ title: {
48
+ fontFamily: FontFamily.LEXEND_REGULAR,
49
+ fontSize: SCALE(16),
50
+ fontWeight: '500',
51
+ color: colors.black,
52
+ textTransform: 'capitalize',
53
+ marginBottom: VSCALE(20),
54
+ },
55
+ amountPoints: {
56
+ fontFamily: FontFamily.LEXEND_REGULAR,
57
+ fontSize: SCALE(16),
58
+ fontWeight: '600',
59
+ color: colors.black,
60
+ textTransform: 'capitalize',
61
+ },
62
+ quantityContainer: {
63
+ borderWidth: 1,
64
+ borderColor: colors.outline ,
65
+ borderRadius: SCALE(8),
66
+ marginRight: SCALE(10),
67
+ width: SCALE(54),
68
+ height: VSCALE(40),
69
+ alignItems: 'center',
70
+ justifyContent: 'center',
71
+ backgroundColor: colors.lightbgColor,
72
+ right: VSCALE(8),
73
+ },
74
+ row: {
75
+ flexDirection: 'row',
76
+ justifyContent: 'space-between',
77
+ alignItems: 'center',
78
+ },
79
+ quantityContainerActive: {
80
+ borderColor: colors.darkGrey ,
81
+ },
82
+ });
83
+
84
+ export default styles;
@@ -0,0 +1,110 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import Svg, { Path, G, Defs, ClipPath, Rect } from "react-native-svg";
4
+
5
+ interface IconProps {
6
+ color: string;
7
+ focused?: boolean;
8
+ }
9
+
10
+ export const HomeIcon: React.FC<IconProps> = ({ color }) => (
11
+ <Svg width="24" height="24" viewBox="0 0 24 24" fill="none">
12
+ <Path
13
+ d="M9.50012 17.6772C9.22398 17.6772 9.00012 17.9011 9.00012 18.1772C9.00012 18.4533 9.22398 18.6772 9.50012 18.6772H14.5001C14.7762 18.6772 15.0001 18.4533 15.0001 18.1772C15.0001 17.9011 14.7762 17.6772 14.5001 17.6772H9.50012Z"
14
+ fill={color}
15
+ stroke={color}
16
+ strokeWidth="0.366869"
17
+ />
18
+ <Path
19
+ fillRule="evenodd"
20
+ clipRule="evenodd"
21
+ d="M14.1688 2.75291C12.8972 1.74903 11.1028 1.74903 9.83124 2.75291L3.33124 7.88449C2.49051 8.54823 2 9.56041 2 10.6316V18.6778C2 20.6108 3.567 22.1778 5.5 22.1778H18.5C20.433 22.1778 22 20.6108 22 18.6778V10.6316C22 9.56041 21.5095 8.54823 20.6688 7.88449L14.1688 2.75291ZM10.4509 3.53779C11.3592 2.82073 12.6408 2.82073 13.5491 3.53779L20.0491 8.66937C20.6496 9.14347 21 9.86646 21 10.6316V18.6778C21 20.0585 19.8807 21.1778 18.5 21.1778H5.5C4.11929 21.1778 3 20.0585 3 18.6778V10.6316C3 9.86646 3.35036 9.14347 3.95089 8.66937L10.4509 3.53779Z"
22
+ fill={color}
23
+ stroke={color}
24
+ strokeWidth="0.366869"
25
+ />
26
+ </Svg>
27
+ );
28
+
29
+ export const RedeemIcon: React.FC<IconProps> = ({ color }) => (
30
+ <Svg width="24" height="24" viewBox="0 0 25 25" fill="none">
31
+ <Path
32
+ d="M12.4999 15.0107C12.9167 15.0107 13.2548 15.3489 13.2548 15.7656V19.2031C13.2548 19.6199 12.9167 19.958 12.4999 19.958C12.0831 19.958 11.745 19.6199 11.745 19.2031V15.7656C11.745 15.3489 12.0831 15.0107 12.4999 15.0107Z"
33
+ fill={color}
34
+ stroke="white"
35
+ strokeWidth="0.209524"
36
+ />
37
+ <Path
38
+ d="M21.0938 14.595C21.5105 14.595 21.8486 14.9331 21.8486 15.3499V18.7874C21.8486 21.0988 19.9677 22.9797 17.6562 22.9797H7.34375C5.03231 22.9797 3.15137 21.0988 3.15137 18.7874V15.3499C3.15137 14.9331 3.48948 14.595 3.90625 14.595C4.32302 14.595 4.66113 14.9331 4.66113 15.3499V18.7874C4.66113 20.2668 5.86431 21.47 7.34375 21.47H17.6562C19.1357 21.47 20.3389 20.2668 20.3389 18.7874V15.3499C20.3389 14.9331 20.677 14.595 21.0938 14.595Z"
39
+ fill={color}
40
+ stroke="white"
41
+ strokeWidth="0.209524"
42
+ />
43
+ <Path
44
+ d="M15.0781 1.60449C16.9157 1.60449 18.4111 3.09992 18.4111 4.9375C18.4111 5.54416 18.2474 6.11294 17.9629 6.60352L17.8711 6.76074H20.9219C22.2856 6.76074 23.3955 7.87066 23.3955 9.23438V10.9531C23.3955 12.3168 22.2856 13.4268 20.9219 13.4268H4.07812C2.71441 13.4268 1.60449 12.3168 1.60449 10.9531V9.23438C1.60449 7.87066 2.71441 6.76074 4.07812 6.76074H7.12891L7.03711 6.60352C6.75262 6.11294 6.58887 5.54416 6.58887 4.9375C6.58887 3.09992 8.0843 1.60449 9.92188 1.60449C10.9163 1.60449 11.8104 2.04276 12.4219 2.73633L12.5 2.82617L12.5781 2.73633C13.1896 2.04276 14.0837 1.60449 15.0781 1.60449ZM4.07812 8.27051C3.54641 8.27051 3.11426 8.70266 3.11426 9.23438V10.9531C3.11426 11.4848 3.54641 11.917 4.07812 11.917H20.9219C21.4536 11.917 21.8857 11.4848 21.8857 10.9531V9.23438C21.8857 8.70266 21.4536 8.27051 20.9219 8.27051H13.2549V9.23438C13.2549 9.65115 12.9168 9.98926 12.5 9.98926C12.0832 9.98926 11.7451 9.65115 11.7451 9.23438V8.27051H4.07812ZM9.92188 3.11426C8.9163 3.11426 8.09863 3.93192 8.09863 4.9375C8.09863 5.94308 8.9163 6.76074 9.92188 6.76074H11.7451V4.9375C11.7451 3.93192 10.9275 3.11426 9.92188 3.11426ZM15.0781 3.11426C14.0725 3.11426 13.2549 3.93192 13.2549 4.9375V6.76074H15.0781C16.0837 6.76074 16.9014 5.94308 16.9014 4.9375C16.9014 3.93192 16.0837 3.11426 15.0781 3.11426Z"
45
+ fill={color}
46
+ stroke="white"
47
+ strokeWidth="0.209524"
48
+ />
49
+ </Svg>
50
+ );
51
+
52
+ export const PersonIcon: React.FC<IconProps> = ({ color }) => (
53
+ <Svg width="20" height="20" viewBox="0 0 21 21" fill="none">
54
+ <G clipPath="url(#clip0_249_5095)">
55
+ <Path
56
+ d="M11.3046 10.8402C9.00489 10.8402 7.13452 8.96988 7.13452 6.67012C7.13452 4.37036 9.00489 2.5 11.3046 2.5C13.6044 2.5 15.4748 4.37036 15.4748 6.67012C15.4748 8.96988 13.6044 10.8402 11.3046 10.8402ZM11.3046 3.81452C9.73196 3.81452 8.45168 5.0948 8.45168 6.66749C8.45168 8.24017 9.72932 9.52308 11.3046 9.52308C12.88 9.52308 14.1576 8.24281 14.1576 6.67012C14.1576 5.09743 12.8773 3.81452 11.3046 3.81452Z"
57
+ fill={color}
58
+ />
59
+ <Path
60
+ d="M11.3044 20.5001C9.54998 20.5001 7.89036 20.105 6.63116 19.3858C5.25605 18.6008 4.5 17.5154 4.5 16.33C4.5 15.1445 5.25605 14.0592 6.63116 13.2742C7.89036 12.5524 9.54998 12.1572 11.3044 12.1572C13.0589 12.1572 14.7185 12.5524 15.9777 13.2715C17.3528 14.0566 18.1089 15.1419 18.1089 16.3273C18.1089 17.5128 17.3528 18.5981 15.9777 19.3832C14.7185 20.1023 13.0589 20.5001 11.3044 20.5001ZM11.3044 13.4744C9.77653 13.4744 8.34873 13.8089 7.28447 14.4175C6.73653 14.731 5.81716 15.3948 5.81716 16.33C5.81716 17.2625 6.73653 17.929 7.28447 18.2425C8.34873 18.851 9.7739 19.1856 11.3044 19.1856C12.835 19.1856 14.2601 18.851 15.3244 18.2425C15.8723 17.929 16.7917 17.2652 16.7917 16.33C16.7917 15.3974 15.8723 14.731 15.3244 14.4175C14.2601 13.8089 12.8323 13.4744 11.3044 13.4744Z"
61
+ fill={color}
62
+ />
63
+ </G>
64
+ <Defs>
65
+ <ClipPath id="clip0_249_5095">
66
+ <Rect
67
+ width="20"
68
+ height="20"
69
+ fill="white"
70
+ transform="translate(0.5 0.5)"
71
+ />
72
+ </ClipPath>
73
+ </Defs>
74
+ </Svg>
75
+ );
76
+
77
+ export const HelpIcon: React.FC<IconProps> = ({ color }) => (
78
+ <View
79
+ style={{
80
+ width: 20,
81
+ height: 20,
82
+ padding: 1,
83
+ justifyContent: "center",
84
+ alignItems: "center",
85
+ }}
86
+ >
87
+ <Svg width="18" height="18" viewBox="0 0 18 19" fill="none">
88
+ <Path
89
+ d="M9.00021 0.500707C8.25536 0.489042 7.51359 0.62176 6.82047 0.894992C6.12334 1.1698 5.48815 1.57939 4.94962 2.10045C4.41109 2.62152 3.97912 3.24352 3.68145 3.93124C3.38378 4.61896 3.22569 5.3593 3.21437 6.1086C3.21435 6.11111 3.21435 6.11362 3.21437 6.11613V9.49895C3.21437 9.66946 3.2821 9.83298 3.40266 9.95355C3.52323 10.0741 3.68674 10.1419 3.85724 10.1419C4.02774 10.1419 4.19125 10.0741 4.31181 9.95355C4.43237 9.83298 4.5001 9.66946 4.50011 9.49895V6.12618C4.50887 5.54601 4.63124 4.97354 4.86173 4.44105C5.09219 3.90858 5.42663 3.4281 5.84361 3.02463C6.26059 2.62119 6.75281 2.30318 7.29258 2.0904C7.83234 1.87763 8.40756 1.77362 8.98766 1.78402C8.99603 1.78418 9.0044 1.78418 9.01277 1.78402C9.59286 1.77362 10.1681 1.87763 10.7078 2.0904C11.2476 2.30318 11.7398 2.62119 12.1568 3.02463C12.5738 3.42809 12.9082 3.90856 13.1387 4.44105C13.3691 4.97364 13.4916 5.54607 13.5003 6.12618V9.49895C13.5003 9.66946 13.5681 9.83298 13.6886 9.95355C13.8092 10.0741 13.9727 10.1419 14.1432 10.1419C14.3137 10.1419 14.4772 10.0741 14.5978 9.95355C14.7183 9.83298 14.7861 9.66946 14.7861 9.49895V6.11613C14.7861 6.11362 14.7861 6.11111 14.7861 6.1086C14.7748 5.35925 14.6165 4.61887 14.319 3.93124C14.0213 3.24353 13.5894 2.62152 13.0508 2.10045C12.5123 1.57939 11.8771 1.1698 11.1799 0.894992C10.4868 0.62176 9.74506 0.489042 9.00021 0.500707Z"
90
+ fill={color}
91
+ />
92
+ <Path
93
+ d="M1.92862 6.92676C1.41735 6.92676 0.926532 7.1303 0.565024 7.49182C0.203519 7.85335 0 8.3442 0 8.85549V11.4271C0 11.9384 0.203519 12.4293 0.565024 12.7908C0.926532 13.1523 1.41735 13.3559 1.92862 13.3559H3.21436C3.55512 13.3559 3.88246 13.2202 4.12342 12.9792C4.3644 12.7382 4.5001 12.4108 4.5001 12.07V8.21258C4.5001 7.8718 4.3644 7.54444 4.12342 7.30346C3.88246 7.06247 3.55512 6.92676 3.21436 6.92676H1.92862ZM1.92862 8.21258H3.21436V12.07H1.92862C1.75787 12.07 1.59483 12.0024 1.47408 11.8817C1.35334 11.7609 1.28574 11.5979 1.28574 11.4271V8.85549C1.28574 8.68473 1.35334 8.52168 1.47408 8.40093C1.59483 8.28019 1.75787 8.21258 1.92862 8.21258Z"
94
+ fill={color}
95
+ />
96
+ <Path
97
+ d="M14.7856 6.92676C14.4449 6.92676 14.1175 7.06255 13.8766 7.30346C13.6358 7.54438 13.4999 7.87173 13.4999 8.21258V12.07C13.4999 12.4109 13.6358 12.7382 13.8766 12.9792C14.1175 13.2201 14.4449 13.3559 14.7856 13.3559H16.0714C16.5826 13.3559 17.0734 13.1524 17.435 12.7908C17.7964 12.4293 18 11.9385 18 11.4271V8.85549C18 8.34413 17.7964 7.85331 17.435 7.49182C17.0734 7.13021 16.5826 6.92676 16.0714 6.92676H14.7856ZM14.7856 8.21258H16.0714C16.2421 8.21258 16.4053 8.28028 16.5259 8.40093C16.6467 8.52172 16.7142 8.6848 16.7142 8.85549V11.4271C16.7142 11.5978 16.6467 11.7609 16.5259 11.8817C16.4053 12.0023 16.2421 12.07 16.0714 12.07H14.7856V8.21258Z"
98
+ fill={color}
99
+ />
100
+ <Path
101
+ d="M14.1426 10.1411C13.9721 10.1411 13.8086 10.2089 13.688 10.3294C13.5674 10.45 13.4997 10.6135 13.4997 10.784V13.6771C13.4997 14.1889 13.2966 14.6789 12.9347 15.0408C12.5728 15.4027 12.0828 15.6059 11.5711 15.6059C11.4006 15.6059 11.2371 15.6736 11.1165 15.7942C10.996 15.9147 10.9282 16.0783 10.9282 16.2488C10.9282 16.4193 10.996 16.5828 11.1165 16.7034C11.2371 16.8239 11.4006 16.8917 11.5711 16.8917C12.4233 16.8917 13.2411 16.5526 13.8437 15.9499C14.4464 15.3472 14.7855 14.5294 14.7855 13.6771V10.784C14.7854 10.6135 14.7177 10.45 14.5972 10.3294C14.4766 10.2089 14.3131 10.1411 14.1426 10.1411Z"
102
+ fill={color}
103
+ />
104
+ <Path
105
+ d="M8.03606 13.9995C7.43955 13.9995 6.86574 14.2357 6.44395 14.6575C6.0221 15.0793 5.78601 15.6532 5.78601 16.2497C5.78601 16.8462 6.0221 17.4201 6.44395 17.8419C6.86574 18.2637 7.43955 18.4999 8.03606 18.4999H9.96468C10.5612 18.4999 11.135 18.2637 11.5568 17.8419C11.9786 17.4201 12.2147 16.8462 12.2147 16.2497C12.2147 15.6532 11.9786 15.0793 11.5568 14.6575C11.135 14.2357 10.5612 13.9995 9.96468 13.9995H8.03606ZM8.03606 15.2853H9.96468C10.2207 15.2853 10.4667 15.3856 10.6477 15.5666C10.8287 15.7476 10.929 15.9937 10.929 16.2497C10.929 16.5057 10.8287 16.7518 10.6477 16.9328C10.4667 17.1138 10.2207 17.2141 9.96468 17.2141H8.03606C7.78008 17.2141 7.53403 17.1138 7.35301 16.9328C7.17206 16.7518 7.07175 16.5057 7.07175 16.2497C7.07175 15.9937 7.17206 15.7476 7.35301 15.5666C7.53403 15.3856 7.78008 15.2853 8.03606 15.2853Z"
106
+ fill={color}
107
+ />
108
+ </Svg>
109
+ </View>
110
+ );
@@ -0,0 +1,79 @@
1
+ import React from "react";
2
+ import {
3
+ TextInput as RNTextInput,
4
+ View,
5
+ Text,
6
+ StyleSheet,
7
+ TextInputProps,
8
+ ViewStyle,
9
+ } from "react-native";
10
+ import {spacing, typography, borderRadius } from "../styles/shared";
11
+ import { colors } from "../styles/colors";
12
+
13
+ interface CustomTextInputProps extends TextInputProps {
14
+ label?: string;
15
+ error?: string;
16
+ containerStyle?: ViewStyle;
17
+ variant?: "default" | "outlined";
18
+ }
19
+
20
+ const TextInput: React.FC<CustomTextInputProps> = ({
21
+ label,
22
+ error,
23
+ containerStyle,
24
+ variant = "outlined",
25
+ style,
26
+ ...props
27
+ }) => {
28
+ return (
29
+ <View style={[styles.container, containerStyle]}>
30
+ {label && <Text style={styles.label}>{label}</Text>}
31
+ <RNTextInput
32
+ style={[styles.input, styles[variant], error && styles.error, style]}
33
+ placeholderTextColor={colors.onSurfaceVariant}
34
+ {...props}
35
+ />
36
+ {error && <Text style={styles.errorText}>{error}</Text>}
37
+ </View>
38
+ );
39
+ };
40
+
41
+ const styles = StyleSheet.create({
42
+ container: {
43
+ marginBottom: spacing.md,
44
+ },
45
+ label: {
46
+ ...typography.bodySmall,
47
+ color: colors.onSurface,
48
+ marginBottom: spacing.xs,
49
+ fontWeight: "500",
50
+ },
51
+ input: {
52
+ ...typography.body,
53
+ color: colors.onSurface,
54
+ paddingVertical: spacing.md,
55
+ paddingHorizontal: spacing.lg,
56
+ borderRadius: borderRadius.md,
57
+ textAlignVertical: "center",
58
+ },
59
+ default: {
60
+ backgroundColor: colors.surface,
61
+ borderWidth: 1,
62
+ borderColor: colors.outline,
63
+ },
64
+ outlined: {
65
+ backgroundColor: colors.background,
66
+ borderWidth: 1,
67
+ borderColor: colors.outline,
68
+ },
69
+ error: {
70
+ borderColor: colors.error,
71
+ },
72
+ errorText: {
73
+ ...typography.caption,
74
+ color: colors.error,
75
+ marginTop: spacing.xs,
76
+ },
77
+ });
78
+
79
+ export default TextInput;
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import { BaseToast } from 'react-native-toast-message';
3
+ import type { ToastConfig, ToastConfigParams } from 'react-native-toast-message';
4
+
5
+ export const toastConfig: ToastConfig = {
6
+ success: ({ text1, text2, ...rest }: ToastConfigParams<any>) => (
7
+ <BaseToast
8
+ {...rest}
9
+ style={{
10
+ borderLeftColor: '#4CAF50',
11
+ paddingVertical: 8,
12
+ height:42,
13
+ }}
14
+ contentContainerStyle={{
15
+ paddingHorizontal: 15,
16
+ flexShrink: 1,
17
+ }}
18
+ text1={text1}
19
+ text2={text2}
20
+ text1Style={{
21
+ fontSize: 12,
22
+ fontWeight: '600',
23
+ color: '#000',
24
+ }}
25
+ text2Style={{
26
+ fontSize: 14,
27
+ color: '#444',
28
+ flexWrap: 'wrap',
29
+ flexShrink: 1,
30
+ }}
31
+ />
32
+ ),
33
+ error: ({ text1, text2, ...rest }: ToastConfigParams<any>) => (
34
+ <BaseToast
35
+ {...rest}
36
+ style={{
37
+ borderLeftColor: '#F44336',
38
+ paddingVertical: 8,
39
+ height: 42,
40
+ }}
41
+ contentContainerStyle={{
42
+ paddingHorizontal: 15,
43
+ flexShrink: 1,
44
+ }}
45
+ text1={text1}
46
+ text2={text2}
47
+ text1Style={{
48
+ fontSize: 12,
49
+ fontWeight: '600',
50
+ color: '#000',
51
+ }}
52
+ text2Style={{
53
+ fontSize: 14,
54
+ color: '#444',
55
+ flexWrap: 'wrap',
56
+ flexShrink: 1,
57
+ }}
58
+ />
59
+ ),
60
+ };
@@ -0,0 +1,18 @@
1
+ export { default as Footer } from './Footer';
2
+ export { default as CustomButton } from './CustomButton';
3
+ export { default as CustomImage } from './CustomImage';
4
+ export { default as CustomCard } from './CustomCard';
5
+ export { default as CustomProductCard } from './CustomProductCard';
6
+ export { default as AmountModal } from './AmountBreakDownModal';
7
+ export { default as FilterModal } from './FilterModal';
8
+ export { default as QuantityModal } from './QuantityModal';
9
+ export { default as CustomLoader } from './CustomLoader';
10
+ export { default as CustomMessagePopUp } from './CustomMessagePopUp';
11
+ export { default as NoDataFound } from './NoDataFound';
12
+ export { default as Logout } from './Logout';
13
+ export { default as CustomError } from './CustomError';
14
+
15
+
16
+
17
+
18
+
@@ -0,0 +1,22 @@
1
+ // SDK does not use react-native-config - it receives config from host app via bridge
2
+ // Default API URLs for SDK standalone usage
3
+ const DEFAULT_API_URL = 'https://staging-admin.zaggle.in';
4
+ const DEFAULT_API_URL1 = 'https://staging-propel.zaggle.in';
5
+
6
+ const ENV = {
7
+ appName: 'Propel SDK',
8
+ apiUrl: DEFAULT_API_URL,
9
+ apiUrl1: DEFAULT_API_URL1,
10
+ enableDebug: false,
11
+ };
12
+
13
+ // Allow runtime override of API URLs (used by SDK)
14
+ // Ignores placeholder/example URLs to prevent misconfiguration
15
+ export const setApiUrl = (url: string) => {
16
+ if (url && !url.includes('example.com') && !url.includes('placeholder')) {
17
+ ENV.apiUrl = url;
18
+ ENV.apiUrl1 = url;
19
+ }
20
+ };
21
+
22
+ export default ENV;
@@ -0,0 +1,12 @@
1
+ const FontFamily = {
2
+ LEXEND_BLACK: 'Lexend-Black',
3
+ LEXEND_BOLD: 'Lexend-Bold',
4
+ LEXEND_EXTRABOLD: 'Lexend-ExtraBold',
5
+ LEXEND_EXTRALIGHT: 'Lexend-ExtraLight',
6
+ LEXEND_LIGHT: 'Lexend-Light',
7
+ LEXEND_MEDIUM: 'Lexend-Medium',
8
+ LEXEND_REGULAR: 'Lexend-Regular',
9
+ LEXEND_SEMIBOLD: 'Lexend-SemiBold',
10
+ LEXEND_THIN: 'Lexend-Thin',
11
+ };
12
+ export default FontFamily;
@@ -0,0 +1,39 @@
1
+ // Exact fixed decimals (always shows trailing zeros)
2
+ export const toFixedSafe = (value: unknown, digits = 1): string => {
3
+ const n = Number(value);
4
+ if (!Number.isFinite(n)) return (0).toFixed(digits);
5
+ return n.toFixed(digits);
6
+ };
7
+
8
+ // Up to N decimals (no unnecessary trailing zeros); with grouping
9
+ export const toMaxDecimals = (
10
+ value: unknown,
11
+ max = 1,
12
+ min = 0,
13
+ locale?: string
14
+ ): string => {
15
+ const n = Number(value);
16
+ const opts: Intl.NumberFormatOptions = {
17
+ maximumFractionDigits: max,
18
+ minimumFractionDigits: min,
19
+ useGrouping: true,
20
+ };
21
+ return Number.isFinite(n)
22
+ ? n.toLocaleString(locale, opts)
23
+ : (0).toLocaleString(locale, opts);
24
+ };
25
+
26
+ // Cents → Points helpers
27
+ export const pointsFromCentsFixed = (cents: unknown, digits = 1): string =>
28
+ toFixedSafe(Number(cents) / 100, digits);
29
+
30
+ export const pointsFromCentsMax = (
31
+ cents: unknown,
32
+ max = 1,
33
+ min = 0,
34
+ locale?: string
35
+ ): string => toMaxDecimals(Number(cents) / 100, max, min, locale);
36
+
37
+ export const formatPointsRange = (minPoints: number, maxPoints: number) => {
38
+ return `${Math.round(minPoints / 100)} - ${Math.round(maxPoints / 100)} Points`;
39
+ };
@@ -0,0 +1,46 @@
1
+ export const HTML_SANITIZATION_PATTERNS = {
2
+ STYLE_TAGS: /<style[^>]*>[\s\S]*?<\/style>/gi,
3
+ SPAN_OPEN: /<span[^>]*>/gi,
4
+ SPAN_CLOSE: /<\/span>/gi,
5
+ MSO_NORMAL_CLASS: /class="MsoNormal"/gi,
6
+ O_P_TAG: /<o:p>.*?<\/o:p>/gi,
7
+ SUP_TAG: /<sup[^>]*>[\s\S]*?<\/sup>/gi,
8
+ SUB_TAG: /<sub[^>]*>[\s\S]*?<\/sub>/gi,
9
+ EMPTY_P: /<p>\s*<\/p>/gi,
10
+ FONT_OPEN: /<font[^>]*>/gi,
11
+ FONT_CLOSE: /<\/font>/gi,
12
+
13
+ TABLE_OPEN: /<table[^>]*>/gi,
14
+ TABLE_CLOSE: /<\/table>/gi,
15
+ TR_OPEN: /<tr[^>]*>/gi,
16
+ TR_CLOSE: /<\/tr>/gi,
17
+ TD_OPEN: /<td[^>]*>/gi,
18
+ TD_CLOSE: /<\/td>/gi,
19
+ TBODY_OPEN: /<tbody[^>]*>/gi,
20
+ TBODY_CLOSE: /<\/tbody>/gi,
21
+ P_OPEN: /<p[^>]*>/gi,
22
+ P_CLOSE: /<\/p>/gi,
23
+
24
+ DIV_BR: /<div><br\s*\/?><\/div>/gi,
25
+ BR: /<br\s*\/?>/gi,
26
+ EMPTY_DIV: /<div>\s*<\/div>/gi,
27
+
28
+ SUP_INLINE: /<sup[^>]*>.*?<\/sup>/gi,
29
+
30
+ STYLE_ATTRIBUTES: /\sstyle="[^"]*"/gi,
31
+ ID_ATTRIBUTES: /\sid="[^"]*"/gi,
32
+ CLASS_ATTRIBUTES: /\sclass="[^"]*"/gi,
33
+ TITLE_ATTRIBUTES: /\stitle="[^"]*"/gi,
34
+
35
+ NBSP: /&nbsp;/gi,
36
+ MULTI_SPACE: /\s{2,}/g,
37
+
38
+ DIV_OPEN: /<div>/gi,
39
+ DIV_CLOSE: /<\/div>/gi,
40
+ };
41
+ export const CUSTOM_RENDERER_STYLES = {
42
+ IMAGE_CONTAINER: {
43
+ alignItems: "center" as const,
44
+ marginVertical: 10,
45
+ },
46
+ };