ordering-ui-react-native 0.16.70 → 0.16.71-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 (202) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +10 -10
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +2 -1
  9. package/src/components/LanguageSelector/index.tsx +21 -16
  10. package/src/components/Messages/index.tsx +2 -2
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptions/index.tsx +298 -345
  13. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  14. package/src/components/SingleProductReview/index.tsx +7 -4
  15. package/src/components/StripeElementsForm/index.tsx +25 -16
  16. package/src/components/VerifyPhone/styles.tsx +1 -2
  17. package/src/components/shared/OToast.tsx +4 -4
  18. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  19. package/src/utils/index.tsx +2 -1
  20. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  21. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  22. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  23. package/themes/business/src/components/Chat/index.tsx +31 -31
  24. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  25. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  26. package/themes/business/src/components/MapView/index.tsx +14 -3
  27. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  28. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  31. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  32. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  33. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  34. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  35. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  36. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  37. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  38. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  40. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  41. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  42. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  43. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  44. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  45. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  46. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  47. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  48. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  49. package/themes/business/src/components/shared/OLink.tsx +33 -13
  50. package/themes/business/src/components/shared/OText.tsx +8 -2
  51. package/themes/business/src/types/index.tsx +14 -3
  52. package/themes/business/src/utils/index.tsx +10 -0
  53. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  55. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  57. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  59. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  60. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  61. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  62. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  63. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  64. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  65. package/themes/kiosk/src/types/index.d.ts +2 -0
  66. package/themes/original/index.tsx +6 -0
  67. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  68. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  69. package/themes/original/src/components/AddressList/index.tsx +18 -18
  70. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  71. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  72. package/themes/original/src/components/BusinessBasicInformation/index.tsx +49 -25
  73. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  74. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  75. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  76. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  77. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  78. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  79. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
  81. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  82. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  83. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -479
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  88. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +93 -99
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  92. package/themes/original/src/components/BusinessesListing/index.tsx +8 -8
  93. package/themes/original/src/components/Cart/index.tsx +75 -42
  94. package/themes/original/src/components/CartContent/index.tsx +80 -18
  95. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  96. package/themes/original/src/components/Checkout/index.tsx +92 -105
  97. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  98. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  99. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  100. package/themes/original/src/components/DriverTips/index.tsx +47 -37
  101. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  102. package/themes/original/src/components/Favorite/index.tsx +7 -4
  103. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  104. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  105. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  106. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  107. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  108. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  109. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  110. package/themes/original/src/components/Help/index.tsx +7 -7
  111. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  112. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  113. package/themes/original/src/components/HelpGuide/index.tsx +12 -11
  114. package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
  115. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  116. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  117. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  118. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  119. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  120. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  121. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  122. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  123. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  124. package/themes/original/src/components/Messages/index.tsx +35 -20
  125. package/themes/original/src/components/MomentOption/index.tsx +17 -11
  126. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  127. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  128. package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
  129. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  130. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  131. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  132. package/themes/original/src/components/MyOrders/index.tsx +86 -20
  133. package/themes/original/src/components/NavBar/index.tsx +7 -6
  134. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  135. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  136. package/themes/original/src/components/Notifications/index.tsx +144 -0
  137. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  138. package/themes/original/src/components/OrderDetails/index.tsx +100 -215
  139. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  140. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  141. package/themes/original/src/components/OrderProgress/index.tsx +79 -100
  142. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  143. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  144. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  147. package/themes/original/src/components/OrdersOption/index.tsx +97 -88
  148. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  149. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  150. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  151. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  152. package/themes/original/src/components/PlaceSpot/index.tsx +22 -8
  153. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  154. package/themes/original/src/components/ProductForm/index.tsx +212 -253
  155. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  156. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  157. package/themes/original/src/components/ProductOptionSubOption/index.tsx +17 -9
  158. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  159. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  160. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  161. package/themes/original/src/components/Promotions/index.tsx +234 -220
  162. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  163. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  164. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  165. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  166. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  167. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  168. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  169. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  170. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  171. package/themes/original/src/components/ServiceForm/index.tsx +328 -264
  172. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  173. package/themes/original/src/components/SingleOrderCard/index.tsx +129 -54
  174. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  175. package/themes/original/src/components/SingleProductCard/index.tsx +85 -82
  176. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
  177. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  178. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  179. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  180. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  181. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  182. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  183. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  184. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  185. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  186. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  187. package/themes/original/src/components/UserProfileForm/index.tsx +19 -28
  188. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  189. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  190. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  191. package/themes/original/src/components/Wallets/index.tsx +176 -164
  192. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  193. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  194. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  195. package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
  196. package/themes/original/src/components/shared/OButton.tsx +9 -4
  197. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  198. package/themes/original/src/components/shared/OInput.tsx +10 -1
  199. package/themes/original/src/layouts/Container.tsx +13 -9
  200. package/themes/original/src/types/index.tsx +35 -5
  201. package/themes/original/src/utils/index.tsx +305 -58
  202. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -10,7 +10,9 @@ export const OrdersOptionCityUI = (props: any) => {
10
10
  const {
11
11
  search,
12
12
  onSearch,
13
- allListValues
13
+ allListValues,
14
+ setOpenedSelect,
15
+ openedSelect
14
16
  } = props
15
17
 
16
18
  const theme = useTheme();
@@ -27,6 +29,14 @@ export const OrdersOptionCityUI = (props: any) => {
27
29
  setOptionsList(cities)
28
30
  }, [allListValues?.countries])
29
31
 
32
+ const handleClear = () => {
33
+ onSearch({ ...search, city: '' })
34
+ }
35
+
36
+ const handleOpenSelect = () => {
37
+ setOpenedSelect('city')
38
+ }
39
+
30
40
  return (
31
41
  <Container isIos={Platform.OS === 'ios'}>
32
42
  <ODropDown
@@ -38,6 +48,10 @@ export const OrdersOptionCityUI = (props: any) => {
38
48
  textcolor={theme.colors.unselectText}
39
49
  placeholder={t('SELECT_CITY', 'Select City')}
40
50
  dropViewMaxHeight={200}
51
+ handleClear={handleClear}
52
+ handleOpenSelect={handleOpenSelect}
53
+ openedSelect={openedSelect}
54
+ selectType='city'
41
55
  />
42
56
  </Container>
43
57
  );
@@ -3,12 +3,16 @@ import { useLanguage } from 'ordering-components/native';
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import { Container } from './styles';
5
5
  import ODropDownCalendar from '../shared/ODropDownCalendar';
6
- import { Platform } from 'react-native'
7
-
6
+ import { Button, Platform, Touchable, TouchableOpacity, View } from 'react-native'
7
+ import DoubleClick from 'react-native-double-tap'
8
+ import { OText } from '../shared';
9
+ import DoubleTap from 'react-native-double-tap';
8
10
  export const OrdersOptionDate = (props: any) => {
9
11
  const {
10
12
  search,
11
- onSearch
13
+ onSearch,
14
+ setOpenedSelect,
15
+ openedSelect
12
16
  } = props
13
17
 
14
18
  const theme = useTheme();
@@ -22,18 +26,23 @@ export const OrdersOptionDate = (props: any) => {
22
26
 
23
27
  const handleChangeOption = (option: any) => {
24
28
  if (option === 'calendar') {
25
- onSearch({...search, date: {...search.date, type: option}})
29
+ onSearch({ ...search, date: { ...search.date, type: option } })
26
30
  } else {
27
- onSearch({...search, date: {from: '', to: '', type: option}})
31
+ onSearch({ ...search, date: { from: '', to: '', type: option } })
28
32
  }
29
33
  }
30
34
 
31
35
  const handleChangeDate = (from: any, to: any) => {
32
- onSearch({...search, date: {...search.date, from: from, to: to}})
36
+ onSearch({ ...search, date: { ...search.date, from: from, to: to } })
37
+ }
38
+
39
+ const handleOpenSelect = () => {
40
+ setOpenedSelect('calendar')
33
41
  }
34
42
 
35
43
  return (
36
44
  <Container isIos={Platform.OS === 'ios'}>
45
+
37
46
  <ODropDownCalendar
38
47
  options={optionsList}
39
48
  defaultValue={search.date.type}
@@ -47,6 +56,10 @@ export const OrdersOptionDate = (props: any) => {
47
56
  rangeDate={search.date}
48
57
  handleChangeDate={handleChangeDate}
49
58
  isCalendarAlwaysVisible
59
+ handleClear={() => onSearch({ ...search, date: { from: '', to: '', type: '' } })}
60
+ handleOpenSelect={handleOpenSelect}
61
+ openedSelect={openedSelect}
62
+ selectType='calendar'
50
63
  />
51
64
  </Container>
52
65
  );
@@ -8,7 +8,9 @@ import { Platform } from 'react-native'
8
8
  export const OrdersOptionDelivery = (props: any) => {
9
9
  const {
10
10
  search,
11
- onSearch
11
+ onSearch,
12
+ setOpenedSelect,
13
+ openedSelect
12
14
  } = props
13
15
 
14
16
  const theme = useTheme();
@@ -18,6 +20,14 @@ export const OrdersOptionDelivery = (props: any) => {
18
20
  { value: '2', content: t('PICKUP', 'Pickup') }
19
21
  ]
20
22
 
23
+ const handleClear = () => {
24
+ onSearch({ ...search, delivery_type: '' })
25
+ }
26
+
27
+ const handleOpenSelect = () => {
28
+ setOpenedSelect('delivery_type')
29
+ }
30
+
21
31
  return (
22
32
  <Container isIos={Platform.OS === 'ios'}>
23
33
  <ODropDown
@@ -29,6 +39,10 @@ export const OrdersOptionDelivery = (props: any) => {
29
39
  textcolor={theme.colors.unselectText}
30
40
  placeholder={t('SELECT_DELIVERY_TYPE', 'Select Delivery type')}
31
41
  dropViewMaxHeight={200}
42
+ handleClear={handleClear}
43
+ handleOpenSelect={handleOpenSelect}
44
+ openedSelect={openedSelect}
45
+ selectType='delivery_type'
32
46
  />
33
47
  </Container>
34
48
  );
@@ -9,7 +9,9 @@ export const OrdersOptionDriverUI = (props: any) => {
9
9
  const {
10
10
  search,
11
11
  onSearch,
12
- driverList
12
+ driverList,
13
+ setOpenedSelect,
14
+ openedSelect
13
15
  } = props
14
16
 
15
17
  const theme = useTheme();
@@ -24,6 +26,14 @@ export const OrdersOptionDriverUI = (props: any) => {
24
26
  setOptionsList(drivers)
25
27
  }, [driverList?.drivers])
26
28
 
29
+ const handleClear = () => {
30
+ onSearch({ ...search, driver: '' })
31
+ }
32
+
33
+ const handleOpenSelect = () => {
34
+ setOpenedSelect('driver')
35
+ }
36
+
27
37
  return (
28
38
  <Container isIos={Platform.OS === 'ios'}>
29
39
  <ODropDown
@@ -35,6 +45,10 @@ export const OrdersOptionDriverUI = (props: any) => {
35
45
  textcolor={theme.colors.unselectText}
36
46
  placeholder={t('SELECT_DRIVER', 'Select Driver')}
37
47
  dropViewMaxHeight={165}
48
+ handleClear={handleClear}
49
+ handleOpenSelect={handleOpenSelect}
50
+ openedSelect={openedSelect}
51
+ selectType='driver'
38
52
  />
39
53
  </Container>
40
54
  );
@@ -9,7 +9,9 @@ export const OrdersOptionPaymethodUI = (props: any) => {
9
9
  const {
10
10
  search,
11
11
  onSearch,
12
- paymethodList
12
+ paymethodList,
13
+ setOpenedSelect,
14
+ openedSelect
13
15
  } = props
14
16
 
15
17
  const theme = useTheme();
@@ -24,6 +26,14 @@ export const OrdersOptionPaymethodUI = (props: any) => {
24
26
  setOptionsList(paymethods)
25
27
  }, [paymethodList?.paymethods])
26
28
 
29
+ const handleClear = () => {
30
+ onSearch({ ...search, paymethod: '' })
31
+ }
32
+
33
+ const handleOpenSelect = () => {
34
+ setOpenedSelect('paymethod')
35
+ }
36
+
27
37
  return (
28
38
  <Container isIos={Platform.OS === 'ios'}>
29
39
  <ODropDown
@@ -35,6 +45,10 @@ export const OrdersOptionPaymethodUI = (props: any) => {
35
45
  textcolor={theme.colors.unselectText}
36
46
  placeholder={t('SELECT_PAYMETHOD', 'Select Paymethod')}
37
47
  dropViewMaxHeight={200}
48
+ handleClear={handleClear}
49
+ handleOpenSelect={handleOpenSelect}
50
+ openedSelect={openedSelect}
51
+ selectType='paymethod'
38
52
  />
39
53
  </Container>
40
54
  );
@@ -11,7 +11,9 @@ export const OrdersOptionStatus = (props: any) => {
11
11
  tabs,
12
12
  orderStatus,
13
13
  search,
14
- onSearch
14
+ onSearch,
15
+ setOpenedSelect,
16
+ openedSelect
15
17
  } = props
16
18
 
17
19
  const theme = useTheme();
@@ -29,6 +31,10 @@ export const OrdersOptionStatus = (props: any) => {
29
31
  setOptionsList(_optionList)
30
32
  }, [currentTabSelected, tabs, orderStatus])
31
33
 
34
+ const handleOpenSelect = () => {
35
+ setOpenedSelect('state')
36
+ }
37
+
32
38
  return (
33
39
  <Container isIos={Platform.OS === 'ios'}>
34
40
  <ODropDown
@@ -40,6 +46,9 @@ export const OrdersOptionStatus = (props: any) => {
40
46
  textcolor={theme.colors.unselectText}
41
47
  placeholder={t('SELECT_STATUS', 'Select Status')}
42
48
  dropViewMaxHeight={200}
49
+ handleOpenSelect={handleOpenSelect}
50
+ openedSelect={openedSelect}
51
+ selectType='state'
43
52
  />
44
53
  </Container>
45
54
  );
@@ -176,17 +176,17 @@ 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',
179
+ {
180
+ key: 22,
181
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
182
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
183
183
  percentage: 35
184
184
  },
185
- {
186
- key: 23,
187
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
188
- slug: 'ORDER_DRIVER_ON_WAY',
189
- percentage: 45
185
+ {
186
+ key: 23,
187
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
188
+ slug: 'ORDER_DRIVER_ON_WAY',
189
+ percentage: 45
190
190
  }
191
191
  ];
192
192
 
@@ -230,6 +230,7 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
230
230
  fontWeight: '600',
231
231
  fontSize: 16,
232
232
  color: theme.colors.textGray,
233
+ width: '85%'
233
234
  },
234
235
  badge: {
235
236
  marginBottom: 6,
@@ -265,15 +266,13 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
265
266
  style={styles.cardButton}
266
267
  activeOpacity={1}>
267
268
  <Card key={order?.id}>
268
- {!!order?.business?.logo && (
269
- <Logo style={styles.logo}>
270
- <OIcon
271
- url={optimizeImage(order?.business?.logo, 'h_300,c_limit')}
272
- style={styles.icon}
273
- />
274
- </Logo>
275
- )}
276
-
269
+ <Logo style={styles.logo}>
270
+ <OIcon
271
+ url={optimizeImage(order?.business?.logo, 'h_300,c_limit')}
272
+ src={!order?.business?.logo && theme?.images?.dummies?.businessLogo}
273
+ style={styles.icon}
274
+ />
275
+ </Logo>
277
276
  <Information>
278
277
  <Header>
279
278
  <OText numberOfLines={1} style={styles.title}>
@@ -0,0 +1,250 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Platform, PlatformIOSStatic, StyleSheet, TouchableOpacity, View } from 'react-native';
3
+ import DeviceInfo from 'react-native-device-info';
4
+ import { useTheme } from 'styled-components/native';
5
+ import { useLanguage, useUtils, useConfig } from 'ordering-components/native';
6
+ import EntypoIcon from 'react-native-vector-icons/Entypo'
7
+ import FastImage from 'react-native-fast-image'
8
+ import moment from 'moment'
9
+
10
+ import {
11
+ Card,
12
+ Logo,
13
+ Information,
14
+ MyOrderOptions,
15
+ NotificationIcon,
16
+ Timestatus
17
+ } from './styles'
18
+
19
+ import { OText } from '../shared';
20
+ import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
21
+
22
+ const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
23
+
24
+ export const OrderItem = (props: any) => {
25
+ const {
26
+ order,
27
+ _order,
28
+ isLogisticOrder,
29
+ currentTabSelected,
30
+ getOrderStatus,
31
+ handlePressOrder
32
+ } = props
33
+
34
+ const theme = useTheme()
35
+ const [, t] = useLanguage()
36
+ const [configState] = useConfig()
37
+ const [{ parseDate, optimizeImage }] = useUtils();
38
+ const [orientationState] = useDeviceOrientation();
39
+
40
+ const [allowColumns, setAllowColumns] = useState({
41
+ timer: configState?.configs?.order_deadlines_enabled?.value === '1',
42
+ slaBar: configState?.configs?.order_deadlines_enabled?.value === '1',
43
+ })
44
+
45
+ const IS_PORTRAIT = orientationState.orientation === PORTRAIT
46
+ const platformIOS = Platform as PlatformIOSStatic
47
+
48
+ const isIpad = platformIOS.isPad
49
+ const isTablet = DeviceInfo.isTablet();
50
+
51
+ const styles = StyleSheet.create({
52
+ cardButton: {
53
+ flex: 1,
54
+ paddingVertical: (isIpad || isTablet) ? 20 : 0,
55
+ marginBottom: IS_PORTRAIT ? 25 : 0,
56
+ marginLeft: 3,
57
+ },
58
+ icon: {
59
+ borderRadius: 7.6,
60
+ width: 60,
61
+ height: 60
62
+ },
63
+ logo: {
64
+ borderRadius: 10,
65
+ shadowColor: "#0000006e",
66
+ shadowRadius: 10,
67
+ elevation: 15,
68
+ justifyContent: 'center',
69
+ alignItems: 'center',
70
+ marginLeft: 3,
71
+ },
72
+ title: {
73
+ marginBottom: 6,
74
+ fontFamily: 'Poppins',
75
+ fontStyle: 'normal',
76
+ fontWeight: '600',
77
+ fontSize: 16,
78
+ color: theme.colors.textGray,
79
+ },
80
+ date: {
81
+ marginBottom: 6,
82
+ fontFamily: 'Poppins',
83
+ fontStyle: 'normal',
84
+ fontWeight: 'normal',
85
+ fontSize: 12,
86
+ },
87
+ orderType: {
88
+ fontSize: 12,
89
+ fontFamily: 'Poppins',
90
+ fontStyle: 'normal',
91
+ fontWeight: 'normal',
92
+ color: theme.colors.orderTypeColor,
93
+ },
94
+ });
95
+
96
+ const getDelayMinutes = (order: any) => {
97
+ const offset = 300
98
+ const cdtToutc = moment(order?.delivery_datetime).add(offset, 'minutes').format('YYYY-MM-DD HH:mm:ss')
99
+ const _delivery = order?.delivery_datetime_utc
100
+ ? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
101
+ : parseDate(cdtToutc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
102
+ const _eta = order?.eta_time
103
+ const diffTimeAsSeconds = moment(_delivery, 'YYYY-MM-DD hh:mm A').add(_eta, 'minutes').diff(moment().utc(), 'seconds')
104
+ return Math.ceil(diffTimeAsSeconds / 60)
105
+ }
106
+
107
+ const displayDelayedTime = (order: any) => {
108
+ let tagetedMin = getDelayMinutes(order)
109
+ // get day, hour and minutes
110
+ const sign = tagetedMin >= 0 ? '' : '- '
111
+ tagetedMin = Math.abs(tagetedMin)
112
+ let day: string | number = Math.floor(tagetedMin / 1440)
113
+ const restMinOfTargetedMin = tagetedMin - 1440 * day
114
+ let restHours: string | number = Math.floor(restMinOfTargetedMin / 60)
115
+ let restMins: string | number = restMinOfTargetedMin - 60 * restHours
116
+ // make standard time format
117
+ day = day === 0 ? '' : day + 'day '
118
+ restHours = restHours < 10 ? '0' + restHours : restHours
119
+ restMins = restMins < 10 ? '0' + restMins : restMins
120
+
121
+ const finalTaget = sign + day + restHours + ':' + restMins
122
+ return finalTaget
123
+ }
124
+
125
+ const getStatusClassName = (minutes: number) => {
126
+ if (isNaN(Number(minutes))) return 'in_time'
127
+ const delayTime = configState?.configs?.order_deadlines_delayed_time?.value
128
+ return minutes > 0 ? 'in_time' : Math.abs(minutes) <= delayTime ? 'at_risk' : 'delayed'
129
+ }
130
+
131
+ useEffect(() => {
132
+ const slaSettings = configState?.configs?.order_deadlines_enabled?.value === '1'
133
+ setAllowColumns({
134
+ ...allowColumns,
135
+ timer: slaSettings,
136
+ slaBar: slaSettings
137
+ })
138
+ }, [configState.loading])
139
+
140
+ return (
141
+ <TouchableOpacity
142
+ activeOpacity={1}
143
+ disabled={order?.locked && isLogisticOrder}
144
+ style={styles.cardButton}
145
+ onPress={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
146
+ >
147
+ <Card key={order.id}>
148
+ {allowColumns?.slaBar && (
149
+ <Timestatus
150
+ style={{
151
+ backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time'
152
+ ? '#00D27A'
153
+ : getStatusClassName(getDelayMinutes(order)) === 'at_risk'
154
+ ? '#FFC700'
155
+ : getStatusClassName(getDelayMinutes(order)) === 'delayed'
156
+ ? '#E63757'
157
+ : ''
158
+ }}
159
+ />
160
+ )}
161
+ <Logo style={styles.logo}>
162
+ <FastImage
163
+ style={styles.icon}
164
+ source={order.business?.logo ? {
165
+ uri: optimizeImage(order.business?.logo, 'h_100,c_limit'),
166
+ priority: FastImage.priority.normal,
167
+ } : theme?.images?.dummies?.businessLogo}
168
+ resizeMode={FastImage.resizeMode.cover}
169
+ />
170
+ </Logo>
171
+ <Information>
172
+ {!!order?.order_group_id && (
173
+ <OText>
174
+ <OText>{(t('INVOICE_GROUP_NO', 'Group No.') + order?.order_group_id)}</OText>
175
+ </OText>
176
+ )}
177
+ {!!order.business?.name && (
178
+ <OText numberOfLines={1} style={styles.title}>
179
+ {order.business?.name}
180
+ </OText>
181
+ )}
182
+ {!!order?.showNotification && (
183
+ <NotificationIcon>
184
+ <EntypoIcon
185
+ name="dot-single"
186
+ size={32}
187
+ color={theme.colors.primary}
188
+ />
189
+ </NotificationIcon>
190
+ )}
191
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
192
+ <OText
193
+ style={styles.date}
194
+ color={theme.colors.unselectText}
195
+ numberOfLines={1}
196
+ adjustsFontSizeToFit
197
+ >
198
+ {(order?.order_group_id && order?.order_group && isLogisticOrder
199
+ ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
200
+ : (t('NO', 'Order No.') + order.id)
201
+ ) + ' · '}
202
+ {order?.delivery_datetime_utc
203
+ ? parseDate(order?.delivery_datetime_utc, { outputFormat: 'MM/DD/YY · HH:mm a' })
204
+ : parseDate(order?.delivery_datetime, { utc: false })}
205
+ </OText>
206
+ {((currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && allowColumns?.timer) && (
207
+ <>
208
+ <OText> · </OText>
209
+ <OText
210
+ style={styles.date}
211
+ color={
212
+ getStatusClassName(getDelayMinutes(order)) === 'in_time'
213
+ ? '#00D27A'
214
+ : getStatusClassName(getDelayMinutes(order)) === 'at_risk'
215
+ ? '#FFC700'
216
+ : getStatusClassName(getDelayMinutes(order)) === 'delayed'
217
+ ? '#E63757'
218
+ : ''}
219
+ >
220
+ {displayDelayedTime(order)}
221
+ </OText>
222
+ </>
223
+ )}
224
+ </View>
225
+ {!isLogisticOrder && (
226
+ <MyOrderOptions>
227
+ <OText
228
+ style={styles.orderType}
229
+ mRight={5}
230
+ numberOfLines={1}
231
+ adjustsFontSizeToFit
232
+ >
233
+ {order.delivery_type === 1
234
+ ? t('DELIVERY', 'Delivery')
235
+ : order.delivery_type === 2
236
+ ? t('PICKUP', 'Pickup')
237
+ : order.delivery_type === 3
238
+ ? t('EAT_IN', 'Eat in')
239
+ : order.delivery_type === 4
240
+ ? t('CURBSIDE', 'Curbside')
241
+ : t('DRIVER_THRU', 'Driver thru')}
242
+ {` · ${getOrderStatus(order.status)}`}
243
+ </OText>
244
+ </MyOrderOptions>
245
+ )}
246
+ </Information>
247
+ </Card>
248
+ </TouchableOpacity>
249
+ )
250
+ }
@@ -0,0 +1,115 @@
1
+ import React, { useState } from 'react'
2
+ import { Animated, StyleSheet, View } from 'react-native'
3
+ import { useTheme } from 'styled-components/native';
4
+ import { useLanguage, useUtils } from 'ordering-components/native'
5
+ import FastImage from 'react-native-fast-image'
6
+ import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
7
+
8
+ import {
9
+ AccordionSection,
10
+ Accordion,
11
+ ContentInfo,
12
+ AccordionContent,
13
+ ProductOptionsList
14
+ } from './styles'
15
+
16
+ import { OText } from '../shared';
17
+
18
+ export const OrdersGroupedItem = (props: any) => {
19
+ const { groupId, orders } = props
20
+
21
+ const theme = useTheme()
22
+ const [, t] = useLanguage()
23
+ const [{ parseDate }] = useUtils();
24
+ const [isActive, setActiveState] = useState(false)
25
+
26
+ const styles = StyleSheet.create({
27
+ productImage: {
28
+ borderRadius: 7.6,
29
+ width: 60,
30
+ height: 60
31
+ },
32
+ logo: {
33
+ borderRadius: 10,
34
+ shadowColor: "#0000006e",
35
+ shadowRadius: 10,
36
+ elevation: 15,
37
+ justifyContent: 'center',
38
+ alignItems: 'center',
39
+ marginLeft: 3,
40
+ height: 65,
41
+ width: 65
42
+ },
43
+ title: {
44
+ marginBottom: 2,
45
+ fontWeight: '600',
46
+ fontSize: 16,
47
+ color: theme.colors.textGray,
48
+ },
49
+ orderlength: {
50
+ marginBottom: 2,
51
+ fontSize: 12,
52
+ },
53
+ })
54
+
55
+ return (
56
+ <AccordionSection>
57
+ <Accordion
58
+ activeOpacity={1}
59
+ onPress={() => setActiveState(!isActive)}
60
+ >
61
+ <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
62
+ <ContentInfo>
63
+ <View style={styles.logo}>
64
+ <FastImage
65
+ style={styles.productImage}
66
+ source={theme.images.general.ordersGroup}
67
+ resizeMode={FastImage.resizeMode.cover}
68
+ />
69
+ </View>
70
+ <View style={{ flex: 1, marginLeft: 5, flexDirection: 'column' }}>
71
+ <View>
72
+ <OText numberOfLines={1} style={styles.title}>
73
+ {t('GROUP_NRO', 'Group No.')}{groupId}
74
+ </OText>
75
+ </View>
76
+ <OText
77
+ style={styles.orderlength}
78
+ color={theme.colors.unselectText}
79
+ numberOfLines={1}
80
+ adjustsFontSizeToFit
81
+ >
82
+ {orders.length}{' '}{t('ORDERS', 'Orders')}
83
+ </OText>
84
+ <OText
85
+ style={styles.orderlength}
86
+ color={theme.colors.unselectText}
87
+ numberOfLines={1}
88
+ adjustsFontSizeToFit
89
+ >
90
+ {orders[0]?.delivery_datetime_utc
91
+ ? parseDate(orders[0]?.delivery_datetime_utc, { outputFormat: 'MM/DD/YY · HH:mm a' })
92
+ : parseDate(orders[0]?.delivery_datetime, { utc: false })}
93
+ </OText>
94
+ </View>
95
+ <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
96
+ <View style={{ flexDirection: 'row' }}>
97
+ <MaterialCommunityIcon name={isActive ? 'chevron-up' : 'chevron-down'} size={18} />
98
+ </View>
99
+ </View>
100
+ </ContentInfo>
101
+ </View>
102
+ </Accordion>
103
+
104
+ <View style={{ display: isActive ? 'flex' : 'none' }}>
105
+ <Animated.View>
106
+ <AccordionContent>
107
+ <ProductOptionsList>
108
+ {props.children}
109
+ </ProductOptionsList>
110
+ </AccordionContent>
111
+ </Animated.View>
112
+ </View>
113
+ </AccordionSection>
114
+ )
115
+ }