ordering-ui-react-native 0.15.24 → 0.15.26-release

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 (160) hide show
  1. package/package.json +5 -3
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessController/index.tsx +8 -2
  4. package/src/components/BusinessTypeFilter/index.tsx +12 -2
  5. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/Checkout/index.tsx +0 -1
  8. package/src/components/LanguageSelector/index.tsx +7 -2
  9. package/src/components/OrderDetails/index.tsx +2 -2
  10. package/src/components/PaymentOptions/index.tsx +9 -16
  11. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  12. package/src/components/SingleProductCard/index.tsx +16 -4
  13. package/src/components/StripeElementsForm/index.tsx +27 -48
  14. package/src/components/UserProfileForm/index.tsx +63 -6
  15. package/src/components/UserProfileForm/styles.tsx +8 -0
  16. package/src/components/VerifyPhone/styles.tsx +1 -2
  17. package/src/components/shared/OModal.tsx +1 -1
  18. package/src/config.json +0 -2
  19. package/src/hooks/useCountdownTimer.tsx +26 -0
  20. package/src/navigators/HomeNavigator.tsx +6 -0
  21. package/src/pages/BusinessProductsList.tsx +1 -0
  22. package/src/pages/BusinessesListing.tsx +1 -1
  23. package/src/pages/Checkout.tsx +1 -1
  24. package/src/pages/Sessions.tsx +22 -0
  25. package/src/types/index.tsx +5 -11
  26. package/src/utils/index.tsx +68 -1
  27. package/themes/business/index.tsx +2 -0
  28. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  29. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  30. package/themes/business/src/components/Chat/index.tsx +38 -86
  31. package/themes/business/src/components/Home/index.tsx +128 -55
  32. package/themes/business/src/components/Home/styles.tsx +8 -1
  33. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  34. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  35. package/themes/business/src/components/NewOrderNotification/index.tsx +61 -98
  36. package/themes/business/src/components/OrderDetails/Business.tsx +2 -1
  37. package/themes/business/src/components/OrderDetails/Delivery.tsx +32 -15
  38. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +151 -89
  39. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +91 -17
  40. package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
  41. package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
  42. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  43. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  44. package/themes/business/src/components/OrdersOption/index.tsx +54 -50
  45. package/themes/business/src/components/PreviousOrders/index.tsx +75 -22
  46. package/themes/business/src/components/shared/OModal.tsx +1 -1
  47. package/themes/business/src/types/index.tsx +5 -1
  48. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  50. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/kiosk/src/components/Cart/index.tsx +98 -24
  52. package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
  53. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  54. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  55. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  56. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  57. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  58. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  61. package/themes/kiosk/src/components/OrderDetails/index.tsx +136 -41
  62. package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
  63. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  64. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  65. package/themes/kiosk/src/components/ProductForm/index.tsx +174 -125
  66. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  67. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  68. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  69. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  70. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  71. package/themes/kiosk/src/types/index.d.ts +2 -0
  72. package/themes/original/index.tsx +178 -1
  73. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  74. package/themes/original/src/components/AddressList/index.tsx +56 -18
  75. package/themes/original/src/components/AppleLogin/index.tsx +117 -78
  76. package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
  77. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
  78. package/themes/original/src/components/BusinessController/index.tsx +52 -22
  79. package/themes/original/src/components/BusinessController/styles.tsx +22 -0
  80. package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
  81. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
  82. package/themes/original/src/components/BusinessListingSearch/index.tsx +121 -7
  83. package/themes/original/src/components/BusinessListingSearch/styles.tsx +14 -1
  84. package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
  85. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -122
  86. package/themes/original/src/components/BusinessProductsCategories/index.tsx +9 -7
  87. package/themes/original/src/components/BusinessProductsList/index.tsx +127 -20
  88. package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
  89. package/themes/original/src/components/BusinessProductsListing/index.tsx +92 -37
  90. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
  91. package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
  92. package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
  93. package/themes/original/src/components/BusinessesListing/index.tsx +51 -58
  94. package/themes/original/src/components/Cart/index.tsx +19 -15
  95. package/themes/original/src/components/CartContent/index.tsx +2 -2
  96. package/themes/original/src/components/Checkout/index.tsx +42 -27
  97. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  98. package/themes/original/src/components/GoogleMap/index.tsx +1 -0
  99. package/themes/original/src/components/Help/index.tsx +21 -4
  100. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +97 -89
  101. package/themes/original/src/components/Home/index.tsx +1 -1
  102. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  103. package/themes/original/src/components/LoginForm/Otp/index.tsx +90 -0
  104. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  105. package/themes/original/src/components/LoginForm/index.tsx +389 -156
  106. package/themes/original/src/components/LoginForm/styles.tsx +7 -4
  107. package/themes/original/src/components/LogoutButton/index.tsx +7 -1
  108. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  109. package/themes/original/src/components/Messages/index.tsx +34 -25
  110. package/themes/original/src/components/Messages/styles.tsx +1 -3
  111. package/themes/original/src/components/MomentOption/index.tsx +10 -1
  112. package/themes/original/src/components/MomentOption/styles.tsx +1 -1
  113. package/themes/original/src/components/OrderDetails/index.tsx +35 -28
  114. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  115. package/themes/original/src/components/OrderProgress/index.tsx +4 -4
  116. package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
  117. package/themes/original/src/components/OrderSummary/index.tsx +3 -3
  118. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
  119. package/themes/original/src/components/OrdersOption/index.tsx +25 -33
  120. package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
  121. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  122. package/themes/original/src/components/PaymentOptionWallet/index.tsx +22 -24
  123. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  124. package/themes/original/src/components/PaymentOptions/index.tsx +9 -19
  125. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  126. package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
  127. package/themes/original/src/components/ProductForm/index.tsx +76 -61
  128. package/themes/original/src/components/ProductForm/styles.tsx +2 -2
  129. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  130. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  131. package/themes/original/src/components/Promotions/index.tsx +250 -0
  132. package/themes/original/src/components/Promotions/styles.tsx +60 -0
  133. package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
  134. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  135. package/themes/original/src/components/Sessions/index.tsx +160 -0
  136. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  137. package/themes/original/src/components/SingleProductCard/index.tsx +47 -21
  138. package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
  139. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  140. package/themes/original/src/components/TaxInformation/index.tsx +10 -4
  141. package/themes/original/src/components/UpsellingProducts/index.tsx +87 -71
  142. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  143. package/themes/original/src/components/UserFormDetails/index.tsx +32 -31
  144. package/themes/original/src/components/UserProfile/index.tsx +62 -14
  145. package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
  146. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  147. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  148. package/themes/original/src/components/Wallets/index.tsx +76 -9
  149. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  150. package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
  151. package/themes/original/src/components/shared/OModal.tsx +1 -1
  152. package/themes/original/src/components/shared/index.tsx +2 -0
  153. package/themes/original/src/config/constants.tsx +6 -6
  154. package/themes/original/src/types/index.tsx +62 -5
  155. package/themes/original/src/utils/index.tsx +28 -2
  156. package/themes/single-business/src/components/AddressList/index.tsx +1 -1
  157. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
  158. package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
  159. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  160. package/src/components/StripeMethodForm/index.tsx +0 -168
@@ -12,11 +12,9 @@ export const FormSide = styled.View`
12
12
  margin: auto;
13
13
  `;
14
14
 
15
- export const OTabs = styled.View`
15
+ export const OTabs = styled.ScrollView`
16
16
  flex-direction: row;
17
17
  width: 100%;
18
- flex-wrap: wrap;
19
- justify-content: flex-start;
20
18
  margin-bottom: -1px;
21
19
  `;
22
20
 
@@ -36,7 +34,7 @@ export const LoginWith = styled.View`
36
34
  width: 100%;
37
35
  align-items: flex-start;
38
36
  border-bottom-width: 1px;
39
- border-bottom-color: ${(props: any) => props.theme.colors.border}
37
+ border-bottom-color: ${(props: any) => props.theme.colors.border};
40
38
  `;
41
39
 
42
40
  export const FormInput = styled.View`
@@ -80,3 +78,8 @@ export const LineSeparator = styled.View`
80
78
  export const SkeletonWrapper = styled.View`
81
79
  width: 90%;
82
80
  `
81
+ export const RecaptchaButton = styled.View`
82
+ flex-direction: row;
83
+ align-items: center;
84
+ margin-bottom: 10px;
85
+ `
@@ -3,14 +3,20 @@ import { TouchableOpacity } from 'react-native';
3
3
  import { LogoutAction } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { OIcon, OText } from '../shared';
6
+ import { _retrieveStoreData } from '../../providers/StoreUtil';
6
7
 
7
8
  const LogoutButtonUI = (props: any) => {
8
9
  const { handleLogoutClick, text, color, iconSize } = props
9
10
  const theme = useTheme();
10
11
 
12
+ const handleClick = async () => {
13
+ const data = await _retrieveStoreData('notification_state');
14
+ handleLogoutClick(data)
15
+ };
16
+
11
17
  return (
12
18
  <TouchableOpacity
13
- onPress={() => handleLogoutClick()}
19
+ onPress={() => handleClick()}
14
20
  style={{ flexDirection: 'row', alignItems: 'center' }}
15
21
  >
16
22
  <OIcon
@@ -36,7 +36,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
36
36
  loadOrders,
37
37
  setSelectedOrderId,
38
38
  setOrderList,
39
- setOpenMessges
39
+ setOpenMessges,
40
+ setRefreshOrders,
41
+ refreshOrders
40
42
  } = props
41
43
 
42
44
  const theme = useTheme();
@@ -99,6 +101,13 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
99
101
  setOrderList(orderList)
100
102
  }, [orderList, loading])
101
103
 
104
+ useEffect(() => {
105
+ if(refreshOrders){
106
+ loadOrders(false, false, false, true)
107
+ setRefreshOrders && setRefreshOrders(false)
108
+ }
109
+ }, [refreshOrders])
110
+
102
111
  return (
103
112
  <>
104
113
  {!loading && orders.length === 0 && (
@@ -39,7 +39,7 @@ const ORDER_STATUS: any = {
39
39
  23: 'ORDER_DRIVER_ON_WAY'
40
40
  }
41
41
 
42
- const filterSpecialStatus = ['prepared_in', 'delivered_in']
42
+ const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
43
43
 
44
44
 
45
45
  const MessagesUI = (props: MessagesParams) => {
@@ -332,30 +332,34 @@ const MessagesUI = (props: MessagesParams) => {
332
332
  )
333
333
  )
334
334
 
335
- const renderSend = (props: any) => (
336
- <Send
337
- {...props}
338
- disabled={(sendMessage?.loading || (message === '' && !image) || messages?.loading)}
339
- alwaysShowSend
340
- containerStyle={styles.containerSend}
341
- >
342
- <OIconButton
343
- onClick={onSubmit}
344
- style={{
345
- height: 44,
346
- width: 44,
347
- borderRadius: 7.6,
348
- opacity: (sendMessage?.loading || (message === '' && !image) || messages?.loading) ? 0.4 : 1,
349
- borderColor: theme.colors.primary,
350
- backgroundColor: theme.colors.primary,
351
- }}
352
- iconStyle={{ marginTop: 3, marginRight: 2 }}
353
- icon={theme.images.general.enter}
354
- disabled={(sendMessage?.loading || (message === '' && !image) || messages?.loading)}
355
- disabledColor={theme.colors.white}
356
- />
357
- </Send>
358
- )
335
+ const renderSend = (props: any) => {
336
+ const isDisabled = (sendMessage?.loading || (message === '' && !image) || messages?.loading)
337
+ return (
338
+ <Send
339
+ {...props}
340
+ disabled={isDisabled}
341
+ alwaysShowSend
342
+ containerStyle={styles.containerSend}
343
+ >
344
+ <OIconButton
345
+ onClick={onSubmit}
346
+ style={{
347
+ height: 44,
348
+ width: 44,
349
+ borderRadius: 7.6,
350
+ opacity: isDisabled ? 0.2 : 1,
351
+ borderColor: isDisabled ? theme.colors.secondary : theme.colors.primary,
352
+ backgroundColor: isDisabled ? theme.colors.secondary : theme.colors.primary,
353
+ }}
354
+ iconStyle={{ marginTop: 3, marginRight: 2 }}
355
+ icon={theme.images.general.enter}
356
+ iconColor={isDisabled ? '#000' : '#fff'}
357
+ disabled={isDisabled}
358
+ disabledColor={theme.colors.secondary}
359
+ />
360
+ </Send>
361
+ )
362
+ }
359
363
 
360
364
  const renderBubble = (props: any) => (
361
365
  <Bubble
@@ -536,6 +540,11 @@ const styles = StyleSheet.create({
536
540
 
537
541
  export const Messages = (props: MessagesParams) => {
538
542
  const [allMessages, setAllMessages] = useState(props.messages)
543
+
544
+ useEffect(() => {
545
+ setAllMessages(props.messages)
546
+ }, [props.messages])
547
+
539
548
  const MessagesProps = {
540
549
  ...props,
541
550
  UIComponent: MessagesUI,
@@ -1,7 +1,5 @@
1
-
2
1
  import styled, { css } from 'styled-components/native'
3
2
 
4
-
5
3
  export const Wrapper = styled.View`
6
4
  flex: 1;
7
5
  background-color: ${(props: any) => props.theme.colors.white};
@@ -39,4 +37,4 @@ export const MessageTypeItem = styled.View`
39
37
  ${({ active }: any) => active && css`
40
38
  background-color: ${(props: any) => props.theme.colors.whiteGray};
41
39
  `}
42
- `
40
+ `
@@ -4,6 +4,7 @@ import CalendarStrip from 'react-native-calendar-strip'
4
4
  import {
5
5
  useLanguage,
6
6
  useConfig,
7
+ useUtils,
7
8
  useOrder,
8
9
  MomentOption as MomentOptionController,
9
10
  } from 'ordering-components/native';
@@ -132,6 +133,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
132
133
 
133
134
  const [, t] = useLanguage();
134
135
  const [{ configs }] = useConfig();
136
+ const [{ parseTime }] = useUtils()
135
137
  const [orderState] = useOrder();
136
138
  const [optionSelected, setOptionSelected] = useState({
137
139
  isAsap: false,
@@ -143,6 +145,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
143
145
  });
144
146
  const { bottom } = useSafeAreaInsets();
145
147
 
148
+ const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
149
+
146
150
  const [selectedTime, setSelectedTime] = useState(null);
147
151
  const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
148
152
  const [selectDate, setSelectedDate] = useState<any>(null)
@@ -338,7 +342,12 @@ const MomentOptionUI = (props: MomentOptionParams) => {
338
342
  style={{
339
343
  lineHeight: 24
340
344
  }}
341
- >{time.startTime}</OText>
345
+ >{is12hours ? (
346
+ time.startTime.includes('12')
347
+ ? `${time.startTime}PM`
348
+ : parseTime(moment(time.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
349
+ ) : time.startTime
350
+ }</OText>
342
351
  </TimeItem>
343
352
  </TouchableOpacity>
344
353
  ))}
@@ -18,7 +18,7 @@ export const OrderTimeWrapper = styled.View`
18
18
 
19
19
  export const TimeListWrapper = styled.ScrollView`
20
20
  margin-top: 30px;
21
- max-height: 160px;
21
+ max-height: 210px;
22
22
  `
23
23
 
24
24
  export const TimeContentWrapper = styled.View`
@@ -40,7 +40,7 @@ import { OSRow } from '../OrderSummary/styles';
40
40
  import AntIcon from 'react-native-vector-icons/AntDesign'
41
41
  import { TaxInformation } from '../TaxInformation';
42
42
  import { Placeholder, PlaceholderLine } from 'rn-placeholder';
43
-
43
+ import NavBar from '../NavBar'
44
44
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
45
45
  const {
46
46
  navigation,
@@ -80,7 +80,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
80
80
  justifyContent: 'flex-start',
81
81
  paddingLeft: 0,
82
82
  height: 30,
83
- width: 40,
83
+ width: 30,
84
+ marginTop: Platform.OS === 'ios' ? 0 : 30
84
85
  },
85
86
  });
86
87
 
@@ -91,6 +92,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
91
92
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
92
93
 
93
94
  const { order, businessData } = props.order;
95
+ const mapValidStatuses = [9, 19, 23]
94
96
 
95
97
  const walletName: any = {
96
98
  cash: {
@@ -328,7 +330,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
328
330
  };
329
331
 
330
332
  const getIncludedTaxes = () => {
331
- if (order?.taxes?.length === 0) {
333
+ if (order?.taxes?.length === 0 || !order?.taxes) {
332
334
  return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
333
335
  } else {
334
336
  return order?.taxes.reduce((taxIncluded: number, tax: any) => {
@@ -397,6 +399,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
397
399
  'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png',
398
400
  },
399
401
  ];
402
+ const driverLocationString = typeof order?.driver?.location?.location === 'string' && order?.driver?.location?.location?.split(',').map((l: string) => l.replace(/[^-.0-9]/g, ''))
403
+ const parsedLocations = locations.map(location => typeof location?.location === 'string' ? {
404
+ ...location,
405
+ lat: parseFloat(location?.location?.split(',')[0].replace(/[^-.0-9]/g, '')),
406
+ lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
407
+ } : location)
400
408
 
401
409
  useEffect(() => {
402
410
  if (driverLocation) {
@@ -461,27 +469,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
461
469
  {order && Object.keys(order).length > 0 && (
462
470
  <>
463
471
  <Header>
464
- <OButton
465
- imgLeftSrc={theme.images.general.arrow_left}
466
- imgRightSrc={null}
467
- style={styles.btnBackArrow}
468
- onClick={() => handleArrowBack()}
469
- imgLeftStyle={{ tintColor: theme.colors.disabled }}
472
+ <NavBar
473
+ title={`${t('ORDER', 'Order')} #${order?.id}`}
474
+ titleAlign={'center'}
475
+ onActionLeft={handleArrowBack}
476
+ showCall={false}
477
+ btnStyle={{ paddingLeft: 0 }}
478
+ style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
479
+ titleWrapStyle={{ paddingHorizontal: 0 }}
480
+ titleStyle={{ marginRight: 0, marginLeft: 0 }}
481
+ subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
482
+ {order?.delivery_datetime_utc
483
+ ? parseDate(order?.delivery_datetime_utc)
484
+ : parseDate(order?.delivery_datetime, { utc: false })}
485
+ </OText>}
470
486
  />
471
487
  <OrderInfo>
472
488
  <OrderData>
473
- <OText
474
- size={20}
475
- lineHeight={30}
476
- weight={'600'}
477
- color={theme.colors.textNormal}>
478
- {t('ORDER', 'Order')} #{order?.id}
479
- </OText>
480
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
481
- {order?.delivery_datetime_utc
482
- ? parseDate(order?.delivery_datetime_utc)
483
- : parseDate(order?.delivery_datetime, { utc: false })}
484
- </OText>
485
489
  {
486
490
  (
487
491
  parseInt(order?.status) === 1 ||
@@ -672,11 +676,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
672
676
  )}
673
677
  {order?.driver && (
674
678
  <>
675
- {order?.driver?.location && parseInt(order?.status) === 9 && (
679
+ {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
676
680
  <Map>
677
- <GoogleMap
678
- location={order?.driver?.location}
679
- locations={locations}
681
+ <GoogleMap
682
+ location={typeof order?.driver?.location?.location === 'string'
683
+ ? {
684
+ lat: parseFloat(driverLocationString[0]),
685
+ lng: parseFloat(driverLocationString[1]),
686
+ } : driverLocation ?? order?.driver?.location
687
+ }
688
+ locations={parsedLocations}
680
689
  readOnly
681
690
  />
682
691
  </Map>
@@ -890,7 +899,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
890
899
  <OSRow>
891
900
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
892
901
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
893
- ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
902
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
894
903
  </OText>
895
904
  <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
896
905
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
@@ -1017,8 +1026,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1017
1026
  open={openTaxModal.open}
1018
1027
  onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
1019
1028
  entireModal
1020
- title={`${openTaxModal.data?.name ||
1021
- t('INHERIT_FROM_BUSINESS', 'Inherit from business')} ${openTaxModal.data?.rate_type !== 2 ? `(${typeof openTaxModal.data?.rate === 'number' ? `${openTaxModal.data?.rate}%` : `${parsePrice(openTaxModal.data?.fixed ?? 0)} + ${openTaxModal.data?.percentage}%`})` : ''} `}
1022
1029
  >
1023
1030
  <TaxInformation
1024
1031
  type={openTaxModal.type}
@@ -5,7 +5,6 @@ export const OrderDetailsContainer = styled.ScrollView`
5
5
  `
6
6
 
7
7
  export const NavBack = styled.TouchableOpacity`
8
-
9
8
  `
10
9
 
11
10
 
@@ -127,4 +126,4 @@ export const Divider = styled.View`
127
126
  `
128
127
  export const OrderAction = styled.View`
129
128
  flex-direction: row;
130
- `
129
+ `
@@ -98,7 +98,7 @@ const OrderProgressUI = (props: any) => {
98
98
  { 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 },
99
99
  { 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
100
  { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35 },
101
- { 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
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45 }
102
102
  ]
103
103
 
104
104
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -131,7 +131,7 @@ const OrderProgressUI = (props: any) => {
131
131
 
132
132
  useEffect(() => {
133
133
  if (isFocused) {
134
- loadOrders()
134
+ loadOrders(false, false, false, true)
135
135
  }
136
136
  }, [isFocused])
137
137
 
@@ -188,7 +188,7 @@ const OrderProgressUI = (props: any) => {
188
188
  <ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
189
189
  </ProgressContentWrapper>
190
190
  <ProgressTextWrapper>
191
- <OText size={12}>{getOrderStatus(lastOrder.status)?.value}</OText>
191
+ <OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
192
192
  <TimeWrapper>
193
193
  <OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
194
194
  <OText size={11}>
@@ -218,7 +218,7 @@ export const OrderProgress = (props: any) => {
218
218
  const orderProgressProps = {
219
219
  ...props,
220
220
  UIComponent: OrderProgressUI,
221
- orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23],
221
+ orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
222
222
  useDefualtSessionManager: true,
223
223
  paginationSettings: {
224
224
  initialPage: 1,
@@ -20,6 +20,7 @@ export const ProgressTextWrapper = styled.View`
20
20
  flex-direction: row;
21
21
  justify-content: space-between;
22
22
  align-items: center;
23
+ width: 100%;
23
24
  `
24
25
 
25
26
  export const OrderInfoWrapper = styled.View`
@@ -71,7 +71,7 @@ const OrderSummaryUI = (props: any) => {
71
71
  }
72
72
 
73
73
  const getIncludedTaxes = () => {
74
- if (cart?.taxes === null) {
74
+ if (cart?.taxes === null || !cart?.taxes) {
75
75
  return cart.business.tax_type === 1 ? cart?.tax : 0
76
76
  } else {
77
77
  return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
@@ -112,7 +112,7 @@ const OrderSummaryUI = (props: any) => {
112
112
  {cart?.products?.length > 0 && (
113
113
  <>
114
114
  <OSProductList>
115
- {cart?.products.map((product: any) => (
115
+ {cart?.products?.map((product: any) => (
116
116
  <ProductItemAccordion
117
117
  key={product.code}
118
118
  product={product}
@@ -202,7 +202,7 @@ const OrderSummaryUI = (props: any) => {
202
202
  <OSRow>
203
203
  <OText size={12} numberOfLines={1}>
204
204
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
205
- ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
205
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
206
206
  </OText>
207
207
  <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })} >
208
208
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
@@ -19,7 +19,8 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
19
19
  typeSelected,
20
20
  defaultValue,
21
21
  configTypes,
22
- orderTypes
22
+ orderTypes,
23
+ setOrderTypeValue
23
24
  } = props
24
25
 
25
26
  const theme = useTheme();
@@ -39,6 +40,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
39
40
 
40
41
  const handleChangeOrderTypeCallback = (orderType: number) => {
41
42
  if (!orderState.loading) {
43
+ setOrderTypeValue && setOrderTypeValue(orderType)
42
44
  handleChangeOrderType(orderType)
43
45
  goToBack();
44
46
  }
@@ -51,7 +53,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
51
53
  btnStyle={{ paddingLeft: 0 }}
52
54
  paddingTop={0}
53
55
  style={{ paddingBottom: 0 }}
54
- title={t('HOW_WILL_YOUR_ORDER_TYPE', 'How will your order type?')}
56
+ title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
55
57
  titleAlign={'center'}
56
58
  titleStyle={{ fontSize: 14 }}
57
59
  />
@@ -2,12 +2,12 @@ import React, { useState, useEffect } from 'react'
2
2
  import { OrderList, useLanguage, useOrder, ToastType, useToast } from 'ordering-components/native'
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import { useFocusEffect } from '@react-navigation/native'
5
- import { OText, OButton } from '../shared'
5
+ import { OText } from '../shared'
6
6
  import { NotFoundSource } from '../NotFoundSource'
7
7
  import { ActiveOrders } from '../ActiveOrders'
8
8
  import { PreviousOrders } from '../PreviousOrders'
9
9
 
10
- import { OptionTitle, NoOrdersWrapper } from './styles'
10
+ import { OptionTitle } from './styles'
11
11
  import { OrdersOptionParams } from '../../types'
12
12
 
13
13
  import {
@@ -33,7 +33,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
33
33
  loadMoreOrders,
34
34
  loadOrders,
35
35
  setOrdersLength,
36
- ordersLength
36
+ ordersLength,
37
+ refreshOrders,
38
+ setRefreshOrders
37
39
  } = props
38
40
 
39
41
  const theme = useTheme();
@@ -95,7 +97,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
95
97
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
96
98
  { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
97
99
  { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
98
- { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
100
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
99
101
  ]
100
102
 
101
103
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -105,9 +107,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
105
107
 
106
108
  useFocusEffect(
107
109
  React.useCallback(() => {
108
- loadOrders()
110
+ loadOrders(false, false, false, true)
109
111
  }, [navigation])
110
- )
112
+ )
111
113
 
112
114
  useEffect(() => {
113
115
  const hasMore = pagination?.totalPages && pagination?.currentPage !== pagination?.totalPages
@@ -128,23 +130,16 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
128
130
  }
129
131
  }, [orders, activeOrders])
130
132
 
133
+ useEffect(() => {
134
+ if(refreshOrders){
135
+ loadOrders(false, false, false, true)
136
+ setRefreshOrders && setRefreshOrders(false)
137
+ }
138
+ }, [refreshOrders])
139
+
131
140
  return (
132
141
  <>
133
- {!loading && ordersLength.activeOrdersLength === 0 && ordersLength.previousOrdersLength === 0 && !activeOrders && (
134
- <NoOrdersWrapper>
135
- <OText size={14} numberOfLines={1}>
136
- {t('YOU_DONT_HAVE_ORDERS', 'You don\'t have any orders')}
137
- </OText>
138
- <OButton
139
- text={t('ORDER_NOW', 'Order now')}
140
- onClick={() => onNavigationRedirect && onNavigationRedirect('BusinessList')}
141
- textStyle={{ color: 'white', fontSize: 14 }}
142
- style={{ borderRadius: 7.6, marginBottom: 10, marginTop: 10, height: 44, paddingLeft: 10, paddingRight: 10 }}
143
- />
144
-
145
- </NoOrdersWrapper>
146
- )}
147
- {(ordersLength.activeOrdersLength > 0 || ordersLength.previousOrdersLength > 0) && (
142
+ {(orders.length > 0) && (
148
143
  <>
149
144
  <OptionTitle>
150
145
  <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10} >
@@ -155,18 +150,15 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
155
150
  : t('PAST', 'Past'))}
156
151
  </OText>
157
152
  </OptionTitle>
158
- {!(ordersLength.activeOrdersLength === 0 && ordersLength.previousOrdersLength === 0) &&
159
- !loading &&
160
- orders.filter((order: any) => orderStatus.includes(order.status)).length === 0 &&
161
- (
162
- <NotFoundSource
163
- content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
164
- image={imageFails}
165
- conditioned
166
- />
167
- )}
168
153
  </>
169
154
  )}
155
+ {!loading && orders.length === 0 && (
156
+ <NotFoundSource
157
+ content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
158
+ image={imageFails}
159
+ conditioned
160
+ />
161
+ )}
170
162
  {loading && (
171
163
  <>
172
164
  {!activeOrders ? (
@@ -239,8 +231,8 @@ export const OrdersOption = (props: OrdersOptionParams) => {
239
231
  ...props,
240
232
  UIComponent: OrdersOptionUI,
241
233
  orderStatus: props.preOrders ? [13] : props.activeOrders
242
- ? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21, 22, 23]
243
- : [1, 2, 5, 6, 10, 11, 12, 16, 17],
234
+ ? [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
235
+ : [1, 2, 5, 6, 10, 11, 12, 15, 16, 17],
244
236
  useDefualtSessionManager: true,
245
237
  }
246
238
 
@@ -3,9 +3,3 @@ import styled from 'styled-components/native'
3
3
  export const OptionTitle = styled.View`
4
4
  margin-top: 24px;
5
5
  `
6
-
7
- export const NoOrdersWrapper = styled.View`
8
- flex-direction: column;
9
- align-items: center;
10
- margin-top: 50px;
11
- `
@@ -23,8 +23,8 @@ export const PaymentOptionCash = (props: any) => {
23
23
  borderRadius: 7.6,
24
24
  marginTop: 10,
25
25
  width: '100%',
26
- height: 44,
27
- maxHeight: 44
26
+ height: 50,
27
+ maxHeight: 50
28
28
  },
29
29
  errorMsg: {
30
30
  marginTop: 10,