ordering-ui-react-native 0.21.49-test → 0.21.49-test-v2

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 (112) hide show
  1. package/package.json +2 -3
  2. package/themes/business/index.tsx +0 -5
  3. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  4. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  5. package/themes/business/src/components/MapView/index.tsx +6 -2
  6. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  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/OrdersListManager/index.tsx +7 -2
  12. package/themes/business/src/components/OrdersOption/index.tsx +4 -0
  13. package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
  14. package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
  15. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  16. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  17. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  18. package/themes/original/index.tsx +6 -2
  19. package/themes/original/src/components/AddressForm/index.tsx +2 -2
  20. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  21. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  22. package/themes/original/src/components/BusinessBasicInformation/index.tsx +2 -2
  23. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  24. package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
  25. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  26. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  27. package/themes/original/src/components/BusinessListingSearch/index.tsx +2 -3
  28. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  29. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -2
  30. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  31. package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
  32. package/themes/original/src/components/BusinessProductsListing/index.tsx +12 -8
  33. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  34. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  35. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  36. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  37. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  38. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  39. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  40. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +23 -403
  41. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  42. package/themes/original/src/components/Cart/index.tsx +15 -4
  43. package/themes/original/src/components/CartContent/index.tsx +59 -38
  44. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  45. package/themes/original/src/components/Checkout/index.tsx +47 -9
  46. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  47. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  48. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  49. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  50. package/themes/original/src/components/Favorite/index.tsx +1 -3
  51. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  52. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  53. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  54. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  55. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  56. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  57. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  58. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  59. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  60. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  61. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  62. package/themes/original/src/components/Home/index.tsx +1 -1
  63. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  64. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  65. package/themes/original/src/components/Messages/styles.tsx +1 -1
  66. package/themes/original/src/components/MomentOption/index.tsx +3 -3
  67. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  68. package/themes/original/src/components/MultiCheckout/index.tsx +140 -18
  69. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
  70. package/themes/original/src/components/MyOrders/index.tsx +5 -5
  71. package/themes/original/src/components/NavBar/index.tsx +0 -1
  72. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  73. package/themes/original/src/components/Notifications/index.tsx +2 -4
  74. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  75. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  76. package/themes/original/src/components/OrderDetails/index.tsx +709 -664
  77. package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
  78. package/themes/original/src/components/OrderProgress/index.tsx +2 -1
  79. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  80. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  81. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  82. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  83. package/themes/original/src/components/OrdersOption/index.tsx +1 -1
  84. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  85. package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
  86. package/themes/original/src/components/ProductForm/ActionButton.tsx +117 -0
  87. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  88. package/themes/original/src/components/ProductForm/index.tsx +52 -146
  89. package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
  90. package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
  91. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  92. package/themes/original/src/components/Promotions/index.tsx +2 -3
  93. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  94. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  95. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  96. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  97. package/themes/original/src/components/ServiceForm/index.tsx +1 -1
  98. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  99. package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
  100. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  101. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  102. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  103. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  104. package/themes/original/src/components/UserFormDetails/index.tsx +51 -4
  105. package/themes/original/src/components/UserProfile/index.tsx +1 -1
  106. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  107. package/themes/original/src/components/Wallets/index.tsx +1 -0
  108. package/themes/original/src/components/Wallets/styles.tsx +0 -1
  109. package/themes/original/src/components/shared/OModal.tsx +12 -14
  110. package/themes/original/src/layouts/Container.tsx +1 -1
  111. package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -106
  112. 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,
@@ -0,0 +1,171 @@
1
+ import React, { useState } from 'react'
2
+ import { useLanguage, useUtils, WebsocketStatus as WebsocketStatusController } from 'ordering-components/native'
3
+ import { TouchableOpacity, View, StyleSheet } from 'react-native'
4
+ import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
5
+ import { useTheme } from 'styled-components/native'
6
+ import RNRestart from 'react-native-restart'
7
+ import { OModal, OButton, OText, OIcon } from '../shared'
8
+
9
+ import {
10
+ Container,
11
+ ModalContainer,
12
+ ModalTitle,
13
+ StatusItemWrapper,
14
+ StatusText
15
+ } from './styles'
16
+
17
+ const SocketStatusUI = (props: any) => {
18
+ const {
19
+ socketStatus,
20
+ connectedDate
21
+ } = props
22
+
23
+ const theme = useTheme()
24
+ const [, t] = useLanguage()
25
+ const [{ parseDate }] = useUtils()
26
+ const [openModal, setOpenModal] = useState(false)
27
+
28
+ const styles = StyleSheet.create({
29
+ btnBackArrow: {
30
+ borderWidth: 0,
31
+ width: 32,
32
+ height: 32,
33
+ tintColor: theme.colors.textGray,
34
+ backgroundColor: theme.colors.clear,
35
+ borderColor: theme.colors.clear,
36
+ shadowColor: theme.colors.clear,
37
+ paddingLeft: 0,
38
+ paddingRight: 0,
39
+ marginBottom: 30,
40
+ marginTop: 30
41
+ },
42
+ })
43
+
44
+ const getStatusColor = (status: number) => {
45
+ switch (status) {
46
+ case 0:
47
+ return '#FF9922';
48
+ case 1:
49
+ return '#00D27A';
50
+ case 2:
51
+ return '#E63757';
52
+ default:
53
+ return '#FF9922';
54
+ }
55
+ }
56
+
57
+ return (
58
+ <Container>
59
+ <TouchableOpacity
60
+ style={{
61
+ flexDirection: 'row',
62
+ alignItems: 'center',
63
+ justifyContent: 'center',
64
+ backgroundColor: theme.colors.inputChat,
65
+ borderRadius: 7.6,
66
+ marginVertical: 10,
67
+ paddingVertical: 10,
68
+ paddingHorizontal: 15,
69
+ }}
70
+ activeOpacity={0.6}
71
+ onPress={() => setOpenModal(true)}
72
+ >
73
+ <OText
74
+ style={{ color: theme.colors.backArrow, fontSize: 16, marginBottom: 0, lineHeight: 16 }}
75
+ >
76
+ {t('CONNECTION_STATUS', 'Connection status')}
77
+ </OText>
78
+ <MaterialIcon
79
+ name='circle'
80
+ size={12}
81
+ color={getStatusColor(socketStatus)}
82
+ style={{ marginLeft: 8 }}
83
+ />
84
+ </TouchableOpacity>
85
+
86
+ <OModal
87
+ open={openModal}
88
+ onClose={() => setOpenModal(false)}
89
+ entireModal
90
+ customClose
91
+ >
92
+ <ModalContainer nestedScrollEnabled={true}>
93
+ <TouchableOpacity
94
+ onPress={() => setOpenModal(false)}
95
+ style={styles.btnBackArrow}
96
+ >
97
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
98
+ </TouchableOpacity>
99
+ <View>
100
+ <ModalTitle>{t('CONNECTION_STATUS', 'Connection status')}</ModalTitle>
101
+ <OText style={{ marginBottom: 20 }}>
102
+ {t('LAST_UPDATE', 'Last update')}: {parseDate(connectedDate)}
103
+ </OText>
104
+ <StatusItemWrapper>
105
+ <MaterialIcon
106
+ name='circle'
107
+ size={12}
108
+ color={getStatusColor(1)}
109
+ style={{ marginTop: 10, marginHorizontal: 8 }}
110
+ />
111
+ <View style={{ marginLeft: 16 }}>
112
+ <StatusText>{t('OK', 'Ok')}</StatusText>
113
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_OK', 'The websocket works normally.')}</OText>
114
+ </View>
115
+ </StatusItemWrapper>
116
+ <StatusItemWrapper>
117
+ <MaterialIcon
118
+ name='circle'
119
+ size={12}
120
+ color={getStatusColor(0)}
121
+ style={{ marginTop: 10, marginHorizontal: 8 }}
122
+ />
123
+ <View style={{ marginLeft: 16 }}>
124
+ <StatusText>{t('CONNECTING', 'Connecting')}</StatusText>
125
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_CONNECTING', 'The websocket is connecting.')}</OText>
126
+ </View>
127
+ </StatusItemWrapper>
128
+ <StatusItemWrapper>
129
+ <MaterialIcon
130
+ name='circle'
131
+ size={12}
132
+ color={getStatusColor(2)}
133
+ style={{ marginTop: 10, marginHorizontal: 8 }}
134
+ />
135
+ <View style={{ marginLeft: 16 }}>
136
+ <StatusText>{t('DISCONNECTED', 'Disconnected')}</StatusText>
137
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_DISCONNECTED', 'The server is slow, please reload.')}</OText>
138
+ </View>
139
+ </StatusItemWrapper>
140
+
141
+ <View style={{ flexDirection: 'row', marginTop: 50 }}>
142
+ <OButton
143
+ onClick={() => setOpenModal(false)}
144
+ bgColor={theme.colors.white}
145
+ borderColor={theme.colors.primary}
146
+ textStyle={{ color: theme.colors.primary }}
147
+ style={{ borderRadius: 8, height: 48 }}
148
+ text={t('CLOSE', 'Close')}
149
+ />
150
+ <OButton
151
+ onClick={() => RNRestart.Restart()}
152
+ borderColor={theme.colors.primary}
153
+ textStyle={{ color: theme.colors.white }}
154
+ style={{ borderRadius: 8, marginLeft: 16, height: 48 }}
155
+ text={t('UPDATE', 'Update')}
156
+ />
157
+ </View>
158
+ </View>
159
+ </ModalContainer>
160
+ </OModal>
161
+ </Container>
162
+ )
163
+ }
164
+
165
+ export const WebsocketStatus = (props: any) => {
166
+ const socketProps = {
167
+ ...props,
168
+ UIComponent: SocketStatusUI
169
+ }
170
+ return <WebsocketStatusController {...socketProps} />
171
+ }
@@ -0,0 +1,28 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const Container = styled.View`
4
+ display: flex;
5
+ flex-direction: column;
6
+ `
7
+ export const ModalContainer = styled.ScrollView`
8
+ padding: 0px 30px;
9
+ `
10
+ export const ModalTitle = styled.Text`
11
+ font-family: Poppins;
12
+ font-style: normal;
13
+ font-weight: bold;
14
+ font-size: 20px;
15
+ color: ${(props: any) => props.theme.colors.textGray};
16
+ margin-bottom: 10px;
17
+ `
18
+ export const StatusItemWrapper = styled.View`
19
+ flex-direction: row;
20
+ margin-bottom: 16px;
21
+ `
22
+ export const StatusText = styled.Text`
23
+ font-family: Poppins;
24
+ font-style: normal;
25
+ font-weight: 500;
26
+ font-size: 18px;
27
+ color: ${(props: any) => props.theme.colors.textGray};
28
+ `
@@ -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
  }
@@ -122,8 +122,8 @@ const AddressFormUI = (props: AddressFormParams) => {
122
122
  width: 16
123
123
  },
124
124
  wrapperNavbar: Platform.OS === 'ios'
125
- ? { paddingVertical: 0, paddingLeft: 40, paddingRight: 20 }
126
- : { paddingVertical: 10, paddingLeft: 40, paddingRight: 20 }
125
+ ? { paddingVertical: 0, paddingLeft: 20, paddingRight: 20 }
126
+ : { paddingVertical: 10, paddingLeft: 20, paddingRight: 20 }
127
127
  });
128
128
 
129
129
  const [, t] = useLanguage();
@@ -2,7 +2,7 @@ import styled from 'styled-components/native'
2
2
 
3
3
  export const AddressFormContainer = styled.View`
4
4
  flex: 1;
5
- padding: 0px 40px 20px;
5
+ padding: 0px 20px 20px;
6
6
  background-color: ${(props: any) => props.theme.colors.backgroundPage};
7
7
  justify-content: space-between;
8
8
  `
@@ -3,10 +3,10 @@ import styled from 'styled-components/native'
3
3
  export const Container = styled.ScrollView`
4
4
  position: relative;
5
5
  flex: 1;
6
- paddingLeft: 40px;
7
- paddingRight: 40px;
8
- margin-bottom: 40px;
9
- padding-top: 10px;
6
+ paddingLeft: 20px;
7
+ paddingRight: 20px;
8
+ margin-bottom: 40px;
9
+ padding-top: 10px;
10
10
  `
11
11
 
12
12
  export const AddressItem = styled.TouchableOpacity`
@@ -72,7 +72,7 @@ export const BusinessBasicInformation = (
72
72
  alignItems: 'flex-start'
73
73
  },
74
74
  businessInfo: {
75
- paddingHorizontal: 40,
75
+ paddingHorizontal: 20,
76
76
  paddingTop: isChewLayout ? 0 : 56,
77
77
  },
78
78
  bullet: {
@@ -95,7 +95,7 @@ export const BusinessBasicInformation = (
95
95
  width: '100%',
96
96
  top: 0,
97
97
  zIndex: 100,
98
- left: 40
98
+ left: 20
99
99
  },
100
100
  socialIcon: {
101
101
  borderRadius: 3,
@@ -11,7 +11,7 @@ export const BusinessHeader = styled.ImageBackground`
11
11
  `;
12
12
  export const BusinessLogo = styled.View`
13
13
  position: absolute;
14
- start: 40px;
14
+ start: 20px;
15
15
  top: -36px;
16
16
  z-index: 50;
17
17
  box-shadow: 0 0 2px ${Platform.OS == 'android' ? '#000000DD' : '#0000001A'};
@@ -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
  )}
@@ -17,7 +17,7 @@ export const MediaWrapper = styled.ScrollView`
17
17
  height: 127px;
18
18
  `
19
19
  export const InnerContent = styled.View`
20
- padding: 20px 40px;
20
+ padding: 20px;
21
21
  `
22
22
  export const WrapScheduleBlock = styled.View`
23
23
  margin: 20px 0;
@@ -36,4 +36,4 @@ export const DivideView = styled.View`
36
36
  height: 8px;
37
37
  background-color: ${(props: any) => props.theme.colors.backgroundGray100};
38
38
  margin-horizontal: -40px;
39
- `;
39
+ `;
@@ -23,7 +23,10 @@ export const BusinessItemAccordion = (props: any) => {
23
23
  handleClickCheckout,
24
24
  checkoutButtonDisabled,
25
25
  isMultiCheckout,
26
- isFromUpselling
26
+ isFromUpselling,
27
+ changeActiveState,
28
+ isActive,
29
+ isGiftCart
27
30
  } = props
28
31
 
29
32
  const [orderState] = useOrder();
@@ -38,14 +41,13 @@ export const BusinessItemAccordion = (props: any) => {
38
41
  const isProducts = cart?.products?.length
39
42
  const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
40
43
 
41
- const [isActive, setActiveState] = useState(!!singleBusiness)
42
44
  const [viewedCart, setViewedCart] = useState<any>(null)
43
45
 
44
46
  useEffect(() => {
45
47
  const cartsArray = Object.values(orderState?.carts)
46
48
  const cartsLength = cartsArray.filter((cart: any) => cart.products.length > 0).length ?? 0
47
49
  if (cartsLength === 1) {
48
- setActiveState(!isClosed)
50
+ changeActiveState(!isClosed, cart?.uuid)
49
51
  }
50
52
  }, [orderState?.carts, isClosed])
51
53
 
@@ -68,14 +70,14 @@ export const BusinessItemAccordion = (props: any) => {
68
70
  <BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
69
71
  <BIHeader
70
72
  isClosed={isClosed}
71
- onPress={() => !isClosed ? setActiveState(!isActive) : isClosed}
73
+ onPress={() => !isClosed ? changeActiveState(!isClosed, cart?.uuid) : isClosed}
72
74
  activeOpacity={1}
73
75
  >
74
76
  <BIInfo>
75
77
  <BIContentInfo>
76
78
  <OText size={16} lineHeight={24} weight={'600'}>{cart?.business?.name}</OText>
77
79
  <View style={{ flexDirection: 'row' }}>
78
- {props.onNavigationRedirect && !isClosed && (
80
+ {props.onNavigationRedirect && !isClosed && !isGiftCart && (
79
81
  <>
80
82
  <TouchableOpacity onPress={() => props.onNavigationRedirect('Business', { store: cart?.business?.slug })}>
81
83
  <OText color={theme.colors.primary} size={12} lineHeight={18} style={{ textDecorationLine: 'underline' }}>{t('GO_TO_STORE', 'Go to store')}</OText>
@@ -84,7 +86,9 @@ export const BusinessItemAccordion = (props: any) => {
84
86
  )}
85
87
  {!isCartPending && (
86
88
  <>
87
- <OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
89
+ {!isGiftCart && (
90
+ <OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
91
+ )}
88
92
  <OAlert
89
93
  title={t('DELETE_CART', 'Delete Cart')}
90
94
  message={t('QUESTION_DELETE_CART', 'Are you sure to you wants delete the selected cart')}
@@ -94,7 +98,7 @@ export const BusinessItemAccordion = (props: any) => {
94
98
  </OAlert>
95
99
  </>
96
100
  )}
97
- {isBusinessChangeEnabled && props.handleChangeStore && (
101
+ {isBusinessChangeEnabled && props.handleChangeStore && !isGiftCart && (
98
102
  <>
99
103
  <OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
100
104
  <TouchableOpacity