ordering-ui-react-native 0.21.48-test → 0.21.48-test-3

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 (41) hide show
  1. package/package.json +2 -3
  2. package/src/components/StripeMethodForm/index.tsx +3 -2
  3. package/themes/business/index.tsx +0 -5
  4. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  5. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  6. package/themes/business/src/components/MapView/index.tsx +6 -2
  7. package/themes/business/src/components/OrderDetails/Delivery.tsx +11 -6
  8. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +12 -0
  9. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  10. package/themes/business/src/components/OrderSummary/index.tsx +3 -10
  11. package/themes/business/src/components/OrdersOption/index.tsx +2 -0
  12. package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
  13. package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
  14. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  15. package/themes/original/index.tsx +6 -2
  16. package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
  17. package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
  18. package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -1
  19. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  20. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  21. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  22. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +22 -402
  23. package/themes/original/src/components/Checkout/index.tsx +9 -1
  24. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  25. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  26. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  27. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  28. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  29. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  30. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  31. package/themes/original/src/components/MultiCheckout/index.tsx +138 -16
  32. package/themes/original/src/components/NavBar/index.tsx +0 -1
  33. package/themes/original/src/components/OrderDetails/index.tsx +8 -4
  34. package/themes/original/src/components/OrderProgress/index.tsx +2 -1
  35. package/themes/original/src/components/PaymentOptions/index.tsx +4 -2
  36. package/themes/original/src/components/ProductForm/index.tsx +1 -2
  37. package/themes/original/src/components/UserFormDetails/index.tsx +35 -1
  38. package/themes/original/src/components/Wallets/index.tsx +1 -0
  39. package/themes/original/src/components/Wallets/styles.tsx +0 -1
  40. package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -106
  41. package/themes/business/src/components/StarPrinter/index.tsx +0 -235
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native';
4
- import { useLanguage } from 'ordering-components/native';
4
+ import { useLanguage, useConfig } from 'ordering-components/native';
5
5
 
6
6
  import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
7
7
 
@@ -24,12 +24,15 @@ export const PreviousOrders = (props: any) => {
24
24
  currentTabSelected,
25
25
  currentOrdenSelected,
26
26
  handleChangeOrderStatus,
27
- handleSendCustomerReview
27
+ handleSendCustomerReview,
28
+ isBusinessApp
28
29
  } = props;
29
30
 
30
31
  let hash: any = {};
31
32
  const [, t] = useLanguage();
32
33
  const theme = useTheme();
34
+ const [{ configs }] = useConfig();
35
+
33
36
 
34
37
  // const [, setCurrentTime] = useState()
35
38
  const [openModal, setOpenModal] = useState(false)
@@ -41,6 +44,7 @@ export const PreviousOrders = (props: any) => {
41
44
  const viewMapStatus = [9, 18, 19, 23]
42
45
  const deliveryPickupBtn = props.appTitle?.text?.includes('Delivery') && [3, 8, 18]
43
46
  const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23]
47
+ const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1' && !isBusinessApp
44
48
 
45
49
  const handlePressOrder = (order: any) => {
46
50
  if (order?.locked && isLogisticOrder) return
@@ -168,28 +172,30 @@ export const PreviousOrders = (props: any) => {
168
172
  }
169
173
  {_ordersGrouped[k][0]?.status === 0 && (
170
174
  <AcceptOrRejectOrderStyle>
171
- <OButton
172
- text={t('REJECT_ALL', 'Reject all')}
173
- bgColor={theme.colors.danger100}
174
- borderColor={theme.colors.danger100}
175
- imgRightSrc={null}
176
- style={{ borderRadius: 7, height: 40 }}
177
- parentStyle={{ width: '45%' }}
178
- textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
179
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
180
- action: 'reject',
181
- order: _ordersGrouped[k][0],
182
- ids: _ordersGrouped[k].map((o: any) => o.id),
183
- handleChangeOrderStatus
184
- })}
185
- />
175
+ {!isHideRejectButtons && (
176
+ <OButton
177
+ text={t('REJECT_ALL', 'Reject all')}
178
+ bgColor={theme.colors.danger100}
179
+ borderColor={theme.colors.danger100}
180
+ imgRightSrc={null}
181
+ style={{ borderRadius: 7, height: 40 }}
182
+ parentStyle={{ width: '45%' }}
183
+ textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
184
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
185
+ action: 'reject',
186
+ order: _ordersGrouped[k][0],
187
+ ids: _ordersGrouped[k].map((o: any) => o.id),
188
+ handleChangeOrderStatus
189
+ })}
190
+ />
191
+ )}
186
192
  <OButton
187
193
  text={t('ACCEPT_ALL', 'Accept all')}
188
194
  bgColor={theme.colors.success100}
189
195
  borderColor={theme.colors.success100}
190
196
  imgRightSrc={null}
191
197
  style={{ borderRadius: 7, height: 40 }}
192
- parentStyle={{ width: '45%' }}
198
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
193
199
  textStyle={{ color: theme.colors.success500, fontSize: 12 }}
194
200
  onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
195
201
  action: 'accept',
@@ -236,7 +242,7 @@ export const PreviousOrders = (props: any) => {
236
242
  />
237
243
  </AcceptOrRejectOrderStyle>
238
244
  )}
239
- {_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
245
+ {_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 && !isHideRejectButtons &&
240
246
  (
241
247
  <AcceptOrRejectOrderStyle>
242
248
  <OButton
@@ -276,26 +282,28 @@ export const PreviousOrders = (props: any) => {
276
282
  ![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
277
283
  (
278
284
  <AcceptOrRejectOrderStyle>
279
- <OButton
280
- text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
281
- bgColor={theme.colors.danger100}
282
- borderColor={theme.colors.danger100}
283
- imgRightSrc={null}
284
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
285
- parentStyle={{ width: '45%' }}
286
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
287
- onClick={() => handleChangeOrderStatus(
288
- 17,
289
- _ordersGrouped[k].map((o: any) => o.id),
290
- )}
291
- />
285
+ {!isHideRejectButtons && (
286
+ <OButton
287
+ text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
288
+ bgColor={theme.colors.danger100}
289
+ borderColor={theme.colors.danger100}
290
+ imgRightSrc={null}
291
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
292
+ parentStyle={{ width: '45%' }}
293
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
294
+ onClick={() => handleChangeOrderStatus(
295
+ 17,
296
+ _ordersGrouped[k].map((o: any) => o.id),
297
+ )}
298
+ />
299
+ )}
292
300
  <OButton
293
301
  text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
294
302
  bgColor={theme.colors.success100}
295
303
  borderColor={theme.colors.success100}
296
304
  imgRightSrc={null}
297
305
  style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
298
- parentStyle={{ width: '45%' }}
306
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
299
307
  textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
300
308
  onClick={() => handleChangeOrderStatus(
301
309
  15,
@@ -324,28 +332,30 @@ export const PreviousOrders = (props: any) => {
324
332
  )}
325
333
  {!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
326
334
  <AcceptOrRejectOrderStyle>
327
- <OButton
328
- text={t('PICKUP_FAILED', 'Pickup failed')}
329
- bgColor={theme.colors.danger100}
330
- borderColor={theme.colors.danger100}
331
- imgRightSrc={null}
332
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
333
- parentStyle={{ width: '45%' }}
334
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
335
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
336
- action: 'pickupFailed',
337
- order: _ordersGrouped[k][0],
338
- ids: _ordersGrouped[k].map((o: any) => o.id),
339
- handleChangeOrderStatus
340
- })}
341
- />
335
+ {!isHideRejectButtons && (
336
+ <OButton
337
+ text={t('PICKUP_FAILED', 'Pickup failed')}
338
+ bgColor={theme.colors.danger100}
339
+ borderColor={theme.colors.danger100}
340
+ imgRightSrc={null}
341
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
342
+ parentStyle={{ width: '45%' }}
343
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
344
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
345
+ action: 'pickupFailed',
346
+ order: _ordersGrouped[k][0],
347
+ ids: _ordersGrouped[k].map((o: any) => o.id),
348
+ handleChangeOrderStatus
349
+ })}
350
+ />
351
+ )}
342
352
  <OButton
343
353
  text={t('PICKUP_COMPLETE', 'Pickup complete')}
344
354
  bgColor={theme.colors.success100}
345
355
  borderColor={theme.colors.success100}
346
356
  imgRightSrc={null}
347
357
  style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
348
- parentStyle={{ width: '45%' }}
358
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
349
359
  textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
350
360
  onClick={() => handleChangeOrderStatus(
351
361
  9,
@@ -356,28 +366,30 @@ export const PreviousOrders = (props: any) => {
356
366
  )}
357
367
  {!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
358
368
  <AcceptOrRejectOrderStyle>
359
- <OButton
360
- text={t('DELIVERY_FAILED', 'Delivery Failed')}
361
- bgColor={theme.colors.danger100}
362
- borderColor={theme.colors.danger100}
363
- imgRightSrc={null}
364
- style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
365
- parentStyle={{ width: '45%' }}
366
- textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
367
- onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
368
- action: 'deliveryFailed',
369
- order: _ordersGrouped[k][0],
370
- ids: _ordersGrouped[k].map((o: any) => o.id),
371
- handleChangeOrderStatus
372
- })}
373
- />
369
+ {!isHideRejectButtons && (
370
+ <OButton
371
+ text={t('DELIVERY_FAILED', 'Delivery Failed')}
372
+ bgColor={theme.colors.danger100}
373
+ borderColor={theme.colors.danger100}
374
+ imgRightSrc={null}
375
+ style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
376
+ parentStyle={{ width: '45%' }}
377
+ textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
378
+ onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
379
+ action: 'deliveryFailed',
380
+ order: _ordersGrouped[k][0],
381
+ ids: _ordersGrouped[k].map((o: any) => o.id),
382
+ handleChangeOrderStatus
383
+ })}
384
+ />
385
+ )}
374
386
  <OButton
375
387
  text={t('DELIVERY_COMPLETE', 'Delivery complete')}
376
388
  bgColor={theme.colors.success100}
377
389
  borderColor={theme.colors.success100}
378
390
  imgRightSrc={null}
379
391
  style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
380
- parentStyle={{ width: '45%' }}
392
+ parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
381
393
  textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
382
394
  onClick={() => handleChangeOrderStatus(
383
395
  11,
@@ -52,7 +52,7 @@ const LoginFormUI = (props: LoginParams) => {
52
52
  } = props;
53
53
 
54
54
  const theme = useTheme()
55
- const [{ configs }] = useConfig()
55
+ const [{ configs }, { refreshConfigs }] = useConfig()
56
56
  const [ordering, { setOrdering }] = useApi();
57
57
  const [, { showToast }] = useToast();
58
58
  const [, t] = useLanguage();
@@ -347,13 +347,16 @@ const LoginFormUI = (props: LoginParams) => {
347
347
  project: projectName
348
348
  })
349
349
  }
350
- if (isDeviceLoginEnabled) {
351
- props.handleChangeTab('device_code')
352
- }
353
350
  }, 1500)
354
351
  return () => clearTimeout(projectInputTimeout);
355
352
  }, [projectName, isDeviceLoginEnabled])
356
353
 
354
+ useEffect(() => {
355
+ if (ordering?.project) {
356
+ refreshConfigs()
357
+ }
358
+ }, [ordering?.project])
359
+
357
360
  const logo = (
358
361
  <LogoWrapper>
359
362
  <OIcon src={theme.images.logos.logotype} style={styles.logo} />
@@ -99,6 +99,7 @@ import { Promotions } from './src/components/Promotions'
99
99
  import { PageBanner } from './src/components/PageBanner'
100
100
  import { MultiCart } from './src/components/MultiCart'
101
101
  import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
102
+ import { DatePickerUI } from './src/components/DatePicker'
102
103
 
103
104
  import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
104
105
 
@@ -263,7 +264,7 @@ export {
263
264
  Promotions,
264
265
  PageBanner,
265
266
  MyOrders,
266
- MultiCart,
267
+ MultiCart,
267
268
  ORDER_TYPES,
268
269
  USER_TYPE,
269
270
 
@@ -340,5 +341,8 @@ export {
340
341
  _retrieveStoreData,
341
342
  _setStoreData,
342
343
  _removeStoreData,
343
- _clearStoreData
344
+ _clearStoreData,
345
+
346
+ // Date Picker
347
+ DatePickerUI
344
348
  }
@@ -106,7 +106,6 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
106
106
  location={businessLocation.location}
107
107
  markerTitle={businessState?.business?.name}
108
108
  businessZones={businessState?.business?.zones}
109
- delta={30}
110
109
  />
111
110
  </WrapBusinessMap>
112
111
  )}
@@ -106,7 +106,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
106
106
  <SingleProductCard
107
107
  key={'prod_' + product.id + `_${i}`}
108
108
  isSoldOut={product.inventoried && !product.quantity}
109
- enableIntersection={!isFiltMode}
109
+ // enableIntersection={!isFiltMode}
110
110
  product={product}
111
111
  businessId={businessId}
112
112
  categoryState={categoryState}
@@ -135,7 +135,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
135
135
  key={'feat_' + product.id + `_${i}`}
136
136
  isSoldOut={product.inventoried && !product.quantity}
137
137
  product={product}
138
- enableIntersection={!isFiltMode}
138
+ // enableIntersection={!isFiltMode}
139
139
  businessId={businessId}
140
140
  categoryState={categoryState}
141
141
  onProductClick={onProductClick}
@@ -570,7 +570,9 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
570
570
  />
571
571
  </ProfessionalFilterWrapper>
572
572
  )}
573
- <PageBanner position='app_business_page' navigation={navigation} />
573
+ {businessState?.business?.id && (
574
+ <PageBanner position='app_business_page' businessId={businessState?.business?.id} navigation={navigation} />
575
+ )}
574
576
  <View
575
577
  style={{
576
578
  height: 8,
@@ -726,6 +728,8 @@ export const BusinessProductsListing = (props: BusinessProductsListingParams) =>
726
728
  const businessProductslistingProps = {
727
729
  ...props,
728
730
  isForceSearch: Platform.OS === 'ios',
731
+ isApp: true,
732
+ isFetchAllProducts: true,
729
733
  UIComponent: BusinessProductsListingUI
730
734
  }
731
735
  return (
@@ -0,0 +1,69 @@
1
+ import React from 'react'
2
+ import { ListWrapper } from './styles'
3
+ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
4
+ import { View } from 'react-native'
5
+
6
+ export const FlatListBusinessListFooter = (props : any) => {
7
+ const {
8
+ businessesList,
9
+ paginationProps,
10
+ isChewLayout
11
+ } = props
12
+ return (
13
+ <>
14
+ <ListWrapper style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
15
+ {(businessesList.loading || !businessesList?.fetched) && (
16
+ <>
17
+ {[
18
+ ...Array(
19
+ paginationProps.nextPageItems
20
+ ? paginationProps.nextPageItems
21
+ : 8,
22
+ ).keys(),
23
+ ].map((item, i) => (
24
+ <Placeholder
25
+ Animation={Fade}
26
+ key={i}
27
+ style={{ marginBottom: 20 }}>
28
+ <View style={{ width: '100%' }}>
29
+ <PlaceholderLine
30
+ height={200}
31
+ style={{ marginBottom: 20, borderRadius: 25 }}
32
+ />
33
+ <View style={{ paddingHorizontal: 10 }}>
34
+ <View
35
+ style={{
36
+ flexDirection: 'row',
37
+ justifyContent: 'space-between',
38
+ }}>
39
+ <PlaceholderLine
40
+ height={25}
41
+ width={40}
42
+ style={{ marginBottom: 10 }}
43
+ />
44
+ <PlaceholderLine
45
+ height={25}
46
+ width={20}
47
+ style={{ marginBottom: 10 }}
48
+ />
49
+ </View>
50
+ <PlaceholderLine
51
+ height={20}
52
+ width={30}
53
+ style={{ marginBottom: 10 }}
54
+ />
55
+ <PlaceholderLine
56
+ height={20}
57
+ width={80}
58
+ style={{ marginBottom: 10 }}
59
+ />
60
+ </View>
61
+ </View>
62
+ </Placeholder>
63
+ ))}
64
+ </>
65
+ )}
66
+ </ListWrapper>
67
+ </>
68
+ )
69
+ }