ordering-ui-react-native 0.21.2 → 0.21.3-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 (237) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  6. package/src/components/StripeMethodForm/index.tsx +3 -3
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +3 -2
  9. package/src/types/index.tsx +2 -1
  10. package/src/utils/index.tsx +2 -2
  11. package/themes/business/index.tsx +4 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  13. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  14. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  15. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  16. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  17. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  18. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  19. package/themes/business/src/components/Chat/index.tsx +41 -13
  20. package/themes/business/src/components/DriverMap/index.tsx +4 -2
  21. package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
  22. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  23. package/themes/business/src/components/Home/index.tsx +5 -1
  24. package/themes/business/src/components/MapView/index.tsx +11 -7
  25. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  26. package/themes/business/src/components/NewOrderNotification/index.tsx +161 -106
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +21 -12
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -55
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +36 -16
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  31. package/themes/business/src/components/OrderSummary/index.tsx +42 -23
  32. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  33. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  34. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  35. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  36. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +27 -35
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  42. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  44. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  45. package/themes/business/src/components/Sessions/index.tsx +187 -0
  46. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  47. package/themes/business/src/components/StoresList/index.tsx +5 -3
  48. package/themes/business/src/components/UserProfileForm/index.tsx +76 -41
  49. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  50. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  51. package/themes/business/src/components/shared/OInput.tsx +2 -0
  52. package/themes/business/src/hooks/useLocation.tsx +5 -4
  53. package/themes/business/src/types/index.tsx +19 -0
  54. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  55. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  56. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  57. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
  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/OrderTypeCardSelector/index.tsx +8 -10
  62. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  63. package/themes/original/index.tsx +9 -4
  64. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  65. package/themes/original/src/components/AddressForm/index.tsx +2 -2
  66. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  67. package/themes/original/src/components/AddressList/index.tsx +4 -7
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  69. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  70. package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  72. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  73. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  74. package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
  75. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  76. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  77. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  78. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  79. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  81. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  82. package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
  83. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +45 -21
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  88. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  96. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  97. package/themes/original/src/components/Cart/index.tsx +32 -9
  98. package/themes/original/src/components/CartContent/index.tsx +96 -58
  99. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  100. package/themes/original/src/components/Checkout/index.tsx +219 -66
  101. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  102. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  103. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  104. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  105. package/themes/original/src/components/Favorite/index.tsx +4 -9
  106. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  107. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  108. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  109. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  110. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  112. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  113. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  114. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  115. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  116. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  117. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  118. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  119. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  120. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  121. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  122. package/themes/original/src/components/GoogleMap/index.tsx +50 -5
  123. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  124. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  125. package/themes/original/src/components/Home/index.tsx +1 -1
  126. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  127. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
  129. package/themes/original/src/components/LoginForm/index.tsx +6 -1
  130. package/themes/original/src/components/Messages/index.tsx +9 -4
  131. package/themes/original/src/components/Messages/styles.tsx +1 -1
  132. package/themes/original/src/components/MomentOption/index.tsx +4 -4
  133. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  134. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  135. package/themes/original/src/components/MultiCheckout/index.tsx +251 -53
  136. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  137. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  138. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  139. package/themes/original/src/components/NavBar/index.tsx +3 -1
  140. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  141. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  142. package/themes/original/src/components/Notifications/index.tsx +4 -8
  143. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  144. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
  145. package/themes/original/src/components/OrderDetails/index.tsx +716 -667
  146. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  147. package/themes/original/src/components/OrderProgress/index.tsx +28 -9
  148. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  149. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  150. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  151. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  152. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  153. package/themes/original/src/components/OrdersOption/index.tsx +2 -1
  154. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  155. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  156. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  157. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  158. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  159. package/themes/original/src/components/PaymentOptions/index.tsx +67 -5
  160. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  161. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  162. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  163. package/themes/original/src/components/ProductForm/index.tsx +75 -166
  164. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  165. package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -8
  166. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  167. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +7 -4
  168. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  169. package/themes/original/src/components/Promotions/index.tsx +4 -4
  170. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  171. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  172. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  173. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  174. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  175. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  176. package/themes/original/src/components/SingleOrderCard/index.tsx +5 -4
  177. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  179. package/themes/original/src/components/StripeCardsList/index.tsx +16 -35
  180. package/themes/original/src/components/StripeElementsForm/index.tsx +9 -4
  181. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  182. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  183. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  184. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  185. package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
  186. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  187. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  188. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  189. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  190. package/themes/original/src/components/Wallets/index.tsx +8 -9
  191. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  192. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  193. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  194. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  195. package/themes/original/src/components/shared/OButton.tsx +5 -5
  196. package/themes/original/src/components/shared/OInput.tsx +1 -4
  197. package/themes/original/src/components/shared/OModal.tsx +12 -14
  198. package/themes/original/src/layouts/Container.tsx +5 -3
  199. package/themes/original/src/types/index.tsx +8 -2
  200. package/themes/original/src/utils/index.tsx +124 -0
  201. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  202. package/src/navigators/BottomNavigator.tsx +0 -117
  203. package/src/navigators/CheckoutNavigator.tsx +0 -66
  204. package/src/navigators/HomeNavigator.tsx +0 -202
  205. package/src/navigators/NavigationRef.tsx +0 -7
  206. package/src/navigators/RootNavigator.tsx +0 -269
  207. package/src/pages/Account.tsx +0 -34
  208. package/src/pages/AddressForm.tsx +0 -62
  209. package/src/pages/AddressList.tsx +0 -24
  210. package/src/pages/BusinessProductsList.tsx +0 -81
  211. package/src/pages/BusinessesListing.tsx +0 -43
  212. package/src/pages/CartList.tsx +0 -49
  213. package/src/pages/Checkout.tsx +0 -101
  214. package/src/pages/ForgotPassword.tsx +0 -24
  215. package/src/pages/Help.tsx +0 -23
  216. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  217. package/src/pages/HelpGuide.tsx +0 -23
  218. package/src/pages/HelpOrder.tsx +0 -23
  219. package/src/pages/Home.tsx +0 -36
  220. package/src/pages/IntroductoryTutorial.tsx +0 -170
  221. package/src/pages/Login.tsx +0 -47
  222. package/src/pages/MomentOption.tsx +0 -30
  223. package/src/pages/MultiCheckout.tsx +0 -31
  224. package/src/pages/MultiOrdersDetails.tsx +0 -27
  225. package/src/pages/MyOrders.tsx +0 -40
  226. package/src/pages/NetworkError.tsx +0 -24
  227. package/src/pages/NotFound.tsx +0 -22
  228. package/src/pages/OrderDetails.tsx +0 -25
  229. package/src/pages/ProductDetails.tsx +0 -55
  230. package/src/pages/Profile.tsx +0 -36
  231. package/src/pages/ReviewDriver.tsx +0 -30
  232. package/src/pages/ReviewOrder.tsx +0 -32
  233. package/src/pages/ReviewProducts.tsx +0 -30
  234. package/src/pages/Sessions.tsx +0 -22
  235. package/src/pages/Signup.tsx +0 -53
  236. package/src/pages/SpinnerLoader.tsx +0 -10
  237. package/src/pages/Splash.tsx +0 -21
@@ -0,0 +1,64 @@
1
+ import React, { useState } from 'react';
2
+ import { useLanguage } from 'ordering-components/native';
3
+ import { useTheme } from 'styled-components/native';
4
+ import { View } from 'react-native';
5
+ import { OText } from '../../shared'
6
+ import { VerticalGiftCardOrdersLayout } from '../VerticalGiftCardOrdersLayout'
7
+
8
+ import {
9
+ Container,
10
+ NoOrdersWrapper
11
+ } from './styles'
12
+
13
+ export const GiftCardOrdersList = (props: any) => {
14
+ const {
15
+ onNavigationRedirect
16
+ } = props;
17
+
18
+ const theme = useTheme();
19
+ const [, t] = useLanguage();
20
+ const [isEmptyPending, setIsEmptyPending] = useState(false);
21
+ const [isEmptySent, setIsEmptySent] = useState(false);
22
+ const [isEmptyRedeemed, setIsEmptyRedeemed] = useState(false);
23
+
24
+ return (
25
+ <Container>
26
+ <VerticalGiftCardOrdersLayout
27
+ title={t('PENDING', 'Pending')}
28
+ defaultStatus='pending'
29
+ setIsEmpty={setIsEmptyPending}
30
+ onNavigationRedirect={onNavigationRedirect}
31
+ />
32
+
33
+ {!isEmptyPending && (
34
+ <View
35
+ style={{
36
+ height: 8,
37
+ backgroundColor: theme.colors.backgroundGray100,
38
+ marginHorizontal: -40,
39
+ }}
40
+ />
41
+ )}
42
+
43
+ <VerticalGiftCardOrdersLayout
44
+ title={t('SENT', 'Sent')}
45
+ defaultStatus='sent'
46
+ setIsEmpty={setIsEmptySent}
47
+ onNavigationRedirect={onNavigationRedirect}
48
+ />
49
+
50
+ <VerticalGiftCardOrdersLayout
51
+ title={t('REDEEMED', 'Redeemed')}
52
+ defaultStatus='activated'
53
+ setIsEmpty={setIsEmptyRedeemed}
54
+ onNavigationRedirect={onNavigationRedirect}
55
+ />
56
+
57
+ {isEmptyPending && isEmptySent && isEmptyRedeemed && (
58
+ <NoOrdersWrapper>
59
+ <OText size={16} color={theme.colors.textNormal}>{t('YOU_DONT_HAVE_CARDS', 'You don\'t have cards')}</OText>
60
+ </NoOrdersWrapper>
61
+ )}
62
+ </Container>
63
+ )
64
+ }
@@ -0,0 +1,8 @@
1
+ import styled from 'styled-components/native';
2
+
3
+ export const Container = styled.View`
4
+ `
5
+
6
+ export const NoOrdersWrapper = styled.View`
7
+ margin-vertical: 20px;
8
+ `
@@ -56,7 +56,7 @@ export const GiftCardUI = React.memo((props: any) => {
56
56
  <View style={style.actionWrapper}>
57
57
  <OButton
58
58
  onClick={() => setOpenModal('purchase')}
59
- text={t('PURCHASE_GIFT_CARD', 'Purchase gift card')}
59
+ text={t('PURCHASE', 'Purchase')}
60
60
  bgColor={theme.colors.primary}
61
61
  borderColor={theme.colors.primary}
62
62
  textStyle={{ color: 'white', fontSize: 13 }}
@@ -66,7 +66,7 @@ export const GiftCardUI = React.memo((props: any) => {
66
66
 
67
67
  <OButton
68
68
  onClick={() => setOpenModal('redeem')}
69
- text={t('REDEEM_GIFT_CARD', 'Redeem gift card')}
69
+ text={t('REDEEM', 'Redeem')}
70
70
  bgColor={theme.colors.lightPrimary}
71
71
  borderColor={theme.colors.lightPrimary}
72
72
  textStyle={{ color: theme.colors.primary, fontSize: 13 }}
@@ -79,13 +79,18 @@ export const GiftCardUI = React.memo((props: any) => {
79
79
  open={openModal === 'purchase'}
80
80
  onClose={() => setOpenModal(null)}
81
81
  entireModal
82
+ customClose
82
83
  >
83
- <PurchaseGiftCard handleCustomGoToCheckout={handleCustomGoToCheckout} />
84
+ <PurchaseGiftCard
85
+ handleCustomGoToCheckout={handleCustomGoToCheckout}
86
+ onClose={() => setOpenModal(null)}
87
+ />
84
88
  </OModal>
85
89
  <OModal
86
90
  open={openModal === 'redeem'}
87
91
  onClose={() => setOpenModal(null)}
88
92
  entireModal
93
+ customClose
89
94
  >
90
95
  <RedeemGiftCard
91
96
  onClose={() => setOpenModal(null)}
@@ -3,10 +3,11 @@ import {
3
3
  useLanguage,
4
4
  PurchaseGiftCard as PurchaseGiftCardController
5
5
  } from 'ordering-components/native'
6
- import { StyleSheet, View, TouchableOpacity, ScrollView } from 'react-native'
6
+ import { StyleSheet, View, TouchableOpacity, ScrollView, Platform } from 'react-native'
7
7
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
8
8
  import { useTheme } from 'styled-components/native';
9
9
  import { OText, OButton, OIcon } from '../../shared';
10
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
10
11
 
11
12
  import {
12
13
  Container
@@ -17,7 +18,8 @@ const PurchaseGiftCardUI = (props: any) => {
17
18
  productsListState,
18
19
  selectedProduct,
19
20
  setSelectedProduct,
20
- handleAccept
21
+ handleAccept,
22
+ onClose
21
23
  } = props
22
24
 
23
25
  const theme = useTheme()
@@ -42,7 +44,38 @@ const PurchaseGiftCardUI = (props: any) => {
42
44
 
43
45
  return (
44
46
  <Container>
45
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</OText>
47
+ <View style={{
48
+ marginBottom: 40,
49
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
50
+ display: 'flex',
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ }}>
54
+ <OButton
55
+ imgLeftStyle={{ width: 18 }}
56
+ imgRightSrc={null}
57
+ style={{
58
+ borderWidth: 0,
59
+ width: 26,
60
+ height: 26,
61
+ backgroundColor: '#FFF',
62
+ borderColor: '#FFF',
63
+ shadowColor: '#FFF',
64
+ paddingLeft: 0,
65
+ paddingRight: 0,
66
+ }}
67
+ onClick={onClose}
68
+ icon={AntDesignIcon}
69
+ iconProps={{
70
+ name: 'arrowleft',
71
+ size: 26,
72
+ style: {
73
+ color: theme.colors.textNormal
74
+ }
75
+ }}
76
+ />
77
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</OText>
78
+ </View>
46
79
  <OText color={theme.colors.textNormal} size={14}>{t('SELECT_ONE_OPTION', 'Select one option')}</OText>
47
80
  <ScrollView
48
81
  contentContainerStyle={{
@@ -2,7 +2,7 @@ import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding-horizontal: 40px;
5
+ padding-horizontal: 20px;
6
6
  flex: 1;
7
7
  padding-bottom: 30px;
8
8
  `
@@ -3,9 +3,10 @@ import {
3
3
  useLanguage, useUtils, RedeemGiftCard as RedeemGiftCardController
4
4
  } from 'ordering-components/native'
5
5
  import { useForm, Controller } from 'react-hook-form'
6
- import { StyleSheet, View, Alert } from 'react-native';
6
+ import { StyleSheet, View, Alert, Platform } from 'react-native';
7
7
  import { useTheme } from 'styled-components/native';
8
8
  import { OText, OButton, OInput } from '../../shared';
9
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
9
10
 
10
11
  import {
11
12
  Container,
@@ -93,7 +94,38 @@ const RedeemGiftCardUI = (props: any) => {
93
94
  <Container>
94
95
  {!redeemedGiftCard ? (
95
96
  <View>
96
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
97
+ <View style={{
98
+ marginBottom: 40,
99
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
100
+ display: 'flex',
101
+ flexDirection: 'row',
102
+ alignItems: 'center',
103
+ }}>
104
+ <OButton
105
+ imgLeftStyle={{ width: 18 }}
106
+ imgRightSrc={null}
107
+ style={{
108
+ borderWidth: 0,
109
+ width: 26,
110
+ height: 26,
111
+ backgroundColor: '#FFF',
112
+ borderColor: '#FFF',
113
+ shadowColor: '#FFF',
114
+ paddingLeft: 0,
115
+ paddingRight: 0,
116
+ }}
117
+ onClick={onClose}
118
+ icon={AntDesignIcon}
119
+ iconProps={{
120
+ name: 'arrowleft',
121
+ size: 26,
122
+ style: {
123
+ color: theme.colors.textNormal
124
+ }
125
+ }}
126
+ />
127
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
128
+ </View>
97
129
  <FormController>
98
130
  <OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('GIFT_CARD_CODE', 'Gift card code')}</OText>
99
131
  <Controller
@@ -106,7 +138,7 @@ const RedeemGiftCardUI = (props: any) => {
106
138
  onChange(val)
107
139
  handleChangeCode(val)
108
140
  }}
109
- autoCapitalize='none'
141
+ autoCapitalize='characters'
110
142
  autoCorrect={false}
111
143
  blurOnSubmit={false}
112
144
  style={style.inputStyle}
@@ -156,7 +188,38 @@ const RedeemGiftCardUI = (props: any) => {
156
188
  </View>
157
189
  ) : (
158
190
  <>
159
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('GIFT_CARD', 'Gift card')}</OText>
191
+ <View style={{
192
+ marginBottom: 40,
193
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
194
+ display: 'flex',
195
+ flexDirection: 'row',
196
+ alignItems: 'center',
197
+ }}>
198
+ <OButton
199
+ imgLeftStyle={{ width: 18 }}
200
+ imgRightSrc={null}
201
+ style={{
202
+ borderWidth: 0,
203
+ width: 26,
204
+ height: 26,
205
+ backgroundColor: '#FFF',
206
+ borderColor: '#FFF',
207
+ shadowColor: '#FFF',
208
+ paddingLeft: 0,
209
+ paddingRight: 0,
210
+ }}
211
+ onClick={onClose}
212
+ icon={AntDesignIcon}
213
+ iconProps={{
214
+ name: 'arrowleft',
215
+ size: 26,
216
+ style: {
217
+ color: theme.colors.textNormal
218
+ }
219
+ }}
220
+ />
221
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('GIFT_CARD', 'Gift card')}</OText>
222
+ </View>
160
223
  <View>
161
224
  <OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</OText>
162
225
  <OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('AMOUNT', 'Amount')}: {parsePrice(redeemedGiftCard?.amount)}</OText>
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- padding-horizontal: 40px;
4
+ padding-horizontal: 20px;
5
5
  `
6
6
  export const FormController = styled.View`
7
7
  margin-bottom: 25px;
@@ -84,12 +84,12 @@ const SendGiftCardUI = (props: any) => {
84
84
  />
85
85
  </FormController>
86
86
  <FormController>
87
- <OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('FROM', 'From')}</OText>
87
+ <OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('NAME', 'Name')}</OText>
88
88
  <Controller
89
89
  control={control}
90
90
  render={({ onChange, value }: any) => (
91
91
  <OInput
92
- placeholder={t('WRITE_YOUR_NAME', 'Write your name')}
92
+ placeholder={t('WRITE_A_NAME', 'Write a name')}
93
93
  value={value}
94
94
  onChange={(val: any) => onChange(val)}
95
95
  autoCapitalize='none'
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- padding-horizontal: 40px;
4
+ padding-horizontal: 20px;
5
5
  margin-bottom: 30px;
6
6
  `
7
7
  export const FormController = styled.View`
@@ -0,0 +1,101 @@
1
+ import React from 'react';
2
+ import { useLanguage, useUtils, useEvent } from 'ordering-components/native';
3
+ import { useTheme } from 'styled-components/native';
4
+ import { View, StyleSheet } from 'react-native';
5
+ import {
6
+ Placeholder,
7
+ PlaceholderLine,
8
+ Fade
9
+ } from 'rn-placeholder';
10
+ import FastImage from 'react-native-fast-image';
11
+ import { OText } from '../../shared'
12
+
13
+ import {
14
+ CardContainer
15
+ } from './styles'
16
+
17
+ export const SingleGiftCard = (props: any) => {
18
+ const {
19
+ card,
20
+ isSkeleton,
21
+ onNavigationRedirect
22
+ } = props
23
+
24
+ const theme = useTheme()
25
+ const [, t] = useLanguage()
26
+ const [events] = useEvent()
27
+ const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
28
+
29
+ const styles = StyleSheet.create({
30
+ logo: {
31
+ borderRadius: 8,
32
+ width: 64,
33
+ height: 64
34
+ },
35
+ innerContainer: {
36
+ flexDirection: 'row',
37
+ marginBottom: 24
38
+ }
39
+ });
40
+
41
+ const getGiftCardStatus = (status: string) => {
42
+ switch (status) {
43
+ case 'pending':
44
+ return t('PENDING', 'Pending')
45
+ case 'activated':
46
+ return t('REDEEMED', 'Redeemed')
47
+ default:
48
+ return status
49
+ }
50
+ }
51
+
52
+ const handleClickGiftCardOrder = (card: any) => {
53
+ onNavigationRedirect?.('OrderDetails', { orderId: card.order_product?.order_id });
54
+ }
55
+
56
+ return (
57
+ <CardContainer
58
+ activeOpacity={0.8}
59
+ onPress={() => handleClickGiftCardOrder(card)}
60
+ >
61
+ {isSkeleton ? (
62
+ <Placeholder style={{ marginBottom: 10 }} Animation={Fade}>
63
+ <View style={{ flexDirection: 'row' }}>
64
+ <View style={{ width: 64, marginRight: 14 }}>
65
+ <PlaceholderLine
66
+ width={100}
67
+ height={64}
68
+ style={{ marginRight: 10, marginBottom: 10 }}
69
+ />
70
+ </View>
71
+ <Placeholder style={{ paddingTop: 5 }}>
72
+ <PlaceholderLine width={60} style={{ marginBottom: 6}} />
73
+ <PlaceholderLine width={40} style={{ marginBottom: 6 }} />
74
+ <PlaceholderLine width={20} style={{ marginBottom: 0 }} />
75
+ </Placeholder>
76
+ </View>
77
+ </Placeholder>
78
+ ) : (
79
+ <View style={styles.innerContainer}>
80
+ <View>
81
+ <FastImage
82
+ style={styles.logo}
83
+ source={card?.order_product?.images ? {
84
+ uri: optimizeImage(card?.order_product?.images, 'h_86,c_limit')
85
+ } : theme?.images?.dummies?.businessLogo}
86
+ resizeMode={FastImage.resizeMode.cover}
87
+ />
88
+ </View>
89
+ <View style={{ flex: 1, marginLeft: 14 }}>
90
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
91
+ <OText size={12} lineHeight={18}>{card?.order_product?.name}</OText>
92
+ <OText size={12} lineHeight={18}>{parsePrice(card?.order_product?.price)}</OText>
93
+ </View>
94
+ <OText size={10} color={theme.colors.textSecondary} lineHeight={15}>{parseDate(card?.created_at)}</OText>
95
+ <OText size={10} color={theme.colors.primary}>{getGiftCardStatus(card?.status)}</OText>
96
+ </View>
97
+ </View>
98
+ )}
99
+ </CardContainer>
100
+ )
101
+ }
@@ -0,0 +1,4 @@
1
+ import styled from 'styled-components/native';
2
+
3
+ export const CardContainer = styled.TouchableOpacity`
4
+ `
@@ -0,0 +1,83 @@
1
+ import React, { useEffect } from 'react';
2
+ import { useLanguage, GiftCardOrdersList as GiftCardOrdersListController } from 'ordering-components/native';
3
+ import { useTheme } from 'styled-components/native';
4
+ import {
5
+ Placeholder,
6
+ PlaceholderLine,
7
+ Fade
8
+ } from 'rn-placeholder';
9
+ import { SingleGiftCard } from '../SingleGiftCard';
10
+ import { OButton, OText } from '../../shared';
11
+ import {
12
+ ProductsListContainer,
13
+ SingleGiftCardWrapper,
14
+ WrappButton
15
+ } from './styles'
16
+
17
+ const VerticalGiftCardOrdersLayoutUI = (props: any) => {
18
+ const {
19
+ giftCards,
20
+ paginationProps,
21
+ loadMoreOrders,
22
+ title,
23
+ setIsEmpty,
24
+ onNavigationRedirect
25
+ } = props
26
+
27
+ const theme = useTheme();
28
+ const [, t] = useLanguage()
29
+
30
+ useEffect(() => {
31
+ if (giftCards.loading) return
32
+ if (giftCards.list?.length === 0) setIsEmpty(true)
33
+ }, [giftCards])
34
+
35
+ return (
36
+ <ProductsListContainer>
37
+ {
38
+ giftCards.loading ? (
39
+ <Placeholder Animation={Fade} style={{ marginVertical: 16 }}>
40
+ <PlaceholderLine width={30} height={16} />
41
+ </Placeholder>
42
+ ) : giftCards.list?.length > 0 && (
43
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={24} style={{ marginTop: 24 }}>{title}</OText>
44
+ )}
45
+ {giftCards.list.map(card => (
46
+ <SingleGiftCardWrapper key={card.id}>
47
+ <SingleGiftCard
48
+ card={card}
49
+ onNavigationRedirect={onNavigationRedirect}
50
+ />
51
+ </SingleGiftCardWrapper>
52
+ ))}
53
+ {giftCards.loading && (
54
+ [...Array(10).keys()].map(i => (
55
+ <SingleGiftCardWrapper key={i}>
56
+ <SingleGiftCard
57
+ isSkeleton
58
+ />
59
+ </SingleGiftCardWrapper>
60
+ ))
61
+ )}
62
+ {paginationProps.totalPages && paginationProps.currentPage < paginationProps.totalPages && (
63
+ <WrappButton>
64
+ <OButton
65
+ onClick={loadMoreOrders}
66
+ text={t('LOAD_MORE_ORDERS', 'Load more orders')}
67
+ imgRightSrc={null}
68
+ textStyle={{ color: theme.colors.white }}
69
+ style={{ borderRadius: 7.6, shadowOpacity: 0 }}
70
+ />
71
+ </WrappButton>
72
+ )}
73
+ </ProductsListContainer>
74
+ )
75
+ }
76
+
77
+ export const VerticalGiftCardOrdersLayout = (props: any) => {
78
+ const giftCardsProps = {
79
+ ...props,
80
+ UIComponent: VerticalGiftCardOrdersLayoutUI
81
+ }
82
+ return <GiftCardOrdersListController {...giftCardsProps} />
83
+ }
@@ -0,0 +1,9 @@
1
+ import styled from 'styled-components/native';
2
+
3
+ export const ProductsListContainer = styled.View`
4
+ `
5
+ export const WrappButton = styled.View`
6
+ margin-bottom: 24px;
7
+ `
8
+ export const SingleGiftCardWrapper = styled.View`
9
+ `
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useRef } from 'react'
2
2
  import { Dimensions, StyleSheet, View, Platform } from 'react-native';
3
- import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, } from 'react-native-maps'
3
+ import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, Polygon, Circle } from 'react-native-maps'
4
4
  import Geocoder from 'react-native-geocoding';
5
5
  import { useLanguage, useConfig } from 'ordering-components/native'
6
6
  import { GoogleMapsParams } from '../../types';
@@ -19,7 +19,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
19
19
  setSaveLocation,
20
20
  handleToggleMap,
21
21
  locations,
22
- isIntGeoCoder
22
+ isIntGeoCoder,
23
+ businessZones,
24
+ delta
23
25
  } = props
24
26
 
25
27
  const [, t] = useLanguage()
@@ -30,8 +32,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
30
32
  const [region, setRegion] = useState({
31
33
  latitude: location.lat,
32
34
  longitude: location.lng,
33
- latitudeDelta: 0.0010,
34
- longitudeDelta: 0.0010 * ASPECT_RATIO
35
+ latitudeDelta: delta ?? 0.0010,
36
+ longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO
35
37
  })
36
38
  const [MARKERS, SETMARKERS] = useState(locations)
37
39
  let mapRef = useRef<any>(null)
@@ -44,6 +46,19 @@ export const GoogleMap = (props: GoogleMapsParams) => {
44
46
  ERROR_MAX_LIMIT_LOCATION: `Sorry, You can only set the position to ${maxLimitLocation}m`
45
47
  }
46
48
 
49
+ const units: any = {
50
+ mi: 1609,
51
+ km: 1000
52
+ }
53
+
54
+ const types: any = [1, 2, 5]
55
+
56
+ const fillStyles = {
57
+ fillColor: 'rgba(44, 123, 229, 0.3)',
58
+ strokeColor: 'rgba(44, 123, 229, 1)',
59
+ strokeWidth: 2
60
+ }
61
+
47
62
  const geocodePosition = (pos: { latitude: number, longitude: number }, isMovingRegion ?: boolean) => {
48
63
  Geocoder.from({
49
64
  latitude: pos.latitude,
@@ -69,7 +84,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
69
84
  }
70
85
  handleChangeAddressMap && handleChangeAddressMap(address, details)
71
86
  setSaveLocation && setSaveLocation(false)
72
- if(!isMovingRegion){
87
+ if(!isMovingRegion){
73
88
  handleToggleMap && handleToggleMap()
74
89
  }
75
90
  } else {
@@ -230,6 +245,36 @@ export const GoogleMap = (props: GoogleMapsParams) => {
230
245
  title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
231
246
  />
232
247
  )}
248
+ {businessZones?.length > 0 && businessZones.filter((item: any) => types.includes(item?.type)).map((businessZone: any, i: number) => (
249
+ <React.Fragment key={i}>
250
+ {businessZone?.type === 2 && Array.isArray(businessZone?.data) && (
251
+ <Polygon
252
+ coordinates={businessZone?.data.map((item: any) => ({ latitude: item.lat, longitude: item.lng}))}
253
+ fillColor={fillStyles.fillColor}
254
+ strokeColor={fillStyles.strokeColor}
255
+ strokeWidth={fillStyles.strokeWidth}
256
+ />
257
+ )}
258
+ {(businessZone.type === 1 && businessZone?.data?.center && businessZone?.data?.radio) && (
259
+ <Circle
260
+ center={{ latitude: businessZone?.data?.center.lat, longitude: businessZone?.data?.center.lng}}
261
+ radius={businessZone?.data.radio * 1000}
262
+ fillColor={fillStyles.fillColor}
263
+ strokeColor={fillStyles.strokeColor}
264
+ strokeWidth={fillStyles.strokeWidth}
265
+ />
266
+ )}
267
+ {(businessZone.type === 5 && businessZone?.data?.distance) && (
268
+ <Circle
269
+ center={{ latitude: center.lat, longitude: center.lng}}
270
+ radius={businessZone?.data.distance * units[businessZone?.data?.unit]}
271
+ fillColor={fillStyles.fillColor}
272
+ strokeColor={fillStyles.strokeColor}
273
+ strokeWidth={fillStyles.strokeWidth}
274
+ />
275
+ )}
276
+ </React.Fragment>
277
+ ))}
233
278
  </MapView>
234
279
  <Alert
235
280
  open={alertState.open}
@@ -56,7 +56,7 @@ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
56
56
  showsHorizontalScrollIndicator={false}
57
57
  nestedScrollEnabled
58
58
  horizontal
59
- style={{ height: 300, paddingHorizontal: 40 }}
59
+ style={{ height: 325, paddingHorizontal: 20 }}
60
60
  >
61
61
  {[
62
62
  ...Array(10).keys()
@@ -162,4 +162,4 @@ export const HighestRatedBusinesses = (props: any) => {
162
162
  };
163
163
 
164
164
  return <BusinessesListingController {...highestRatedBusinessesProps} />;
165
- };
165
+ };
@@ -2,6 +2,6 @@ import styled from 'styled-components/native'
2
2
 
3
3
  export const ListWrapper = styled.View`
4
4
  background-color: ${(props: any) => props.theme.colors.backgroundLight};
5
- padding-horizontal: 40px;
5
+ padding-horizontal: 20px;
6
6
  padding-top: 30px;
7
7
  `;
@@ -92,7 +92,7 @@ const styles = StyleSheet.create({
92
92
  flex: 1,
93
93
  alignItems: 'center',
94
94
  justifyContent: 'space-between',
95
- paddingHorizontal: 40,
95
+ paddingHorizontal: 20,
96
96
  },
97
97
  logo: {
98
98
  marginTop: 64,
@@ -129,7 +129,8 @@ export const LastOrder = (props: OrdersOptionParams) => {
129
129
  initialPage: 1,
130
130
  pageSize: 3,
131
131
  controlType: 'infinity'
132
- }
132
+ },
133
+ noGiftCardOrders: true
133
134
  }
134
135
 
135
136
  return <OrderList {...MyOrdersProps} />
@@ -117,7 +117,8 @@ export const LastOrders = (props: any) => {
117
117
  initialPage: 1,
118
118
  pageSize: 3,
119
119
  controlType: 'infinity'
120
- }
120
+ },
121
+ noGiftCardOrders: true
121
122
  }
122
123
  return <OrderListController {...helpProps} />
123
124
  }