@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.
- package/assets/fonts/Lexend-Black.ttf +0 -0
- package/assets/fonts/Lexend-Bold.ttf +0 -0
- package/assets/fonts/Lexend-ExtraBold.ttf +0 -0
- package/assets/fonts/Lexend-ExtraLight.ttf +0 -0
- package/assets/fonts/Lexend-Light.ttf +0 -0
- package/assets/fonts/Lexend-Medium.ttf +0 -0
- package/assets/fonts/Lexend-Regular.ttf +0 -0
- package/assets/fonts/Lexend-SemiBold.ttf +0 -0
- package/assets/fonts/Lexend-Thin.ttf +0 -0
- package/assets/images/HomeGoods.png +0 -0
- package/assets/images/accessories.png +0 -0
- package/assets/images/amazon.png +0 -0
- package/assets/images/apnaClubLogo.png +0 -0
- package/assets/images/apparel.png +0 -0
- package/assets/images/backgroundblue.png +0 -0
- package/assets/images/bannerCard.png +0 -0
- package/assets/images/bottomWave.png +0 -0
- package/assets/images/coin_1_1.png +0 -0
- package/assets/images/flipkart.png +0 -0
- package/assets/images/frame_1171278967.png +0 -0
- package/assets/images/gift.png +0 -0
- package/assets/images/herobanner.png +0 -0
- package/assets/images/hinduPencilsLogo.png +0 -0
- package/assets/images/icons/addwhiteicon.png +0 -0
- package/assets/images/icons/arrow-back.png +0 -0
- package/assets/images/icons/arrowgreen.png +0 -0
- package/assets/images/icons/arrowred.png +0 -0
- package/assets/images/icons/arrowright.png +0 -0
- package/assets/images/icons/arrowup.png +0 -0
- package/assets/images/icons/blackarrowdown.png +0 -0
- package/assets/images/icons/blackarrowup.png +0 -0
- package/assets/images/icons/blackcross.png +0 -0
- package/assets/images/icons/call.png +0 -0
- package/assets/images/icons/camera.png +0 -0
- package/assets/images/icons/cart.png +0 -0
- package/assets/images/icons/chat.png +0 -0
- package/assets/images/icons/circleblack.png +0 -0
- package/assets/images/icons/copy.png +0 -0
- package/assets/images/icons/cross.png +0 -0
- package/assets/images/icons/delete.png +0 -0
- package/assets/images/icons/delivery.png +0 -0
- package/assets/images/icons/eVoucher.png +0 -0
- package/assets/images/icons/editIcon.png +0 -0
- package/assets/images/icons/email.png +0 -0
- package/assets/images/icons/eye.png +0 -0
- package/assets/images/icons/faq.png +0 -0
- package/assets/images/icons/filtericon.png +0 -0
- package/assets/images/icons/greyDownArrow.png +0 -0
- package/assets/images/icons/help.png +0 -0
- package/assets/images/icons/home.png +0 -0
- package/assets/images/icons/homeinactive.png +0 -0
- package/assets/images/icons/i_blackicon.png +0 -0
- package/assets/images/icons/i_icon.png +0 -0
- package/assets/images/icons/location.png +0 -0
- package/assets/images/icons/logout.png +0 -0
- package/assets/images/icons/minus.png +0 -0
- package/assets/images/icons/myOrders.png +0 -0
- package/assets/images/icons/orders.png +0 -0
- package/assets/images/icons/pencillogo.png +0 -0
- package/assets/images/icons/pending.png +0 -0
- package/assets/images/icons/plus.png +0 -0
- package/assets/images/icons/redCross.png +0 -0
- package/assets/images/icons/redCrossicon.png +0 -0
- package/assets/images/icons/redWarningicon.png +0 -0
- package/assets/images/icons/redeem.png +0 -0
- package/assets/images/icons/redeemactive.png +0 -0
- package/assets/images/icons/redemptionHistory.png +0 -0
- package/assets/images/icons/redhelpicon.png +0 -0
- package/assets/images/icons/search.png +0 -0
- package/assets/images/icons/stopwatch.png +0 -0
- package/assets/images/icons/successTick.gif +0 -0
- package/assets/images/icons/tick.png +0 -0
- package/assets/images/icons/tnc.png +0 -0
- package/assets/images/icons/user.png +0 -0
- package/assets/images/icons/userredicon.png +0 -0
- package/assets/images/icons/wavecorner.png +0 -0
- package/assets/images/logo.png +0 -0
- package/assets/images/myntra_copy.png +0 -0
- package/assets/images/nike.png +0 -0
- package/assets/images/oq3p0u0_1.png +0 -0
- package/assets/images/profileicon.png +0 -0
- package/assets/images/topWave.png +0 -0
- package/assets/images/zagglePropelLogo.png +0 -0
- package/index.ts +23 -0
- package/lib/index.ts +25 -0
- package/package.json +70 -0
- package/src/PropelSDKScreen.tsx +98 -0
- package/src/SDKApp.tsx +540 -0
- package/src/bridge/SDKBridge.ts +104 -0
- package/src/bridge/index.ts +3 -0
- package/src/components/SDKBackHandler.tsx +187 -0
- package/src/components/SDKProfile.tsx +87 -0
- package/src/components/SDKProfileWrapper.tsx +51 -0
- package/src/constants.ts +10 -0
- package/src/contexts/SDKContext.tsx +72 -0
- package/src/hooks/useSDKBackNavigation.ts +61 -0
- package/src/navigation/SDKMainTabNavigator.tsx +315 -0
- package/src/navigation/SDKNavigator.tsx +41 -0
- package/src/redux/store.ts +32 -0
- package/src/screens/Dashboard/index.tsx +531 -0
- package/src/screens/Dashboard/styles.ts +512 -0
- package/src/screens/DeliveryAddress/index.tsx +221 -0
- package/src/screens/DeliveryAddress/styles.ts +122 -0
- package/src/screens/E-Vouchers/index.tsx +157 -0
- package/src/screens/E-Vouchers/styles.ts +106 -0
- package/src/screens/Faq/Faq.constants.ts +164 -0
- package/src/screens/Faq/index.tsx +114 -0
- package/src/screens/Faq/styles.ts +131 -0
- package/src/screens/Help/index.tsx +128 -0
- package/src/screens/Help/styles.ts +121 -0
- package/src/screens/Login/index.tsx +215 -0
- package/src/screens/Login/styles.ts +134 -0
- package/src/screens/MyCart/MyCart.constants.ts +13 -0
- package/src/screens/MyCart/index.tsx +318 -0
- package/src/screens/MyCart/styles.ts +249 -0
- package/src/screens/MyOrders/index.tsx +87 -0
- package/src/screens/MyOrders/styles.ts +281 -0
- package/src/screens/MyProfile/index.tsx +72 -0
- package/src/screens/MyProfile/styles.ts +47 -0
- package/src/screens/NewDeliveryAddress/index.tsx +360 -0
- package/src/screens/NewDeliveryAddress/styles.ts +68 -0
- package/src/screens/Onboarding/index.tsx +57 -0
- package/src/screens/Onboarding/styles.ts +60 -0
- package/src/screens/OrdersDetails/index.tsx +333 -0
- package/src/screens/OrdersDetails/styles.ts +262 -0
- package/src/screens/OtpVerification/index.tsx +283 -0
- package/src/screens/OtpVerification/styles.ts +197 -0
- package/src/screens/PaymentMethod/index.tsx +389 -0
- package/src/screens/PaymentMethod/styles.ts +246 -0
- package/src/screens/PointsLog/index.tsx +286 -0
- package/src/screens/PointsLog/styles.ts +156 -0
- package/src/screens/ProductDetails/index.tsx +682 -0
- package/src/screens/ProductDetails/styles.ts +372 -0
- package/src/screens/Profile/index.tsx +368 -0
- package/src/screens/Profile/styles.ts +158 -0
- package/src/screens/RedemptionHistory/RedemptionHistory.constants.ts +4 -0
- package/src/screens/RedemptionHistory/index.tsx +304 -0
- package/src/screens/RedemptionHistory/styles.ts +84 -0
- package/src/screens/Reedem/index.tsx +345 -0
- package/src/screens/Reedem/styles.ts +269 -0
- package/src/screens/TnC/TnC.constants.ts +169 -0
- package/src/screens/TnC/index.tsx +83 -0
- package/src/screens/TnC/styles.ts +88 -0
- package/src/screens/TransactionSuccessful/index.tsx +77 -0
- package/src/screens/TransactionSuccessful/styles.ts +77 -0
- package/src/screens/Verification/index.tsx +58 -0
- package/src/screens/Verification/styles.ts +74 -0
- package/src/screens/index.ts +23 -0
- package/src/types/index.ts +46 -0
- package/src-app/components/AmountBreakDownModal/index.tsx +86 -0
- package/src-app/components/AmountBreakDownModal/styles.ts +110 -0
- package/src-app/components/BottomNavIcons.tsx +125 -0
- package/src-app/components/Button.tsx +120 -0
- package/src-app/components/Card.tsx +47 -0
- package/src-app/components/ConfirmPopup/ConfirmPopup.constants.ts +25 -0
- package/src-app/components/ConfirmPopup/index.tsx +48 -0
- package/src-app/components/ConfirmPopup/styles.ts +167 -0
- package/src-app/components/CustomButton/index.tsx +67 -0
- package/src-app/components/CustomButton/styles.ts +44 -0
- package/src-app/components/CustomCard/index.tsx +221 -0
- package/src-app/components/CustomCard/styles.ts +184 -0
- package/src-app/components/CustomError/index.tsx +54 -0
- package/src-app/components/CustomError/styles.ts +41 -0
- package/src-app/components/CustomImage/index.tsx +37 -0
- package/src-app/components/CustomImage/styles.ts +5 -0
- package/src-app/components/CustomLoader/index.tsx +45 -0
- package/src-app/components/CustomLoader/styles.ts +35 -0
- package/src-app/components/CustomMessagePopUp/index.tsx +51 -0
- package/src-app/components/CustomMessagePopUp/styles.ts +74 -0
- package/src-app/components/CustomProductCard/index.tsx +13 -0
- package/src-app/components/CustomProductCard/styles.ts +5 -0
- package/src-app/components/FilterModal.tsx +372 -0
- package/src-app/components/Footer/index.tsx +23 -0
- package/src-app/components/Footer/styles.ts +37 -0
- package/src-app/components/Icon.tsx +80 -0
- package/src-app/components/Logout/index.tsx +82 -0
- package/src-app/components/Logout/styles.ts +116 -0
- package/src-app/components/MobileHeader.tsx +141 -0
- package/src-app/components/NoDataFound/index.tsx +18 -0
- package/src-app/components/NoDataFound/styles.ts +26 -0
- package/src-app/components/OTPModal.tsx +747 -0
- package/src-app/components/ProfileField.tsx +47 -0
- package/src-app/components/QuantityModal/index.tsx +113 -0
- package/src-app/components/QuantityModal/styles.ts +84 -0
- package/src-app/components/TabBarIcons.tsx +110 -0
- package/src-app/components/TextInput.tsx +79 -0
- package/src-app/components/ToastConfig.tsx +60 -0
- package/src-app/components/index.ts +18 -0
- package/src-app/config/env.ts +22 -0
- package/src-app/constants/Fonts.ts +12 -0
- package/src-app/constants/Formatter.ts +39 -0
- package/src-app/constants/HtmlSanitization.ts +46 -0
- package/src-app/constants/Images.ts +81 -0
- package/src-app/constants/Labels.ts +8 -0
- package/src-app/constants/Messages.ts +108 -0
- package/src-app/constants/Routes.ts +17 -0
- package/src-app/constants/Scaling.ts +5 -0
- package/src-app/constants/Text.ts +8 -0
- package/src-app/constants/offSets.ts +18 -0
- package/src-app/hooks/useAppDispatch.ts +4 -0
- package/src-app/hooks/useAppSelector.ts +4 -0
- package/src-app/hooks/useBackHandler.ts +47 -0
- package/src-app/hooks/useScreenBackHandler.ts +91 -0
- package/src-app/navigation/AppNavigator.tsx +34 -0
- package/src-app/navigation/MainTabNavigator.tsx +294 -0
- package/src-app/redux/authSaga.ts +605 -0
- package/src-app/redux/authSlice.ts +754 -0
- package/src-app/redux/rootSaga.ts +6 -0
- package/src-app/redux/store.ts +25 -0
- package/src-app/services/api.ts +14 -0
- package/src-app/services/endpoints.ts +33 -0
- package/src-app/services/index.ts +574 -0
- package/src-app/services/sdkCredentials.ts +44 -0
- package/src-app/styles/colors.ts +85 -0
- package/src-app/styles/shared.ts +112 -0
- package/src-app/types/authTypes.ts +155 -0
- package/src-app/types/navigation.ts +99 -0
- package/src-app/utils/Validation.ts +48 -0
- package/src-app/utils/filterPins.ts +29 -0
- package/src-app/utils/navigationUtils.ts +43 -0
- package/src-app/utils/useHardwareBack.ts +21 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import FontFamily from '../../../src-app/constants/Fonts';
|
|
3
|
+
import { VSCALE } from '../../../src-app/constants/Scaling';
|
|
4
|
+
import { colors } from '../../../src-app/styles/colors';
|
|
5
|
+
|
|
6
|
+
export default StyleSheet.create({
|
|
7
|
+
container: {
|
|
8
|
+
flex: 1,
|
|
9
|
+
backgroundColor: colors.background,
|
|
10
|
+
},
|
|
11
|
+
content: {
|
|
12
|
+
flex: 1,
|
|
13
|
+
padding: 20,
|
|
14
|
+
},
|
|
15
|
+
productRow: {
|
|
16
|
+
paddingVertical: 10,
|
|
17
|
+
paddingHorizontal: 10,
|
|
18
|
+
shadowColor: colors.shadow,
|
|
19
|
+
shadowOffset: {
|
|
20
|
+
width: 0,
|
|
21
|
+
height: 2,
|
|
22
|
+
},
|
|
23
|
+
shadowOpacity: 0.25,
|
|
24
|
+
shadowRadius: 3.84,
|
|
25
|
+
elevation: 5,
|
|
26
|
+
backgroundColor: colors.background,
|
|
27
|
+
borderRadius: 16,
|
|
28
|
+
marginBottom: 30,
|
|
29
|
+
borderWidth: 0.25,
|
|
30
|
+
borderColor: colors.outline,
|
|
31
|
+
},
|
|
32
|
+
productLeft: {
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
flex: 1,
|
|
36
|
+
justifyContent: 'space-between',
|
|
37
|
+
},
|
|
38
|
+
productImageContainer: {
|
|
39
|
+
width: 71,
|
|
40
|
+
height: 47,
|
|
41
|
+
marginRight: 12,
|
|
42
|
+
borderWidth: 0.25,
|
|
43
|
+
borderRadius: 5,
|
|
44
|
+
borderColor: colors.outline,
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
},
|
|
48
|
+
productImage: {
|
|
49
|
+
width: '100%',
|
|
50
|
+
height: '100%',
|
|
51
|
+
borderRadius: 5,
|
|
52
|
+
resizeMode: 'contain',
|
|
53
|
+
},
|
|
54
|
+
productDetails: {
|
|
55
|
+
flexShrink: 1,
|
|
56
|
+
},
|
|
57
|
+
productName: {
|
|
58
|
+
fontSize: 14,
|
|
59
|
+
fontWeight: '600',
|
|
60
|
+
color: colors.onSurface,
|
|
61
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
62
|
+
width: 150,
|
|
63
|
+
},
|
|
64
|
+
productQuantity: {
|
|
65
|
+
fontSize: 10,
|
|
66
|
+
color: colors.onSurfaceVariant,
|
|
67
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
68
|
+
fontWeight: '600',
|
|
69
|
+
},
|
|
70
|
+
productQuantityText: {
|
|
71
|
+
fontSize: 10,
|
|
72
|
+
color: colors.onSurface,
|
|
73
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
74
|
+
fontWeight: '600',
|
|
75
|
+
},
|
|
76
|
+
productPoints: {
|
|
77
|
+
fontSize: 14,
|
|
78
|
+
fontWeight: '500',
|
|
79
|
+
color: colors.onSurface,
|
|
80
|
+
textAlign: 'right',
|
|
81
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
82
|
+
},
|
|
83
|
+
emptyText: {
|
|
84
|
+
textAlign: 'center',
|
|
85
|
+
marginTop: 20,
|
|
86
|
+
fontSize: 16,
|
|
87
|
+
color: colors.onSurface,
|
|
88
|
+
},
|
|
89
|
+
productQuantityContainer: {
|
|
90
|
+
borderWidth: 1,
|
|
91
|
+
padding: 8,
|
|
92
|
+
borderRadius: 6,
|
|
93
|
+
width: '20%',
|
|
94
|
+
borderColor: colors.outline,
|
|
95
|
+
flexDirection: 'row',
|
|
96
|
+
gap: 10,
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
justifyContent: 'center',
|
|
99
|
+
marginBottom: 5,
|
|
100
|
+
},
|
|
101
|
+
icon: {
|
|
102
|
+
width: 8,
|
|
103
|
+
height: 4,
|
|
104
|
+
resizeMode: 'contain',
|
|
105
|
+
},
|
|
106
|
+
deleteIcon: {
|
|
107
|
+
width: 28,
|
|
108
|
+
height: 28,
|
|
109
|
+
resizeMode: 'contain',
|
|
110
|
+
},
|
|
111
|
+
iconRow: {
|
|
112
|
+
flexDirection: 'row',
|
|
113
|
+
alignSelf: 'center',
|
|
114
|
+
},
|
|
115
|
+
row: {
|
|
116
|
+
flexDirection: 'row',
|
|
117
|
+
justifyContent: 'space-between',
|
|
118
|
+
alignItems: 'center',
|
|
119
|
+
marginTop: 15,
|
|
120
|
+
},
|
|
121
|
+
left: {
|
|
122
|
+
flexDirection: 'row',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
},
|
|
125
|
+
separator: {
|
|
126
|
+
height: 1.2,
|
|
127
|
+
backgroundColor: 'transparent',
|
|
128
|
+
marginVertical: 8,
|
|
129
|
+
width: '100%',
|
|
130
|
+
alignSelf: 'center',
|
|
131
|
+
borderTopWidth: 1,
|
|
132
|
+
borderTopColor: colors.paymentSeparatorBorder,
|
|
133
|
+
},
|
|
134
|
+
leftText: {
|
|
135
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
136
|
+
fontSize: 12,
|
|
137
|
+
fontWeight: '500',
|
|
138
|
+
color: colors.onSurfaceVariant,
|
|
139
|
+
textTransform: 'capitalize',
|
|
140
|
+
marginBottom: 12,
|
|
141
|
+
},
|
|
142
|
+
amountText: {
|
|
143
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
144
|
+
fontSize: 12,
|
|
145
|
+
fontWeight: '600',
|
|
146
|
+
color: colors.onSurfaceVariant,
|
|
147
|
+
marginTop: 10,
|
|
148
|
+
},
|
|
149
|
+
rightText: {
|
|
150
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
151
|
+
fontSize: 14,
|
|
152
|
+
fontWeight: '600',
|
|
153
|
+
color: colors.onSurface,
|
|
154
|
+
textTransform: 'capitalize',
|
|
155
|
+
marginBottom: 12,
|
|
156
|
+
},
|
|
157
|
+
amountPoints: {
|
|
158
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
159
|
+
fontSize: 16,
|
|
160
|
+
fontWeight: '600',
|
|
161
|
+
color: colors.onSurface,
|
|
162
|
+
textTransform: 'capitalize',
|
|
163
|
+
marginTop: 10,
|
|
164
|
+
},
|
|
165
|
+
bottomRow: {
|
|
166
|
+
flexDirection: 'row',
|
|
167
|
+
alignItems: 'center',
|
|
168
|
+
justifyContent: 'space-between',
|
|
169
|
+
},
|
|
170
|
+
bottomContent: {
|
|
171
|
+
paddingHorizontal: 7,
|
|
172
|
+
marginBottom: 20,
|
|
173
|
+
},
|
|
174
|
+
buttonView: {
|
|
175
|
+
justifyContent: 'space-between',
|
|
176
|
+
flex: 1,
|
|
177
|
+
},
|
|
178
|
+
mainContent: {
|
|
179
|
+
justifyContent: 'space-between',
|
|
180
|
+
},
|
|
181
|
+
loaderContainer: {
|
|
182
|
+
alignItems: 'center',
|
|
183
|
+
justifyContent: 'center',
|
|
184
|
+
alignSelf: 'center',
|
|
185
|
+
flex: 1,
|
|
186
|
+
},
|
|
187
|
+
fullScreenLoader: {
|
|
188
|
+
position: 'absolute',
|
|
189
|
+
top: 0,
|
|
190
|
+
left: 0,
|
|
191
|
+
right: 0,
|
|
192
|
+
bottom: 0,
|
|
193
|
+
backgroundColor: 'rgba(255, 255, 255, 0.7)',
|
|
194
|
+
justifyContent: 'center',
|
|
195
|
+
alignItems: 'center',
|
|
196
|
+
elevation: 10,
|
|
197
|
+
zIndex: 100,
|
|
198
|
+
},
|
|
199
|
+
buttonStyle: {
|
|
200
|
+
position: 'absolute',
|
|
201
|
+
bottom: 0,
|
|
202
|
+
left: 0,
|
|
203
|
+
right: 0,
|
|
204
|
+
top: VSCALE(200),
|
|
205
|
+
},
|
|
206
|
+
stickyButtonContainer: {
|
|
207
|
+
position: 'absolute',
|
|
208
|
+
bottom: VSCALE(-40),
|
|
209
|
+
left: 0,
|
|
210
|
+
right: 0,
|
|
211
|
+
backgroundColor: colors.background,
|
|
212
|
+
paddingVertical: VSCALE(12),
|
|
213
|
+
paddingHorizontal: 20,
|
|
214
|
+
elevation: 10,
|
|
215
|
+
shadowColor: colors.shadow,
|
|
216
|
+
shadowOffset: { width: 0, height: -2 },
|
|
217
|
+
shadowOpacity: 0.1,
|
|
218
|
+
shadowRadius: 4,
|
|
219
|
+
},
|
|
220
|
+
contentContainer: {
|
|
221
|
+
paddingBottom: VSCALE(160),
|
|
222
|
+
},
|
|
223
|
+
emptyCartCenter: {
|
|
224
|
+
flex: 1,
|
|
225
|
+
justifyContent: 'center',
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
paddingHorizontal: 24,
|
|
228
|
+
},
|
|
229
|
+
emptyCartTitle: {
|
|
230
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
231
|
+
fontSize: 18,
|
|
232
|
+
fontWeight: '600',
|
|
233
|
+
color: colors.onSurface, marginBottom: 8,
|
|
234
|
+
textAlign: 'center',
|
|
235
|
+
},
|
|
236
|
+
emptyCartSubtitle: {
|
|
237
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
238
|
+
fontSize: 14,
|
|
239
|
+
color: colors.onSurfaceVariant,
|
|
240
|
+
textAlign: 'center',
|
|
241
|
+
},
|
|
242
|
+
emptyCartButtonContainer: {
|
|
243
|
+
padding: 20,
|
|
244
|
+
paddingBottom: VSCALE(40),
|
|
245
|
+
backgroundColor: colors.background,
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { StackNavigationProp } from "@react-navigation/stack";
|
|
4
|
+
import { AppStackParamList } from "../../../src-app/types/navigation";
|
|
5
|
+
import styles from "./styles";
|
|
6
|
+
import { CustomCard } from "../../../src-app/components";
|
|
7
|
+
import { useAppSelector } from "../../../src-app/hooks/useAppSelector";
|
|
8
|
+
import { RootState } from "../../../src-app/redux/store";
|
|
9
|
+
import MobileHeader from "../../../src-app/components/MobileHeader";
|
|
10
|
+
import { useRoute, RouteProp } from "@react-navigation/native";
|
|
11
|
+
|
|
12
|
+
type MyOrdersNavigationProp = StackNavigationProp<
|
|
13
|
+
AppStackParamList,
|
|
14
|
+
"MyOrders"
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
type MyOrdersRouteProp = RouteProp<AppStackParamList, "MyOrders">;
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
navigation: MyOrdersNavigationProp;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const MyOrders: React.FC<Props> = ({ navigation }) => {
|
|
24
|
+
const myvalidateOtpData = useAppSelector(
|
|
25
|
+
(state: RootState) => state.auth.myOrdersValidateOtpData
|
|
26
|
+
);
|
|
27
|
+
const { myOrdersValidateOtpLoading, myOrdersValidateOtpError } = useAppSelector(
|
|
28
|
+
(state: RootState) => state.auth
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const route = useRoute<MyOrdersRouteProp>();
|
|
32
|
+
const from = route.params?.from;
|
|
33
|
+
|
|
34
|
+
// Use actual data from backend only
|
|
35
|
+
const displayData = useMemo(() => {
|
|
36
|
+
if (Array.isArray(myvalidateOtpData) && myvalidateOtpData.length > 0) {
|
|
37
|
+
return myvalidateOtpData;
|
|
38
|
+
}
|
|
39
|
+
// Return empty array if no data from backend
|
|
40
|
+
console.log('📦 MyOrders: No data from backend, showing empty state');
|
|
41
|
+
return [];
|
|
42
|
+
}, [myvalidateOtpData]);
|
|
43
|
+
|
|
44
|
+
// Show loader only when loading and no error
|
|
45
|
+
const showLoader = !myOrdersValidateOtpError && myOrdersValidateOtpLoading;
|
|
46
|
+
|
|
47
|
+
// Debug logging
|
|
48
|
+
console.log('📦 MyOrders RENDER:', {
|
|
49
|
+
showLoader,
|
|
50
|
+
displayDataLength: displayData.length,
|
|
51
|
+
myOrdersValidateOtpLoading,
|
|
52
|
+
myOrdersValidateOtpError: !!myOrdersValidateOtpError,
|
|
53
|
+
firstItem: displayData[0] ? { id: displayData[0].id, order_no: displayData[0].order_no } : null,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const handleGoBack = () => {
|
|
57
|
+
if (navigation.canGoBack()) {
|
|
58
|
+
navigation.goBack();
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
// Fallback: navigate to originating screen or Dashboard
|
|
62
|
+
if (from) {
|
|
63
|
+
navigation.navigate(from as never);
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
navigation.navigate('DashboardTab' as never, { screen: 'Dashboard' });
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<View style={styles.container}>
|
|
72
|
+
<MobileHeader
|
|
73
|
+
title="My orders"
|
|
74
|
+
showBack
|
|
75
|
+
onBack={() => handleGoBack()}
|
|
76
|
+
disableSafeAreaPadding={true}
|
|
77
|
+
/>
|
|
78
|
+
|
|
79
|
+
<CustomCard
|
|
80
|
+
data={displayData}
|
|
81
|
+
loading={showLoader}
|
|
82
|
+
/>
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default MyOrders;
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { colors } from '../../../src-app/styles/colors';
|
|
3
|
+
import FontFamily from '../../../src-app/constants/Fonts';
|
|
4
|
+
|
|
5
|
+
const styles = StyleSheet.create({
|
|
6
|
+
container: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
backgroundColor: colors.background,
|
|
9
|
+
},
|
|
10
|
+
statusBar: {
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
justifyContent: 'space-between',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
width: '100%',
|
|
15
|
+
},
|
|
16
|
+
timeText: {
|
|
17
|
+
fontSize: 16,
|
|
18
|
+
fontWeight: '700',
|
|
19
|
+
color: colors.onSurface,
|
|
20
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
21
|
+
},
|
|
22
|
+
statusIcons: {
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
gap: 5,
|
|
26
|
+
},
|
|
27
|
+
signalBars: {
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'flex-end',
|
|
30
|
+
gap: 2,
|
|
31
|
+
},
|
|
32
|
+
signalBar: {
|
|
33
|
+
width: 3,
|
|
34
|
+
backgroundColor: colors.onSurface,
|
|
35
|
+
borderRadius: 1,
|
|
36
|
+
},
|
|
37
|
+
iconText: {
|
|
38
|
+
fontSize: 10,
|
|
39
|
+
color: colors.onSurface,
|
|
40
|
+
},
|
|
41
|
+
battery: {
|
|
42
|
+
width: 27,
|
|
43
|
+
height: 13,
|
|
44
|
+
borderWidth: 1,
|
|
45
|
+
borderColor: colors.onSurface,
|
|
46
|
+
borderRadius: 2,
|
|
47
|
+
position: 'relative',
|
|
48
|
+
opacity: 0.35,
|
|
49
|
+
},
|
|
50
|
+
batteryInner: {
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
top: 1,
|
|
53
|
+
left: 1,
|
|
54
|
+
right: 1,
|
|
55
|
+
bottom: 1,
|
|
56
|
+
backgroundColor: colors.onSurface,
|
|
57
|
+
borderRadius: 1,
|
|
58
|
+
},
|
|
59
|
+
batteryTip: {
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
right: -3,
|
|
62
|
+
top: 4,
|
|
63
|
+
width: 2,
|
|
64
|
+
height: 5,
|
|
65
|
+
backgroundColor: colors.onSurface,
|
|
66
|
+
borderRadius: 1,
|
|
67
|
+
opacity: 0.4,
|
|
68
|
+
},
|
|
69
|
+
header: {
|
|
70
|
+
backgroundColor: colors.background,
|
|
71
|
+
paddingHorizontal: 20,
|
|
72
|
+
paddingTop: 20,
|
|
73
|
+
paddingBottom: 20,
|
|
74
|
+
maxWidth: 393,
|
|
75
|
+
width: '100%',
|
|
76
|
+
alignSelf: 'center',
|
|
77
|
+
},
|
|
78
|
+
headerContent: {
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
justifyContent: 'space-between',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
marginTop: 28,
|
|
83
|
+
},
|
|
84
|
+
headerTitle: {
|
|
85
|
+
fontSize: 18,
|
|
86
|
+
fontWeight: '500',
|
|
87
|
+
color: colors.onSurface,
|
|
88
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
89
|
+
textTransform: 'capitalize',
|
|
90
|
+
},
|
|
91
|
+
successBanner: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
justifyContent: 'space-between',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
backgroundColor: colors.surface,
|
|
96
|
+
borderColor: colors.green,
|
|
97
|
+
borderWidth: 1,
|
|
98
|
+
borderRadius: 10,
|
|
99
|
+
paddingHorizontal: 16,
|
|
100
|
+
paddingVertical: 12,
|
|
101
|
+
marginHorizontal: 20,
|
|
102
|
+
marginBottom: 20,
|
|
103
|
+
maxWidth: 353,
|
|
104
|
+
alignSelf: 'center',
|
|
105
|
+
},
|
|
106
|
+
successContent: {
|
|
107
|
+
flexDirection: 'row',
|
|
108
|
+
alignItems: 'center',
|
|
109
|
+
justifyContent:'space-between'
|
|
110
|
+
},
|
|
111
|
+
successText: {
|
|
112
|
+
fontSize: 12,
|
|
113
|
+
fontWeight: '500',
|
|
114
|
+
color: colors.green,
|
|
115
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
116
|
+
},
|
|
117
|
+
scrollView: {
|
|
118
|
+
flex: 1,
|
|
119
|
+
},
|
|
120
|
+
scrollContent: {
|
|
121
|
+
paddingHorizontal: 20,
|
|
122
|
+
paddingBottom: 100,
|
|
123
|
+
maxWidth: 393,
|
|
124
|
+
width: '100%',
|
|
125
|
+
alignSelf: 'center',
|
|
126
|
+
},
|
|
127
|
+
orderCard: {
|
|
128
|
+
backgroundColor: colors.background,
|
|
129
|
+
borderRadius: 16,
|
|
130
|
+
padding: 20,
|
|
131
|
+
marginBottom: 20,
|
|
132
|
+
shadowColor: 'rgba(75, 85, 98, 0.15)',
|
|
133
|
+
shadowOffset: {
|
|
134
|
+
width: 0,
|
|
135
|
+
height: 2,
|
|
136
|
+
},
|
|
137
|
+
shadowOpacity: 1,
|
|
138
|
+
shadowRadius: 12,
|
|
139
|
+
elevation: 5,
|
|
140
|
+
},
|
|
141
|
+
orderHeader: {
|
|
142
|
+
marginBottom: 16,
|
|
143
|
+
},
|
|
144
|
+
orderStatus: {
|
|
145
|
+
flexDirection: 'row',
|
|
146
|
+
justifyContent: 'space-between',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
marginBottom: 8,
|
|
149
|
+
},
|
|
150
|
+
statusRow: {
|
|
151
|
+
flexDirection: 'row',
|
|
152
|
+
alignItems: 'center',
|
|
153
|
+
gap: 8,
|
|
154
|
+
flex: 1,
|
|
155
|
+
},
|
|
156
|
+
statusText: {
|
|
157
|
+
fontSize: 14,
|
|
158
|
+
fontWeight: '500',
|
|
159
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
160
|
+
textTransform: 'capitalize',
|
|
161
|
+
},
|
|
162
|
+
totalPoints: {
|
|
163
|
+
fontSize: 16,
|
|
164
|
+
fontWeight: '700',
|
|
165
|
+
color: colors.onSurface,
|
|
166
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
167
|
+
},
|
|
168
|
+
orderInfo: {
|
|
169
|
+
gap: 8,
|
|
170
|
+
},
|
|
171
|
+
orderNumber: {
|
|
172
|
+
fontSize: 10,
|
|
173
|
+
fontWeight: '400',
|
|
174
|
+
color: colors.onSurfaceVariant,
|
|
175
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
176
|
+
textTransform: 'capitalize',
|
|
177
|
+
},
|
|
178
|
+
orderDate: {
|
|
179
|
+
fontSize: 10,
|
|
180
|
+
fontWeight: '400',
|
|
181
|
+
color: colors.onSurfaceVariant,
|
|
182
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
183
|
+
textTransform: 'capitalize',
|
|
184
|
+
},
|
|
185
|
+
productsContainer: {
|
|
186
|
+
marginBottom: 16,
|
|
187
|
+
},
|
|
188
|
+
productRow: {
|
|
189
|
+
flexDirection: 'row',
|
|
190
|
+
justifyContent: 'space-between',
|
|
191
|
+
alignItems: 'flex-end',
|
|
192
|
+
paddingVertical: 8,
|
|
193
|
+
},
|
|
194
|
+
productLeft: {
|
|
195
|
+
flexDirection: 'row',
|
|
196
|
+
alignItems: 'flex-start',
|
|
197
|
+
gap: 12,
|
|
198
|
+
flex: 1,
|
|
199
|
+
},
|
|
200
|
+
productImageContainer: {
|
|
201
|
+
width: 81,
|
|
202
|
+
height: 54,
|
|
203
|
+
backgroundColor: colors.background,
|
|
204
|
+
borderRadius: 6.75,
|
|
205
|
+
shadowColor: 'rgba(75, 85, 98, 0.10)',
|
|
206
|
+
shadowOffset: {
|
|
207
|
+
width: 0,
|
|
208
|
+
height: 0.964,
|
|
209
|
+
},
|
|
210
|
+
shadowOpacity: 1,
|
|
211
|
+
shadowRadius: 5.786,
|
|
212
|
+
elevation: 2,
|
|
213
|
+
justifyContent: 'center',
|
|
214
|
+
alignItems: 'center',
|
|
215
|
+
overflow: 'hidden',
|
|
216
|
+
},
|
|
217
|
+
productImage: {
|
|
218
|
+
width: '100%',
|
|
219
|
+
height: '100%',
|
|
220
|
+
resizeMode: 'cover',
|
|
221
|
+
},
|
|
222
|
+
productDetails: {
|
|
223
|
+
flex: 1,
|
|
224
|
+
height: 54,
|
|
225
|
+
justifyContent: 'space-between',
|
|
226
|
+
},
|
|
227
|
+
productName: {
|
|
228
|
+
fontSize: 12,
|
|
229
|
+
fontWeight: '500',
|
|
230
|
+
color: colors.onSurface,
|
|
231
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
232
|
+
},
|
|
233
|
+
productDescription: {
|
|
234
|
+
fontSize: 10,
|
|
235
|
+
fontWeight: '400',
|
|
236
|
+
color: colors.onSurfaceVariant,
|
|
237
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
238
|
+
},
|
|
239
|
+
productQuantity: {
|
|
240
|
+
fontSize: 10,
|
|
241
|
+
fontWeight: '400',
|
|
242
|
+
color: colors.onSurfaceVariant,
|
|
243
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
244
|
+
},
|
|
245
|
+
productPoints: {
|
|
246
|
+
fontSize: 14,
|
|
247
|
+
fontWeight: '500',
|
|
248
|
+
color: colors.onSurface,
|
|
249
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
250
|
+
},
|
|
251
|
+
separator: {
|
|
252
|
+
height: 1.2,
|
|
253
|
+
backgroundColor: 'transparent',
|
|
254
|
+
marginVertical: 8,
|
|
255
|
+
width: 313,
|
|
256
|
+
alignSelf: 'center',
|
|
257
|
+
},
|
|
258
|
+
viewDetails: {
|
|
259
|
+
flexDirection: 'row',
|
|
260
|
+
justifyContent: 'flex-end',
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
gap: 12,
|
|
263
|
+
paddingTop: 8,
|
|
264
|
+
},
|
|
265
|
+
viewDetailsText: {
|
|
266
|
+
fontSize: 12,
|
|
267
|
+
fontWeight: '500',
|
|
268
|
+
color: colors.primary,
|
|
269
|
+
fontFamily: FontFamily.LEXEND_REGULAR,
|
|
270
|
+
},
|
|
271
|
+
crossIcon: {
|
|
272
|
+
height: 9,
|
|
273
|
+
width: 9,
|
|
274
|
+
},
|
|
275
|
+
tickIcon: {
|
|
276
|
+
height: 22,
|
|
277
|
+
width: 22,
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
export default styles;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ScrollView, Text, View } from 'react-native';
|
|
2
|
+
import ProfileField from '../../../src-app/components/ProfileField';
|
|
3
|
+
import CustomButton from '../../../src-app/components/CustomButton';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import styles from './styles';
|
|
6
|
+
import MobileHeader from '../../../src-app/components/MobileHeader';
|
|
7
|
+
import { StackNavigationProp } from '@react-navigation/stack';
|
|
8
|
+
import { RootStackParamList } from '../../../src-app/types/navigation';
|
|
9
|
+
import { RouteProp } from '@react-navigation/native';
|
|
10
|
+
import { CustomImage, Footer } from '../../../src-app/components';
|
|
11
|
+
import Images from '../../../src-app/constants/Images';
|
|
12
|
+
|
|
13
|
+
type MyProfileNavigationProp = StackNavigationProp<
|
|
14
|
+
RootStackParamList,
|
|
15
|
+
'MyProfile'
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
type MyProfileRouteProp = RouteProp<RootStackParamList, 'OTPVerification'>;
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
navigation: MyProfileNavigationProp;
|
|
22
|
+
route: MyProfileRouteProp;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const MyProfile: React.FC<Props> = ({ navigation }) => {
|
|
26
|
+
return (
|
|
27
|
+
<View style={styles.main}>
|
|
28
|
+
<MobileHeader
|
|
29
|
+
title="My Profile"
|
|
30
|
+
showBack
|
|
31
|
+
onBack={() => {
|
|
32
|
+
if (navigation.canGoBack()) {
|
|
33
|
+
navigation.goBack();
|
|
34
|
+
} else {
|
|
35
|
+
navigation.navigate('Profile' as never);
|
|
36
|
+
}
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
<ScrollView
|
|
40
|
+
contentContainerStyle={styles.contentContainer}
|
|
41
|
+
showsVerticalScrollIndicator={false}
|
|
42
|
+
>
|
|
43
|
+
<View style={styles.content}>
|
|
44
|
+
<ProfileField label="Shop name" value="Mahaveer" />
|
|
45
|
+
<ProfileField label="Mobile number" value="+91-7359222222" />
|
|
46
|
+
<ProfileField label="Email ID" value="Mahaveer.stn@gmail.com" />
|
|
47
|
+
<ProfileField
|
|
48
|
+
label="Address"
|
|
49
|
+
value="Flat no 4, Sravya Residency, near Jubliee Garden, Hanuman Nagar, Kondapur, Hyderabad 500084"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<View style={styles.row}>
|
|
53
|
+
<CustomImage source={Images.i_icon} imgStyle={styles.i_icon} />
|
|
54
|
+
<Text style={styles.text}>
|
|
55
|
+
For above changes or updates please contact HP pencils team
|
|
56
|
+
</Text>
|
|
57
|
+
</View>
|
|
58
|
+
</View>
|
|
59
|
+
<CustomButton
|
|
60
|
+
title="Confirm"
|
|
61
|
+
onPress={() => {
|
|
62
|
+
navigation.navigate('VerificationComplete');
|
|
63
|
+
}}
|
|
64
|
+
customButtonContainerStyle={styles.customButtonContainerStyle}
|
|
65
|
+
/>
|
|
66
|
+
<Footer />
|
|
67
|
+
</ScrollView>
|
|
68
|
+
</View>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default MyProfile;
|