ordering-ui-react-native 0.14.84 → 0.14.87

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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/components/OrderDetails/index.tsx +3 -1
  3. package/src/components/OrdersOption/index.tsx +4 -2
  4. package/src/utils/index.tsx +68 -0
  5. package/themes/business/src/components/OrdersOption/index.tsx +9 -1
  6. package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
  7. package/themes/business/src/components/ReviewCustomer/index.tsx +6 -7
  8. package/themes/business/src/utils/index.tsx +12 -0
  9. package/themes/doordash/src/components/OrderDetails/index.tsx +3 -1
  10. package/themes/doordash/src/components/OrdersOption/index.tsx +4 -2
  11. package/themes/instacart/src/components/OrderDetails/index.tsx +3 -1
  12. package/themes/instacart/src/components/OrdersOption/index.tsx +4 -2
  13. package/themes/original/index.tsx +4 -0
  14. package/themes/original/src/components/Checkout/index.tsx +13 -0
  15. package/themes/original/src/components/LastOrder/index.tsx +3 -1
  16. package/themes/original/src/components/MessageListing/index.tsx +4 -2
  17. package/themes/original/src/components/OrderDetails/index.tsx +14 -0
  18. package/themes/original/src/components/OrderProgress/index.tsx +5 -3
  19. package/themes/original/src/components/OrdersOption/index.tsx +4 -2
  20. package/themes/original/src/components/PaymentOptions/index.tsx +1 -1
  21. package/themes/original/src/components/ProductForm/index.tsx +13 -12
  22. package/themes/original/src/components/ProductOptionSubOption/index.tsx +75 -73
  23. package/themes/original/src/components/ReviewDriver/index.tsx +315 -0
  24. package/themes/original/src/components/ReviewDriver/styles.tsx +38 -0
  25. package/themes/original/src/components/ReviewOrder/index.tsx +325 -186
  26. package/themes/original/src/components/ReviewOrder/styles.tsx +24 -13
  27. package/themes/original/src/components/ReviewProducts/index.tsx +116 -0
  28. package/themes/original/src/components/ReviewProducts/styles.tsx +16 -0
  29. package/themes/original/src/components/SingleProductReview/index.tsx +166 -0
  30. package/themes/original/src/components/SingleProductReview/styles.tsx +27 -0
  31. package/themes/original/src/layouts/FloatingBottomContainer.tsx +26 -0
  32. package/themes/original/src/types/index.tsx +29 -2
  33. package/themes/single-business/src/components/LastOrder/index.tsx +3 -1
  34. package/themes/single-business/src/components/OrderDetails/index.tsx +15 -0
  35. package/themes/single-business/src/components/OrdersOption/index.tsx +4 -2
  36. package/themes/single-business/src/utils/index.tsx +7 -1
  37. package/themes/uber-eats/src/components/OrderDetails/index.tsx +3 -1
  38. package/themes/uber-eats/src/components/OrdersOption/index.tsx +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.14.84",
3
+ "version": "0.14.87",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -134,7 +134,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
134
134
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business'), slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 0.15, image: theme.images.order.status18 },
135
135
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer'), slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', percentage: 0.90, image: theme.images.order.status19 },
136
136
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90, image: theme.images.order.status20 },
137
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 }
137
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 },
138
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35, image: theme.images.order.status22 },
139
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45, image: theme.images.order.status23 }
138
140
  ]
139
141
 
140
142
 
@@ -91,7 +91,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
91
91
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
92
92
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
93
93
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
94
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
94
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
95
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
96
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
95
97
  ]
96
98
 
97
99
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -213,7 +215,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
213
215
  ...props,
214
216
  UIComponent: OrdersOptionUI,
215
217
  orderStatus: props.activeOrders
216
- ? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21]
218
+ ? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23]
217
219
  : [1, 2, 5, 6, 10, 11, 12, 16, 17],
218
220
  useDefualtSessionManager: true,
219
221
  paginationSettings: {
@@ -191,3 +191,71 @@ export const transformCountryCode = (countryCode : number) => {
191
191
  const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
192
192
  return R * c
193
193
  }
194
+
195
+ /**
196
+ * function to manage review comment list
197
+ * @param {number} param0 type of reviews to return
198
+ * @returns object with reviews dictionary
199
+ */
200
+ export const reviewCommentList = (type: string) => {
201
+ const [, t] = useLanguage()
202
+
203
+ const reviews: any = {
204
+ customer: {
205
+ 1: {
206
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_1', "What went wrong?"),
207
+ list: [
208
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_1_0', "Poor communication") },
209
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_1_1', "Wrong address") },
210
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_1_2', "COVID-19 issue") },
211
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_1_3', "Didn't follow instructions") },
212
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_1_4', "Rude") },
213
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_1_5', "Not on-time") },
214
+ ]
215
+ },
216
+ 2: {
217
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_2', "What went wrong?"),
218
+ list: [
219
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_2_0', "Poor communication") },
220
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_2_1', "Wrong address") },
221
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_2_2', "COVID-19 issue") },
222
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_2_3', "Didn't follow instructions") },
223
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_2_4', "Rude") },
224
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_2_5', "Not on-time") },
225
+ ]
226
+ },
227
+ 3: {
228
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_3', "What could have been better?"),
229
+ list: [
230
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_3_0', "Poor communication") },
231
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_3_1', "Wrong address") },
232
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_3_2', "COVID-19 issue") },
233
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_3_3', "Didn't follow instructions") },
234
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_3_4', "Rude") },
235
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_3_5', "Not on-time") },
236
+ ]
237
+ },
238
+ 4: {
239
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_4', " Tell us more"),
240
+ list: [
241
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_4_0', "Poor communication") },
242
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_4_1', "Wrong address") },
243
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_4_2', "COVID-19 issue") },
244
+ { key: 3, content: t('CUSTOMER_QUICK_COMMENT_4_3', "Didn't follow instructions") },
245
+ { key: 4, content: t('CUSTOMER_QUICK_COMMENT_4_4', "Rude") },
246
+ { key: 5, content: t('CUSTOMER_QUICK_COMMENT_4_5', "Not on-time") },
247
+ ]
248
+ },
249
+ 5: {
250
+ title: t('CUSTOMER_QUICK_COMMENT_TITLE_5', "What went well?"),
251
+ list: [
252
+ { key: 0, content: t('CUSTOMER_QUICK_COMMENT_5_0', "Good communication") },
253
+ { key: 1, content: t('CUSTOMER_QUICK_COMMENT_5_1', "Friendly") },
254
+ { key: 2, content: t('CUSTOMER_QUICK_COMMENT_5_2', "Above and beyond") },
255
+ ]
256
+ },
257
+ }
258
+ }
259
+
260
+ return reviews[type]
261
+ }
@@ -712,6 +712,14 @@ export const OrdersOption = (props: OrdersOptionParams) => {
712
712
  'Customer arrived to business',
713
713
  ),
714
714
  },
715
+ {
716
+ key: 22,
717
+ text: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver')
718
+ },
719
+ {
720
+ key: 23,
721
+ text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
722
+ }
715
723
  ],
716
724
  tabs: [
717
725
  {
@@ -723,7 +731,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
723
731
  {
724
732
  key: 1,
725
733
  text: t('IN_PROGRESS', 'In Progress'),
726
- tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21],
734
+ tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
727
735
  title: 'inProgress',
728
736
  },
729
737
  {
@@ -176,6 +176,18 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
176
176
  slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
177
177
  percentage: 95,
178
178
  },
179
+ {
180
+ key: 22,
181
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
182
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
183
+ percentage: 35
184
+ },
185
+ {
186
+ key: 23,
187
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
188
+ slug: 'ORDER_DRIVER_ON_WAY',
189
+ percentage: 45
190
+ }
179
191
  ];
180
192
 
181
193
  const objectStatus = orderStatus.find(o => o.key === status);
@@ -20,6 +20,8 @@ import { FloatingButton } from '../FloatingButton'
20
20
  import LinearGradient from 'react-native-linear-gradient'
21
21
  import Alert from '../../providers/AlertProvider'
22
22
 
23
+ import { reviewCommentList } from '../../../../../src/utils'
24
+
23
25
  import {
24
26
  Content,
25
27
  ActionButtonWrapper,
@@ -101,11 +103,8 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
101
103
  { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
102
104
  ]
103
105
 
104
- const commentsList = [
105
- { key: 0, content: t('RESPECTFUL', 'Respectful') },
106
- { key: 1, content: t('EXCELLENT_COMMUNICATION', "Excellent communication") },
107
- { key: 2, content: t('CORDIAL_SERVICE', 'Cordial service') }
108
- ]
106
+ const commentsList = reviewCommentList('customer')
107
+
109
108
  const isSelectedComment = (commentKey: number) => {
110
109
  const found = comments.find((comment: any) => comment?.key === commentKey)
111
110
  return found
@@ -251,10 +250,10 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
251
250
  size={12}
252
251
  style={{ marginTop: 30 }}
253
252
  >
254
- {t('COMMENTS', 'Comments')}
253
+ {commentsList[reviewState?.qualification || 1]?.title}
255
254
  </OText>
256
255
  <CommentsButtonGroup>
257
- {commentsList.map(commentItem => (
256
+ {commentsList[reviewState?.qualification || 1]?.list?.map(commentItem => (
258
257
  <OButton
259
258
  key={commentItem.key}
260
259
  text={commentItem.content}
@@ -325,6 +325,18 @@ export const getOrderStatus = (s: string, t: any) => {
325
325
  slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
326
326
  percentage: 95,
327
327
  },
328
+ {
329
+ key: 22,
330
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
331
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
332
+ percentage: 35
333
+ },
334
+ {
335
+ key: 23,
336
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
337
+ slug: 'ORDER_DRIVER_ON_WAY',
338
+ percentage: 45
339
+ }
328
340
  ];
329
341
 
330
342
  const objectStatus = orderStatus.find(o => o.key === status);
@@ -126,7 +126,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
126
126
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business'), slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 0.15, image: theme.images.order.status18 },
127
127
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer'), slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', percentage: 0.90, image: theme.images.order.status19 },
128
128
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90, image: theme.images.order.status20 },
129
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 }
129
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 },
130
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35, image: theme.images.order.status22 },
131
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45, image: theme.images.order.status23 }
130
132
  ]
131
133
 
132
134
 
@@ -91,7 +91,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
91
91
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
92
92
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
93
93
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
94
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
94
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
95
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
96
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
95
97
  ]
96
98
 
97
99
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -208,7 +210,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
208
210
  ...props,
209
211
  UIComponent: OrdersOptionUI,
210
212
  orderStatus: props.activeOrders
211
- ? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21]
213
+ ? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23]
212
214
  : [1, 2, 5, 6, 10, 11, 12, 16, 17],
213
215
  useDefualtSessionManager: true,
214
216
  paginationSettings: {
@@ -133,7 +133,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
133
133
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business'), slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 0.15, image: theme.images.order.status18 },
134
134
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer'), slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', percentage: 0.90, image: theme.images.order.status19 },
135
135
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90, image: theme.images.order.status20 },
136
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 }
136
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 },
137
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35, image: theme.images.order.status22 },
138
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45, image: theme.images.order.status23 }
137
139
  ]
138
140
 
139
141
 
@@ -89,7 +89,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
89
89
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
90
90
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
91
91
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
92
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
92
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
93
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
94
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
93
95
  ]
94
96
 
95
97
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -205,7 +207,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
205
207
  ...props,
206
208
  UIComponent: OrdersOptionUI,
207
209
  orderStatus: props.activeOrders
208
- ? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21]
210
+ ? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23]
209
211
  : [1, 2, 5, 6, 10, 11, 12, 16, 17],
210
212
  useDefualtSessionManager: true,
211
213
  paginationSettings: {
@@ -20,6 +20,8 @@ import { BusinessPreorder } from './src/components/BusinessPreorder';
20
20
  import { BusinessMenuList } from './src/components/BusinessMenuList';
21
21
  import { UserProfileForm } from './src/components/UserProfileForm';
22
22
  import { ReviewOrder } from './src/components/ReviewOrder';
23
+ import { ReviewProducts } from './src/components/ReviewProducts';
24
+ import { ReviewDriver } from './src/components/ReviewDriver';
23
25
  import { UserProfile } from './src/components/UserProfile';
24
26
  import { MessageListing } from './src/components/MessageListing';
25
27
  import { Help } from './src/components/Help';
@@ -82,6 +84,8 @@ export {
82
84
  BusinessPreorder,
83
85
  UserProfileForm,
84
86
  ReviewOrder,
87
+ ReviewProducts,
88
+ ReviewDriver,
85
89
  BusinessMenuList,
86
90
  UserProfile,
87
91
  MessageListing,
@@ -667,6 +667,19 @@ const CheckoutUI = (props: any) => {
667
667
  setShowGateway={setShowGateway}
668
668
  />
669
669
  )}
670
+ {webviewPaymethod?.gateway === 'square' && showGateway.open && (
671
+ <PaymentOptionsWebView
672
+ onNavigationRedirect={onNavigationRedirect}
673
+ uri={`https://test-square-f50f7.web.app`}
674
+ user={user}
675
+ token={token}
676
+ cart={cart}
677
+ currency={currency}
678
+ webviewPaymethod={webviewPaymethod}
679
+ setShowGateway={setShowGateway}
680
+ locationId={'L1NGAY5M6KJRX'}
681
+ />
682
+ )}
670
683
  </>
671
684
  )
672
685
  }
@@ -91,7 +91,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
91
91
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
92
92
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
93
93
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
94
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
94
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
95
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
96
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
95
97
  ]
96
98
 
97
99
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -73,7 +73,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
73
73
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
74
74
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
75
75
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
76
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
76
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
77
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
78
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
77
79
  ]
78
80
 
79
81
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -218,7 +220,7 @@ export const OrderListing = (props: OrdersOptionParams) => {
218
220
  const OrderListingProps = {
219
221
  ...props,
220
222
  UIComponent: OrdersOptionUI,
221
- orderStatus: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],
223
+ orderStatus: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
222
224
  useDefualtSessionManager: true,
223
225
  paginationSettings: {
224
226
  initialPage: 1,
@@ -293,6 +293,20 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
293
293
  percentage: 95,
294
294
  image: theme.images.order.status7,
295
295
  },
296
+ {
297
+ key: 22,
298
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
299
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
300
+ percentage: 35,
301
+ image: theme.images.order.status8
302
+ },
303
+ {
304
+ key: 23,
305
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
306
+ slug: 'ORDER_DRIVER_ON_WAY',
307
+ percentage: 45,
308
+ image: theme.images.order.status8
309
+ }
296
310
  ];
297
311
 
298
312
  const objectStatus = orderStatus.find((o) => o.key === status);
@@ -97,7 +97,9 @@ const OrderProgressUI = (props: any) => {
97
97
  { key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', percentage: 55 },
98
98
  { key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', percentage: 90 },
99
99
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90 },
100
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 }
100
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 },
101
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35 },
102
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45 }
101
103
  ]
102
104
 
103
105
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -137,7 +139,7 @@ const OrderProgressUI = (props: any) => {
137
139
  return (
138
140
  <>
139
141
  {orderList?.loading && (
140
- <Placeholder Animation={Fade} height={160}>
142
+ <Placeholder Animation={Fade} height={158}>
141
143
  <PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
142
144
  <PlaceholderLine height={20} style={{ marginBottom: 10 }} />
143
145
  <PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
@@ -217,7 +219,7 @@ export const OrderProgress = (props: any) => {
217
219
  const orderProgressProps = {
218
220
  ...props,
219
221
  UIComponent: OrderProgressUI,
220
- orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21],
222
+ orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23],
221
223
  useDefualtSessionManager: true,
222
224
  paginationSettings: {
223
225
  initialPage: 1,
@@ -93,7 +93,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
93
93
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
94
94
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
95
95
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
96
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
96
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
97
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
98
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
97
99
  ]
98
100
 
99
101
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -230,7 +232,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
230
232
  ...props,
231
233
  UIComponent: OrdersOptionUI,
232
234
  orderStatus: props.preOrders ? [13] : props.activeOrders
233
- ? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21]
235
+ ? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21, 22, 23]
234
236
  : [1, 2, 5, 6, 10, 11, 12, 16, 17],
235
237
  useDefualtSessionManager: true,
236
238
  }
@@ -154,7 +154,7 @@ const PaymentOptionsUI = (props: any) => {
154
154
  )
155
155
  }
156
156
 
157
- const excludeIds: any = [32, 66]; //exclude paypal & connect & redirect
157
+ const excludeIds: any = [32]; //exclude paypal & connect & redirect
158
158
 
159
159
  return (
160
160
  <PMContainer>
@@ -935,28 +935,29 @@ export const ProductOptionsUI = (props: any) => {
935
935
  style={{
936
936
  width: isSoldOut || maxProductQuantity <= 0 ? '60%' : '40%',
937
937
  }}>
938
- {productCart &&
939
- !isSoldOut &&
940
- maxProductQuantity > 0 &&
938
+ {((productCart &&
941
939
  auth &&
942
- orderState.options?.address_id && (
940
+ orderState.options?.address_id) || (isSoldOut || maxProductQuantity <= 0)) && (
943
941
  <OButton
944
942
  onClick={() => handleSaveProduct()}
945
943
  imgRightSrc=""
946
944
  text={`${orderState.loading
947
945
  ? t('LOADING', 'Loading')
948
- : editMode
949
- ? t('UPDATE', 'Update')
950
- : t('ADD', 'Add')
946
+ : (isSoldOut || maxProductQuantity <= 0)
947
+ ? t('SOLD_OUT', 'Sold out')
948
+ : editMode
949
+ ? t('UPDATE', 'Update')
950
+ : t('ADD', 'Add')
951
951
  }`}
952
+ isDisabled={isSoldOut || maxProductQuantity <= 0}
952
953
  textStyle={{
953
- color: (saveErrors || !productCart.quantity) ? theme.colors.primary : theme.colors.white,
954
+ color: saveErrors || isSoldOut || maxProductQuantity <= 0 ? theme.colors.primary : theme.colors.white,
954
955
  fontSize: orderState.loading || editMode ? 10 : 14
955
956
  }}
956
957
  style={{
957
- backgroundColor: (saveErrors || !productCart.quantity) ? theme.colors.lightGray : theme.colors.primary,
958
- borderColor: (saveErrors || !productCart.quantity) ? theme.colors.white : theme.colors.primary,
959
- opacity: (saveErrors || !productCart.quantity) ? 0.3 : 1,
958
+ backgroundColor: saveErrors || isSoldOut || maxProductQuantity <= 0 ? theme.colors.lightGray : theme.colors.primary,
959
+ borderColor: saveErrors || isSoldOut || maxProductQuantity <= 0 ? theme.colors.white : theme.colors.primary,
960
+ opacity: saveErrors || isSoldOut || maxProductQuantity <= 0 ? 0.3 : 1,
960
961
  borderRadius: 7.6,
961
962
  height: 44,
962
963
  shadowOpacity: 0,
@@ -976,7 +977,7 @@ export const ProductOptionsUI = (props: any) => {
976
977
  ) : (
977
978
  <OButton onClick={navigation.navigate('AddressList')} />
978
979
  ))}
979
- {(!auth || isSoldOut || maxProductQuantity <= 0) && (
980
+ {!auth && (
980
981
  <OButton
981
982
  isDisabled={isSoldOut || maxProductQuantity <= 0}
982
983
  onClick={() => handleRedirectLogin()}