ordering-ui-react-native 0.14.83 → 0.14.86

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 (26) 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/themes/business/src/components/OrdersOption/index.tsx +9 -1
  5. package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
  6. package/themes/business/src/utils/index.tsx +12 -0
  7. package/themes/doordash/src/components/OrderDetails/index.tsx +3 -1
  8. package/themes/doordash/src/components/OrdersOption/index.tsx +4 -2
  9. package/themes/instacart/src/components/OrderDetails/index.tsx +3 -1
  10. package/themes/instacart/src/components/OrdersOption/index.tsx +4 -2
  11. package/themes/original/src/components/BusinessesListing/index.tsx +19 -10
  12. package/themes/original/src/components/Checkout/index.tsx +13 -0
  13. package/themes/original/src/components/LastOrder/index.tsx +3 -1
  14. package/themes/original/src/components/MessageListing/index.tsx +4 -2
  15. package/themes/original/src/components/OrderDetails/index.tsx +14 -0
  16. package/themes/original/src/components/OrderProgress/index.tsx +5 -3
  17. package/themes/original/src/components/OrdersOption/index.tsx +4 -2
  18. package/themes/original/src/components/PaymentOptions/index.tsx +1 -1
  19. package/themes/original/src/components/ProductForm/index.tsx +13 -12
  20. package/themes/original/src/components/ProductOptionSubOption/index.tsx +75 -73
  21. package/themes/single-business/src/components/LastOrder/index.tsx +3 -1
  22. package/themes/single-business/src/components/OrderDetails/index.tsx +15 -0
  23. package/themes/single-business/src/components/OrdersOption/index.tsx +4 -2
  24. package/themes/single-business/src/utils/index.tsx +7 -1
  25. package/themes/uber-eats/src/components/OrderDetails/index.tsx +3 -1
  26. 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.83",
3
+ "version": "0.14.86",
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: {
@@ -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);
@@ -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: {
@@ -117,6 +117,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
117
117
  const [featuredBusiness, setFeaturedBusinesses] = useState(Array);
118
118
  const [isFarAway, setIsFarAway] = useState(false)
119
119
 
120
+ const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
121
+ Number(configs?.max_days_preorder?.value) > 0
122
+
120
123
  const timerId = useRef<any>(false)
121
124
  // const panResponder = useRef(
122
125
  // PanResponder.create({
@@ -128,6 +131,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
128
131
  // })
129
132
  // ).current
130
133
 
134
+ const handleMomentClick = () => {
135
+ if (isPreorderEnabled) {
136
+ navigation.navigate('MomentOption')
137
+ }
138
+ }
139
+
131
140
  const configTypes =
132
141
  configs?.order_types_allowed?.value
133
142
  .split('|')
@@ -198,14 +207,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
198
207
  }, [orderState?.options?.address?.location])
199
208
 
200
209
  useEffect(() => {
201
- const onFocusApp = (nextAppState : any) => {
210
+ const onFocusApp = (nextAppState: any) => {
202
211
  if (
203
212
  appState.current.match(/inactive|background/) &&
204
213
  nextAppState === "active"
205
214
  ) {
206
- if (!businessesList.loading) {
207
- getBusinesses(true);
208
- }
215
+ getBusinesses(true);
209
216
  }
210
217
  appState.current = nextAppState;
211
218
  setAppStateVisible(appState.current);
@@ -281,7 +288,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
281
288
  />
282
289
  </WrapMomentOption>
283
290
  <WrapMomentOption
284
- onPress={() => navigation.navigate('MomentOption')}>
291
+ onPress={() => handleMomentClick()}>
285
292
  <OText
286
293
  size={12}
287
294
  numberOfLines={1}
@@ -291,11 +298,13 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
291
298
  ? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
292
299
  : t('ASAP_ABBREVIATION', 'ASAP')}
293
300
  </OText>
294
- <OIcon
295
- src={theme.images.general.arrow_down}
296
- width={10}
297
- style={{ marginStart: 8 }}
298
- />
301
+ {isPreorderEnabled && (
302
+ <OIcon
303
+ src={theme.images.general.arrow_down}
304
+ width={10}
305
+ style={{ marginStart: 8 }}
306
+ />
307
+ )}
299
308
  </WrapMomentOption>
300
309
 
301
310
  {!businessId && (
@@ -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()}
@@ -5,7 +5,7 @@ import {
5
5
  ProductOptionSuboption as ProductSubOptionController
6
6
  } from 'ordering-components/native'
7
7
  import { useTheme } from 'styled-components/native';
8
- import { StyleSheet } from 'react-native'
8
+ import { StyleSheet, View } from 'react-native'
9
9
 
10
10
  import {
11
11
  Container,
@@ -52,81 +52,83 @@ export const ProductOptionSubOptionUI = (props: any) => {
52
52
  const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
53
53
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
54
54
  return (
55
- <Container onPress={() => handleSuboptionClick()}>
56
- <IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
57
- {((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
58
- state?.selected ? (
59
- <OIcon src={theme.images.general.check_act} color={theme.colors.primary} width={16} />
55
+ <View>
56
+ <Container onPress={() => handleSuboptionClick()}>
57
+ <IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
58
+ {((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
59
+ state?.selected ? (
60
+ <OIcon src={theme.images.general.check_act} color={theme.colors.primary} width={16} />
61
+ ) : (
62
+ <OIcon src={theme.images.general.check_nor} color={theme.colors.disabled} width={16} />
63
+ )
60
64
  ) : (
61
- <OIcon src={theme.images.general.check_nor} color={theme.colors.disabled} width={16} />
62
- )
63
- ) : (
64
- state?.selected ? (
65
- <OIcon src={theme.images.general.radio_act} color={theme.colors.primary} width={16} />
66
- ) : (
67
- <OIcon src={theme.images.general.radio_nor} color={theme.colors.disabled} width={16} />
68
- )
69
- )}
70
- <OText size={12} lineHeight={18} color={theme.colors.textSecondary} mLeft={10} style={{ flex: 1 }}>
71
- {suboption?.name}
65
+ state?.selected ? (
66
+ <OIcon src={theme.images.general.radio_act} color={theme.colors.primary} width={16} />
67
+ ) : (
68
+ <OIcon src={theme.images.general.radio_nor} color={theme.colors.disabled} width={16} />
69
+ )
70
+ )}
71
+ <OText size={12} lineHeight={18} color={theme.colors.textSecondary} mLeft={10} style={{ flex: 1 }}>
72
+ {suboption?.name}
73
+ </OText>
74
+ </IconControl>
75
+ <QuantityControl>
76
+ {option?.allow_suboption_quantity && state?.selected && (
77
+ <>
78
+ <Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
79
+ <OIcon
80
+ src={theme.images.general.minus}
81
+ width={16}
82
+ color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
83
+ />
84
+ </Checkbox>
85
+ <OText size={12} mLeft={5} mRight={5}>
86
+ {state.quantity}
87
+ </OText>
88
+ <Checkbox disabled={disabled || disableIncrement} onPress={increment}>
89
+ <OIcon
90
+ src={theme.images.general.plus}
91
+ width={16}
92
+ color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
93
+ />
94
+ </Checkbox>
95
+ </>
96
+ )}
97
+ </QuantityControl>
98
+ <PositionControl>
99
+ {option?.with_half_option && state?.selected && (
100
+ <>
101
+ <Circle disabled={disabled} onPress={() => changePosition('left')}>
102
+ <OIcon
103
+ src={theme.images.general.half_l}
104
+ color={state.selected && state.position === 'left' ? theme.colors.primary : '#cbcbcb'}
105
+ width={16}
106
+ style={styles.inverse}
107
+ />
108
+ </Circle>
109
+ <Circle disabled={disabled} onPress={() => changePosition('whole')}>
110
+ <OIcon
111
+ src={theme.images.general.half_f}
112
+ color={state.selected && state.position === 'whole' ? theme.colors.primary : '#cbcbcb'}
113
+ width={16}
114
+ />
115
+ </Circle>
116
+ <Circle disabled={disabled} onPress={() => changePosition('right')}>
117
+ <OIcon
118
+ src={theme.images.general.half_r}
119
+ color={state.selected && state.position === 'right' ? theme.colors.primary : '#cbcbcb'}
120
+ width={16}
121
+ />
122
+ </Circle>
123
+ </>
124
+ )}
125
+ </PositionControl>
126
+ <OText size={12} lineHeight={18} color={theme.colors.textSecondary}>
127
+ + {parsePrice(price)}
72
128
  </OText>
73
- </IconControl>
129
+ </Container>
74
130
  {showMessage && <OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}</OText>}
75
- <QuantityControl>
76
- {option?.allow_suboption_quantity && state?.selected && (
77
- <>
78
- <Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
79
- <OIcon
80
- src={theme.images.general.minus}
81
- width={16}
82
- color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
83
- />
84
- </Checkbox>
85
- <OText size={12} mLeft={5} mRight={5}>
86
- {state.quantity}
87
- </OText>
88
- <Checkbox disabled={disabled || disableIncrement} onPress={increment}>
89
- <OIcon
90
- src={theme.images.general.plus}
91
- width={16}
92
- color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
93
- />
94
- </Checkbox>
95
- </>
96
- )}
97
- </QuantityControl>
98
- <PositionControl>
99
- {option?.with_half_option && state?.selected && (
100
- <>
101
- <Circle disabled={disabled} onPress={() => changePosition('left')}>
102
- <OIcon
103
- src={theme.images.general.half_l}
104
- color={state.selected && state.position === 'left' ? theme.colors.primary : '#cbcbcb'}
105
- width={16}
106
- style={styles.inverse}
107
- />
108
- </Circle>
109
- <Circle disabled={disabled} onPress={() => changePosition('whole')}>
110
- <OIcon
111
- src={theme.images.general.half_f}
112
- color={state.selected && state.position === 'whole' ? theme.colors.primary : '#cbcbcb'}
113
- width={16}
114
- />
115
- </Circle>
116
- <Circle disabled={disabled} onPress={() => changePosition('right')}>
117
- <OIcon
118
- src={theme.images.general.half_r}
119
- color={state.selected && state.position === 'right' ? theme.colors.primary : '#cbcbcb'}
120
- width={16}
121
- />
122
- </Circle>
123
- </>
124
- )}
125
- </PositionControl>
126
- <OText size={12} lineHeight={18} color={theme.colors.textSecondary}>
127
- + {parsePrice(price)}
128
- </OText>
129
- </Container>
131
+ </View>
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)
@@ -284,6 +284,21 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
284
284
  percentage: 95,
285
285
  image: theme.images.order.status7,
286
286
  },
287
+ {
288
+ key: 22,
289
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
290
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
291
+ percentage: 35,
292
+ image: theme.images.order.status8,
293
+
294
+ },
295
+ {
296
+ key: 23,
297
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
298
+ slug: 'ORDER_DRIVER_ON_WAY',
299
+ percentage: 45,
300
+ image: theme.images.order.status8,
301
+ }
287
302
  ];
288
303
 
289
304
  const objectStatus = orderStatus.find((o) => o.key === status);
@@ -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)
@@ -228,7 +230,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
228
230
  ...props,
229
231
  UIComponent: OrdersOptionUI,
230
232
  orderStatus: props.preOrders ? [13] : props.activeOrders
231
- ? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21]
233
+ ? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21, 22, 23]
232
234
  : [1, 2, 5, 6, 10, 11, 12, 16, 17],
233
235
  useDefualtSessionManager: true,
234
236
  paginationSettings: {
@@ -216,6 +216,10 @@ export const getOrderStatus = (status: number) => {
216
216
  return 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS'
217
217
  case 21:
218
218
  return 'ORDER_CUSTOMER_ARRIVED_BUSINESS'
219
+ case 22:
220
+ return 'ORDER_LOOKING_FOR_DRIVER'
221
+ case 23:
222
+ return 'ORDER_DRIVER_ON_WAY'
219
223
  default:
220
224
  return status
221
225
  }
@@ -245,7 +249,9 @@ export const getTextOrderStatus = (s: string, t: any) => {
245
249
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
246
250
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
247
251
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
248
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
252
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
253
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
254
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
249
255
  ]
250
256
 
251
257
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -119,7 +119,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
119
119
  { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business'), slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', progress: 2 },
120
120
  { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer'), slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', progress: 2 },
121
121
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', progress: 2 },
122
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', progress: 2 }
122
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', progress: 2 },
123
+ { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', progress: 2 },
124
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', progress: 2 }
123
125
  ]
124
126
 
125
127
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -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)
@@ -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: {