ordering-ui-react-native 0.21.50 → 0.21.51-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 (198) hide show
  1. package/package.json +8 -8
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/themes/business/index.tsx +4 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
  10. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  11. package/themes/business/src/components/BusinessProductList/ProductList.tsx +72 -27
  12. package/themes/business/src/components/BusinessProductList/index.tsx +57 -25
  13. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  14. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  15. package/themes/business/src/components/Home/index.tsx +5 -1
  16. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  17. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  18. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  19. package/themes/business/src/components/MapView/index.tsx +30 -15
  20. package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
  21. package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
  22. package/themes/business/src/components/OrderDetails/Delivery.tsx +42 -23
  23. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
  24. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +40 -20
  25. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  26. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  27. package/themes/business/src/components/OrdersOption/index.tsx +263 -135
  28. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  29. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +37 -40
  30. package/themes/business/src/components/PreviousOrders/OrderList.tsx +1 -1
  31. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  32. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  33. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  34. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  35. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  36. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  37. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  38. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  39. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  40. package/themes/business/src/components/Sessions/index.tsx +187 -0
  41. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  42. package/themes/business/src/components/StoresList/index.tsx +5 -3
  43. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  44. package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
  45. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  46. package/themes/business/src/components/shared/OInput.tsx +2 -0
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +5 -4
  49. package/themes/business/src/types/index.tsx +23 -5
  50. package/themes/business/src/utils/index.tsx +5 -0
  51. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  53. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  55. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +6 -2
  60. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  61. package/themes/original/src/components/AddressForm/index.tsx +41 -15
  62. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  63. package/themes/original/src/components/AddressList/index.tsx +18 -4
  64. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  65. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  66. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
  68. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  69. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  70. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  71. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  72. package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -3
  73. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  74. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  75. package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
  76. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  77. package/themes/original/src/components/BusinessPreorder/index.tsx +4 -3
  78. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  79. package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
  80. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +30 -18
  82. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  83. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  85. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +1 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  91. package/themes/original/src/components/Cart/index.tsx +30 -9
  92. package/themes/original/src/components/CartContent/index.tsx +96 -58
  93. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  94. package/themes/original/src/components/Checkout/index.tsx +144 -62
  95. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  96. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  97. package/themes/original/src/components/DatePicker/index.tsx +18 -2
  98. package/themes/original/src/components/Favorite/index.tsx +9 -9
  99. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  100. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  101. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  102. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  103. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  104. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  105. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  106. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  107. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  108. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  109. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  110. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  111. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  112. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  113. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  114. package/themes/original/src/components/Help/index.tsx +7 -0
  115. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  116. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  117. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  118. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  119. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  120. package/themes/original/src/components/Home/index.tsx +3 -8
  121. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  122. package/themes/original/src/components/LoginForm/index.tsx +9 -3
  123. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  124. package/themes/original/src/components/Messages/index.tsx +8 -7
  125. package/themes/original/src/components/Messages/styles.tsx +1 -1
  126. package/themes/original/src/components/MomentOption/index.tsx +19 -4
  127. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  128. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  129. package/themes/original/src/components/MultiCheckout/index.tsx +126 -61
  130. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  131. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  132. package/themes/original/src/components/MyOrders/index.tsx +28 -28
  133. package/themes/original/src/components/NavBar/index.tsx +5 -0
  134. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  135. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  136. package/themes/original/src/components/Notifications/index.tsx +9 -8
  137. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  138. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  139. package/themes/original/src/components/OrderDetails/index.tsx +701 -662
  140. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  141. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  142. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  143. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  144. package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  147. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  148. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  149. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  150. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  151. package/themes/original/src/components/PaymentOptions/index.tsx +47 -4
  152. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  153. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  154. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  155. package/themes/original/src/components/ProductForm/index.tsx +170 -252
  156. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -44
  157. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  158. package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
  159. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  160. package/themes/original/src/components/Promotions/index.tsx +13 -11
  161. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  162. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  163. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  164. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  165. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  166. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  167. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  168. package/themes/original/src/components/ServiceForm/index.tsx +1 -1
  169. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  170. package/themes/original/src/components/Sessions/index.tsx +5 -0
  171. package/themes/original/src/components/SignupForm/index.tsx +67 -59
  172. package/themes/original/src/components/SingleOrderCard/index.tsx +1 -1
  173. package/themes/original/src/components/SingleProductCard/index.tsx +4 -3
  174. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  175. package/themes/original/src/components/StripeCardsList/index.tsx +12 -35
  176. package/themes/original/src/components/StripeElementsForm/index.tsx +79 -59
  177. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  178. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  179. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  180. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  181. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  182. package/themes/original/src/components/UserFormDetails/index.tsx +100 -86
  183. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  184. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  185. package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
  186. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  187. package/themes/original/src/components/Wallets/index.tsx +7 -4
  188. package/themes/original/src/components/Wallets/styles.tsx +2 -1
  189. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  190. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  191. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  192. package/themes/original/src/components/shared/OButton.tsx +5 -5
  193. package/themes/original/src/components/shared/OInput.tsx +1 -4
  194. package/themes/original/src/components/shared/OModal.tsx +12 -14
  195. package/themes/original/src/layouts/Container.tsx +5 -3
  196. package/themes/original/src/types/index.tsx +6 -1
  197. package/themes/original/src/utils/index.tsx +12 -1
  198. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -5,12 +5,11 @@ export const OrderDetailsContainer = styled.ScrollView`
5
5
  `
6
6
 
7
7
  export const NavBack = styled.TouchableOpacity`
8
-
9
8
  `
10
9
 
11
10
 
12
11
  export const Header = styled.View`
13
- padding: 10px 40px;
12
+ padding: 10px 20px;
14
13
  flex: 1;
15
14
  `
16
15
 
@@ -24,7 +23,7 @@ export const OrderContent = styled.View`
24
23
  export const OrderBusiness = styled.View`
25
24
  position: relative;
26
25
  padding-vertical: 10px;
27
- padding-horizontal: 40px;
26
+ padding-horizontal: 20px;
28
27
  background-color: ${(props: any) => props.theme.colors.white};
29
28
  align-items: flex-start;
30
29
  `
@@ -64,7 +63,7 @@ export const SectionTitle = styled.View`
64
63
  `
65
64
 
66
65
  export const OrderCustomer = styled.View`
67
- padding: 20px 40px 10px;
66
+ padding: 20px 20px 10px;
68
67
  background-color: ${(props: any) => props.theme.colors.white};
69
68
  `
70
69
 
@@ -86,7 +85,7 @@ export const InfoBlock = styled.View`
86
85
  export const HeaderInfo = styled.View`
87
86
  flex: 1;
88
87
  background-color: ${(props: any) => props.theme.colors.backgroundGray100};
89
- padding: 20px 40px;
88
+ padding: 20px 20px;
90
89
  `
91
90
 
92
91
  export const OrderProducts = styled(OrderCustomer)``
@@ -100,7 +99,7 @@ export const Table = styled.View`
100
99
  `
101
100
 
102
101
  export const OrderBill = styled.View`
103
- padding-horizontal: 40px;
102
+ padding-horizontal: 20px;
104
103
  padding-vertical: 10px;
105
104
  flex: 1;
106
105
  background-color: ${(props: any) => props.theme.colors.white};
@@ -130,7 +129,7 @@ export const OrderAction = styled.View`
130
129
  `
131
130
 
132
131
  export const PlaceSpotWrapper = styled.View`
133
- padding-horizontal: 40px;
132
+ padding-horizontal: 20px;
134
133
  `
135
134
 
136
135
  export const ProfessionalPhoto = styled.ImageBackground`
@@ -141,4 +140,21 @@ export const ProfessionalPhoto = styled.ImageBackground`
141
140
  width: 80px;
142
141
  resize-mode: cover;
143
142
  margin-right: 10px;
144
- `;
143
+ `;
144
+
145
+ export const TopActions = styled.TouchableOpacity`
146
+ height: 60px;
147
+ justify-content: center;
148
+ min-width: 30px;
149
+ padding-right: 15px;
150
+ `;
151
+
152
+ export const TopHeader = styled.View`
153
+ width: 100%;
154
+ flex-direction: row;
155
+ align-items: center;
156
+ justify-content: space-between;
157
+ z-index: 1;
158
+ height: 60px;
159
+ min-height: 60px;
160
+ `
@@ -23,6 +23,7 @@ import {
23
23
  OrderProgressWrapper
24
24
  } from './styles'
25
25
  import { getOrderStatuPickUp, getOrderStatus } from '../../utils'
26
+ import DeviceInfo from 'react-native-device-info'
26
27
 
27
28
  const OrderProgressUI = (props: any) => {
28
29
  const {
@@ -56,7 +57,9 @@ const OrderProgressUI = (props: any) => {
56
57
  shadowColor: '#000',
57
58
  shadowOpacity: 0.2,
58
59
  shadowRadius: 2,
59
- elevation: 3
60
+ elevation: 3,
61
+ borderWidth: 1,
62
+ borderColor: 'rgba(0,0,0,0.1)'
60
63
  },
61
64
  logoWrapper: {
62
65
  overflow: 'hidden',
@@ -110,7 +113,7 @@ const OrderProgressUI = (props: any) => {
110
113
  setInitialLoaded(true)
111
114
  }, [orderList.loading, initialLoaded])
112
115
 
113
- const progressBarObjt = lastOrder?.delivery_type && lastOrder?.delivery_type === 2 ? getOrderStatuPickUp : getOrderStatus
116
+ const progressBarObjt = (s: any) => lastOrder?.delivery_type && lastOrder?.delivery_type === 2 ? getOrderStatuPickUp(s) : getOrderStatus(s)
114
117
 
115
118
  return (
116
119
  <>
@@ -130,7 +133,7 @@ const OrderProgressUI = (props: any) => {
130
133
  <View style={styles.logoWrapper}>
131
134
  <FastImage
132
135
  style={{ width: 50, height: 50 }}
133
- source={orderList?.orders.length === 1 ? {
136
+ source={orderList?.orders.length === 1 && lastOrder?.business?.logo?.includes?.('http') ? {
134
137
  uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
135
138
  priority: FastImage.priority.normal,
136
139
  } : theme.images.logos.logotype}
@@ -209,6 +212,22 @@ export const OrderProgress = (props: any) => {
209
212
  pageSize: 10,
210
213
  controlType: 'infinity'
211
214
  },
215
+ propsToFetch: [
216
+ 'id',
217
+ 'name',
218
+ 'business',
219
+ 'status',
220
+ 'delivery_type',
221
+ 'delivery_datetime_utc',
222
+ 'delivery_datetime',
223
+ 'reporting_data',
224
+ 'eta_current_status_time',
225
+ 'eta_previous_status_times',
226
+ 'eta_time',
227
+ 'delivered_in',
228
+ 'prepared_in',
229
+ 'eta_drive_time'
230
+ ],
212
231
  noGiftCardOrders: true
213
232
  }
214
233
 
@@ -32,5 +32,5 @@ export const OrderInfoWrapper = styled.View`
32
32
  export const OrderProgressWrapper = styled.View`
33
33
  margin-top: 37px;
34
34
  margin-bottom: 20px;
35
- padding-horizontal: 40px;
35
+ padding-horizontal: 20px;
36
36
  `
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useRef } from 'react';
2
2
  import { ActivityIndicator, View } from 'react-native'
3
3
  import {
4
4
  Cart,
@@ -56,6 +56,7 @@ const OrderSummaryUI = (props: any) => {
56
56
  const [orderState] = useOrder();
57
57
  const [{ parsePrice, parseNumber }] = useUtils();
58
58
  const [validationFields] = useValidationFields();
59
+ const commentRef = useRef()
59
60
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null, type: '' })
60
61
  const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled;
61
62
  const hideCartComments = !validationFields?.fields?.checkout?.comments?.enabled
@@ -341,6 +342,7 @@ const OrderSummaryUI = (props: any) => {
341
342
  marginTop: 10,
342
343
  borderRadius: 8
343
344
  }}
345
+ forwardRef={commentRef}
344
346
  multiline
345
347
  />
346
348
  {commentState?.loading && (
@@ -31,14 +31,12 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
31
31
  const [orderState] = useOrder();
32
32
  const [, t] = useLanguage();
33
33
  const _orderTypes = orderTypes.filter((type: any) => configTypes?.includes(type.value));
34
- const orderTypeTitle = (type : string) => theme?.header?.components?.order_types?.components?.[type]?.components?.title
35
- const orderTypeDescription = (type : string) => theme?.header?.components?.order_types?.components?.[type]?.components?.description
36
- const orderTypeCallAction = (type : string) => theme?.header?.components?.order_types?.components?.[type]?.components?.call_to_action
34
+
37
35
  const items = _orderTypes.map((type) => {
38
36
  return {
39
37
  value: type.value,
40
- label: orderTypeTitle(type.value) || t(type.content, type.content),
41
- description: orderTypeDescription(type.value) || t(type.description, 'Lorem ipsum dolor sit amet, consectetur.')
38
+ label: t(type.content, type.content),
39
+ description: t(type.description, 'Lorem ipsum dolor sit amet, consectetur.')
42
40
  }
43
41
  })
44
42
 
@@ -102,7 +100,13 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
102
100
  style={{ paddingBottom: 0 }}
103
101
  title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
104
102
  titleAlign={'center'}
103
+ titleStyle={{ fontSize: 14 }}
105
104
  noMargin
105
+ buttonProps={{
106
+ bgColor: theme.colors.white,
107
+ borderColor: theme.colors.white,
108
+ textStyle: { color: theme.colors.btnFont }
109
+ }}
106
110
  />
107
111
  {
108
112
  items.length > 0 && (
@@ -115,7 +119,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
115
119
  <OText size={12} lineHeight={18} color={theme.colors.white} weight={Platform.OS === 'android' ? 'bold' : '600'}>{item?.label}</OText>
116
120
  <OText size={10} lineHeight={15} color={theme.colors.white}>{item?.description}</OText>
117
121
  <View style={{ flexDirection: 'row', alignItems: 'center' }}>
118
- <OText size={10} lineHeight={15} color={theme.colors.white}>{orderTypeCallAction(item?.value) || t('START_MY_ORDER', 'Start my order')}</OText>
122
+ <OText size={10} lineHeight={15} color={theme.colors.white}>{t('START_MY_ORDER', 'Start my order')}</OText>
119
123
  <AntDesignIcon name='arrowleft' size={26} color={theme.colors.white} style={{ transform: [{ rotate: '180deg' }], marginStart: 4 }} />
120
124
  </View>
121
125
  </MaskCont>
@@ -2,5 +2,5 @@ import styled, { css } 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: ${(props : any) => props.isBusinessesSearchList ? '0' : '40px'};
5
+ padding-horizontal: ${(props : any) => props.isBusinessesSearchList ? '0' : '20px'};
6
6
  `;
@@ -2,5 +2,5 @@ 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: ${(props : any) => props.isBusinessesSearchList ? '0' : '40px'};
5
+ padding-horizontal: ${(props : any) => props.isBusinessesSearchList ? '0' : '20px'};
6
6
  `;
@@ -159,10 +159,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
159
159
 
160
160
  useEffect(() => {
161
161
  if (reorderState?.error) {
162
- const errorMessage = (Array.isArray(reorderState?.result) || typeof reorderState?.result === 'string')
163
- ? reorderState?.result
164
- : t('CANT_REORDER_FOR_THIS_BUSINESS', 'Can’t reorder for this store, please create order manually.')
165
- showToast(ToastType.Error, errorMessage)
162
+ showToast(ToastType.Error, reorderState?.result)
166
163
  }
167
164
  }, [reorderState])
168
165
 
@@ -312,7 +309,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
312
309
  />
313
310
  )
314
311
  )}
315
- {loading && !hideOrders && (
312
+ {loading && !hideOrders && !preOrders && (
316
313
  <>
317
314
  {!activeOrders ? (
318
315
  <Placeholder style={{ marginTop: 30 }} Animation={Fade}>
@@ -353,6 +350,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
353
350
  const MyOrdersProps = {
354
351
  ...props,
355
352
  UIComponent: OrdersOptionUI,
353
+ noGiftCardOrders: true,
356
354
  orderStatus: getAllOrders
357
355
  ? [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
358
356
  : props.preOrders ? [13] : props.activeOrders
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components/native'
3
3
  export const OptionTitle = styled.View`
4
4
  margin-top: 24px;
5
5
  ${(props : any) => props.titleContent && css`
6
- margin-left: ${() => props.isBusinessesSearchList ? '0' : '40px'};
6
+ margin-left: ${() => props.isBusinessesSearchList ? '0' : '20px'};
7
7
  `}
8
8
  `
9
9
 
@@ -26,7 +26,7 @@ const PaymentOptionCardUI = (props: any) => {
26
26
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<string> }>({ open: false, content: [] })
27
27
  const [newCard, setNewCard] = useState<any>(null)
28
28
 
29
- const onChangeCardForm = (values : any) => {
29
+ const onChangeCardForm = (values: any) => {
30
30
  if (values?.valid) {
31
31
  const expiry = values?.values?.expiry?.split('/')
32
32
  const expiryMonth = expiry[0]
@@ -107,6 +107,8 @@ const PaymentOptionCardUI = (props: any) => {
107
107
  cardsList={cardsList}
108
108
  noShowErrors
109
109
  gateway={gateway}
110
+ onOpen={() => setAddCardOpen({ ...addCardOpen, stripe: true })}
111
+ onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
110
112
  />
111
113
  </>
112
114
  <Modal
@@ -169,7 +171,7 @@ const PaymentOptionCardUI = (props: any) => {
169
171
  )
170
172
  }
171
173
 
172
- export const PaymentOptionCard = (props : any) => {
174
+ export const PaymentOptionCard = (props: any) => {
173
175
  const paymentOptions = {
174
176
  ...props,
175
177
  UIComponent: PaymentOptionCardUI
@@ -45,7 +45,7 @@ const PaymentOptionWalletUI = (props: any) => {
45
45
  new Array(walletsState.result?.length).fill(false)
46
46
  );
47
47
 
48
- const creditBalance: any = (wallet: any) => ` = ${parsePrice(wallet.balance / wallet.redemption_rate, { isTruncable: true })}`
48
+ const creditBalance: any = (wallet: any) => ` = ${parsePrice(wallet.balance / wallet.redemption_rate)}`
49
49
 
50
50
  const walletName: any = {
51
51
  cash: {
@@ -87,65 +87,65 @@ const PaymentOptionWalletUI = (props: any) => {
87
87
  {!walletsState.loading &&
88
88
  !walletsState.error &&
89
89
  walletsState.result?.length > 0 &&
90
- (
91
- <>
92
- {walletsState.result?.map((wallet: any, idx: any) => wallet.valid && wallet.balance >= 0 && walletName[wallet.type]?.isActive && (
93
- <Container
94
- key={wallet.id}
95
- isBottomBorder={idx === walletsState.result?.filter((wallet: any) => wallet.valid)?.length - 1}
96
- onPress={() => handleOnChange(idx, wallet)}
97
- disabled={(cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0}
98
- >
99
- <SectionLeft>
100
- {checkedState[idx] ? (
101
- <MaterialCommunityIcons
102
- name="checkbox-marked"
103
- size={25}
104
- color={theme.colors.primary}
105
- />
106
- ) : (
107
- <MaterialCommunityIcons
108
- name="checkbox-blank-outline"
109
- size={25}
110
- color={theme.colors.disabled}
111
- />
112
- )}
113
- <View style={{ alignItems: 'baseline', marginLeft: 5 }}>
114
- <View>
115
- <OText
116
- style={((cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0) ? {
117
- color: theme.colors.disabled
118
- } : {}}
119
- >
120
- {walletName[wallet.type]?.name}
121
- </OText>
122
- </View>
90
+ (
91
+ <>
92
+ {walletsState.result?.map((wallet: any, idx: any) => wallet.valid && wallet.balance >= 0 && walletName[wallet.type]?.isActive && (
93
+ <Container
94
+ key={wallet.id}
95
+ isBottomBorder={idx === walletsState.result?.filter((wallet: any) => wallet.valid)?.length - 1}
96
+ onPress={() => handleOnChange(idx, wallet)}
97
+ disabled={(cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0}
98
+ >
99
+ <SectionLeft>
100
+ {checkedState[idx] ? (
101
+ <MaterialCommunityIcons
102
+ name="checkbox-marked"
103
+ size={25}
104
+ color={theme.colors.primary}
105
+ />
106
+ ) : (
107
+ <MaterialCommunityIcons
108
+ name="checkbox-blank-outline"
109
+ size={25}
110
+ color={theme.colors.disabled}
111
+ />
112
+ )}
113
+ <View style={{ alignItems: 'baseline', marginLeft: 5 }}>
114
+ <View>
115
+ <OText
116
+ style={((cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0) ?{
117
+ color: theme.colors.disabled
118
+ } : {}}
119
+ >
120
+ {walletName[wallet.type]?.name}
121
+ </OText>
123
122
  </View>
124
- </SectionLeft>
125
-
126
- <View style={{ maxWidth: '35%', alignItems: 'flex-end' }}>
127
- {wallet.type === 'cash' && (
128
- <OText>
129
- {parsePrice(wallet?.balance, { isTruncable: true })}
123
+ </View>
124
+ </SectionLeft>
125
+
126
+ <View style={{maxWidth: '35%', alignItems: 'flex-end' }}>
127
+ {wallet.type === 'cash' && (
128
+ <OText>
129
+ {parsePrice(wallet?.balance)}
130
+ </OText>
131
+ )}
132
+ {wallet.type === 'credit_point' && (
133
+ <OText>
134
+ <OText color={theme.colors.primary} weight='bold'>
135
+ {`${wallet?.balance} ${t('POINTS', 'Points')}`}
130
136
  </OText>
131
- )}
132
- {wallet.type === 'credit_point' && (
133
137
  <OText>
134
- <OText color={theme.colors.primary} weight='bold'>
135
- {`${wallet?.balance} ${t('POINTS', 'Points')}`}
136
- </OText>
137
- <OText>
138
- {wallet?.balance > 0
139
- ? creditBalance(wallet)
140
- : null}
141
- </OText>
138
+ {wallet?.balance > 0
139
+ ? creditBalance(wallet)
140
+ : null}
142
141
  </OText>
143
- )}
144
- </View>
145
- </Container>
146
- ))}
147
- </>
148
- )}
142
+ </OText>
143
+ )}
144
+ </View>
145
+ </Container>
146
+ ))}
147
+ </>
148
+ )}
149
149
 
150
150
  {walletsState?.loading && (
151
151
  <View>
@@ -65,6 +65,7 @@ const PaymentOptionsUI = (props: any) => {
65
65
  handlePaymentMethodClickCustom,
66
66
  handlePlaceOrder,
67
67
  merchantId,
68
+ urlscheme,
68
69
  setMethodPaySupported,
69
70
  placeByMethodPay,
70
71
  methodPaySupported,
@@ -74,7 +75,8 @@ const PaymentOptionsUI = (props: any) => {
74
75
  requiredFields,
75
76
  openUserModal,
76
77
  paymethodClicked,
77
- setPaymethodClicked
78
+ setPaymethodClicked,
79
+ androidAppId
78
80
  } = props
79
81
 
80
82
  const theme = useTheme();
@@ -217,7 +219,7 @@ const PaymentOptionsUI = (props: any) => {
217
219
  style={{ margin: 0, marginTop: 4 }}
218
220
  color={paymethodSelected?.id === item.id ? theme.colors.white : '#000'}
219
221
  >
220
- {t(item.gateway.toUpperCase(), item.name)}
222
+ {t(item?.gateway?.toUpperCase(), item.name)}
221
223
  </OText>
222
224
  </PMItem>
223
225
  </TouchableOpacity>
@@ -342,10 +344,11 @@ const PaymentOptionsUI = (props: any) => {
342
344
  setAddCardOpen={setAddCardOpen}
343
345
  addCardOpen={addCardOpen}
344
346
  isOpenMethod={isOpenMethod}
345
- handlePaymethodDataChange={handlePaymethodDataChange}
347
+ handleSource={handlePaymethodDataChange}
346
348
  clientSecret={props.clientSecret}
347
349
  businessId={props.businessId}
348
350
  onPaymentChange={onPaymentChange}
351
+ paySelected={props.paySelected}
349
352
  />
350
353
  </View>
351
354
  )}
@@ -360,10 +363,13 @@ const PaymentOptionsUI = (props: any) => {
360
363
  handleSource={handlePaymethodDataChange}
361
364
  onCancel={() => handlePaymethodClick(null)}
362
365
  merchantId={merchantId}
366
+ urlscheme={urlscheme}
367
+ androidAppId={androidAppId}
363
368
  setMethodPaySupported={setMethodPaySupported}
364
369
  methodPaySupported={methodPaySupported}
365
370
  placeByMethodPay={placeByMethodPay}
366
371
  setPlaceByMethodPay={setPlaceByMethodPay}
372
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
367
373
  />
368
374
  )}
369
375
 
@@ -406,6 +412,10 @@ const PaymentOptionsUI = (props: any) => {
406
412
  handleSource={handlePaymethodDataChange}
407
413
  onCancel={() => handlePaymethodClick(null)}
408
414
  merchantId={merchantId}
415
+ urlscheme={urlscheme}
416
+ androidAppId={androidAppId}
417
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
418
+ paySelected={props.paySelected}
409
419
  />
410
420
  </KeyboardAvoidingView>
411
421
  </OModal>
@@ -425,11 +435,13 @@ const PaymentOptionsUI = (props: any) => {
425
435
  <StripeCardsList
426
436
  paymethod={isOpenMethod?.paymethod}
427
437
  businessId={props.businessId}
428
- publicKey={isOpenMethod?.paymethod?.credentials.publishable}
429
438
  payType={paymethodsList?.name}
430
439
  onSelectCard={handlePaymethodDataChange}
431
440
  onNavigationRedirect={onNavigationRedirect}
432
441
  onCancel={() => handlePaymethodClick(null)}
442
+ publicKey={isOpenMethod?.paymethod?.credentials.publishable}
443
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
444
+ paySelected={props.paySelected}
433
445
  />
434
446
  </View>
435
447
  )}
@@ -446,6 +458,7 @@ const PaymentOptionsUI = (props: any) => {
446
458
  enabled={Platform.OS === 'ios' ? true : false}
447
459
  >
448
460
  <StripeElementsForm
461
+ openCarts={props.openCarts}
449
462
  toSave
450
463
  businessId={props.businessId}
451
464
  publicKey={isOpenMethod?.paymethod?.credentials?.stripe?.publishable}
@@ -453,6 +466,36 @@ const PaymentOptionsUI = (props: any) => {
453
466
  accountId={isOpenMethod?.paymethod?.credentials?.user}
454
467
  onSelectCard={handlePaymethodDataChange}
455
468
  onCancel={() => setAddCardOpen({ ...addCardOpen, stripeConnect: false })}
469
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
470
+ />
471
+ </KeyboardAvoidingView>
472
+ </OModal>
473
+
474
+ {/* Stripe Add card */}
475
+ <OModal
476
+ entireModal
477
+ title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
478
+ open={addCardOpen?.stripe}
479
+ onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
480
+ style={{ backgroundColor: 'red' }}
481
+ >
482
+ <KeyboardAvoidingView
483
+ behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
484
+ keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
485
+ enabled={Platform.OS === 'ios' ? true : false}
486
+ >
487
+ <StripeElementsForm
488
+ openCarts={props.openCarts}
489
+ toSave
490
+ businessId={props.businessId}
491
+ businessIds={props.businessIds}
492
+ publicKey={props.publicKey || isOpenMethod?.paymethod?.credentials?.publishable}
493
+ setCardsList={setCardList}
494
+ requirements={props.clientSecret}
495
+ handleSource={handlePaymethodDataChange}
496
+ onSelectCard={handlePaymethodDataChange}
497
+ onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
498
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
456
499
  />
457
500
  </KeyboardAvoidingView>
458
501
  </OModal>
@@ -49,6 +49,8 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
49
49
  onClick={loadMoreOrders}
50
50
  text={t('LOAD_MORE_ORDERS', 'Load more orders')}
51
51
  imgRightSrc={null}
52
+ bgColor={theme.colors.primary}
53
+ borderColor={theme.colors.primary}
52
54
  textStyle={{ color: theme.colors.white }}
53
55
  style={{ borderRadius: 7.6, shadowOpacity: 0, marginTop: 20 }}
54
56
  />