ordering-ui-react-native 0.21.21 → 0.21.22-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 (239) hide show
  1. package/package.json +7 -6
  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 +4 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +2 -1
  8. package/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +4 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/Chat/index.tsx +23 -14
  18. package/themes/business/src/components/DriverMap/index.tsx +4 -3
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/Home/index.tsx +5 -1
  21. package/themes/business/src/components/LanguageSelector/index.tsx +4 -2
  22. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  23. package/themes/business/src/components/MapView/index.tsx +11 -7
  24. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +163 -113
  26. package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +60 -53
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
  30. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  32. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  33. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  34. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  35. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  36. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +33 -36
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +18 -13
  39. package/themes/business/src/components/PreviousOrders/index.tsx +80 -66
  40. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  41. package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
  42. package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
  43. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  44. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  45. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  46. package/themes/business/src/components/Sessions/index.tsx +187 -0
  47. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  48. package/themes/business/src/components/StoresList/index.tsx +5 -3
  49. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  50. package/themes/business/src/components/UserProfileForm/index.tsx +98 -44
  51. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  52. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  53. package/themes/business/src/components/shared/OInput.tsx +2 -0
  54. package/themes/business/src/hooks/useLocation.tsx +5 -4
  55. package/themes/business/src/types/index.tsx +15 -2
  56. package/themes/business/src/utils/index.tsx +5 -0
  57. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  59. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  61. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  62. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  63. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  64. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  65. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  66. package/themes/original/index.tsx +9 -4
  67. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  68. package/themes/original/src/components/AddressForm/index.tsx +10 -6
  69. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  70. package/themes/original/src/components/AddressList/index.tsx +4 -7
  71. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  72. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  73. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  74. package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  76. package/themes/original/src/components/BusinessController/index.tsx +20 -12
  77. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  78. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  79. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  80. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  81. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  82. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  83. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  84. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  85. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
  86. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  87. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  88. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  89. package/themes/original/src/components/BusinessProductsListing/index.tsx +51 -20
  90. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  91. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  92. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +24 -404
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  100. package/themes/original/src/components/Cart/index.tsx +32 -9
  101. package/themes/original/src/components/CartContent/index.tsx +96 -58
  102. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  103. package/themes/original/src/components/Checkout/index.tsx +190 -66
  104. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  105. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  106. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  107. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  108. package/themes/original/src/components/Favorite/index.tsx +4 -9
  109. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  110. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  111. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  112. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  113. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  114. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  115. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  116. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  117. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  118. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  119. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  120. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  121. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  122. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  123. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  124. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  125. package/themes/original/src/components/GoogleMap/index.tsx +6 -5
  126. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  127. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  128. package/themes/original/src/components/Home/index.tsx +2 -1
  129. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  130. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  131. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  132. package/themes/original/src/components/Messages/index.tsx +9 -4
  133. package/themes/original/src/components/Messages/styles.tsx +1 -1
  134. package/themes/original/src/components/MomentOption/index.tsx +4 -3
  135. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  136. package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
  137. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  138. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  139. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  140. package/themes/original/src/components/NavBar/index.tsx +3 -1
  141. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  142. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  143. package/themes/original/src/components/Notifications/index.tsx +4 -8
  144. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  146. package/themes/original/src/components/OrderDetails/index.tsx +716 -668
  147. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  148. package/themes/original/src/components/OrderProgress/index.tsx +28 -6
  149. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  150. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  152. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  153. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  154. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  155. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  156. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  157. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  158. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  159. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  160. package/themes/original/src/components/PaymentOptions/index.tsx +72 -6
  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 +74 -165
  164. package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
  165. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  166. package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
  167. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
  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/SignupForm/index.tsx +60 -58
  177. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  178. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  179. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  180. package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +72 -59
  182. package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
  183. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  184. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  185. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  186. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  187. package/themes/original/src/components/UserFormDetails/index.tsx +125 -77
  188. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  189. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  190. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  192. package/themes/original/src/components/Wallets/index.tsx +8 -9
  193. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  194. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  195. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  196. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  197. package/themes/original/src/components/shared/OButton.tsx +5 -5
  198. package/themes/original/src/components/shared/OInput.tsx +1 -4
  199. package/themes/original/src/components/shared/OModal.tsx +12 -14
  200. package/themes/original/src/layouts/Container.tsx +5 -3
  201. package/themes/original/src/types/index.tsx +1 -0
  202. package/themes/original/src/utils/index.tsx +125 -1
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  204. package/src/navigators/BottomNavigator.tsx +0 -117
  205. package/src/navigators/CheckoutNavigator.tsx +0 -66
  206. package/src/navigators/HomeNavigator.tsx +0 -202
  207. package/src/navigators/NavigationRef.tsx +0 -7
  208. package/src/navigators/RootNavigator.tsx +0 -269
  209. package/src/pages/Account.tsx +0 -34
  210. package/src/pages/AddressForm.tsx +0 -62
  211. package/src/pages/AddressList.tsx +0 -24
  212. package/src/pages/BusinessProductsList.tsx +0 -81
  213. package/src/pages/BusinessesListing.tsx +0 -43
  214. package/src/pages/CartList.tsx +0 -49
  215. package/src/pages/Checkout.tsx +0 -101
  216. package/src/pages/ForgotPassword.tsx +0 -24
  217. package/src/pages/Help.tsx +0 -23
  218. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  219. package/src/pages/HelpGuide.tsx +0 -23
  220. package/src/pages/HelpOrder.tsx +0 -23
  221. package/src/pages/Home.tsx +0 -36
  222. package/src/pages/IntroductoryTutorial.tsx +0 -170
  223. package/src/pages/Login.tsx +0 -47
  224. package/src/pages/MomentOption.tsx +0 -30
  225. package/src/pages/MultiCheckout.tsx +0 -31
  226. package/src/pages/MultiOrdersDetails.tsx +0 -27
  227. package/src/pages/MyOrders.tsx +0 -40
  228. package/src/pages/NetworkError.tsx +0 -24
  229. package/src/pages/NotFound.tsx +0 -22
  230. package/src/pages/OrderDetails.tsx +0 -25
  231. package/src/pages/ProductDetails.tsx +0 -55
  232. package/src/pages/Profile.tsx +0 -36
  233. package/src/pages/ReviewDriver.tsx +0 -30
  234. package/src/pages/ReviewOrder.tsx +0 -32
  235. package/src/pages/ReviewProducts.tsx +0 -30
  236. package/src/pages/Sessions.tsx +0 -22
  237. package/src/pages/Signup.tsx +0 -53
  238. package/src/pages/SpinnerLoader.tsx +0 -10
  239. package/src/pages/Splash.tsx +0 -21
@@ -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
+ `
@@ -20,7 +20,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
20
20
  handleToggleMap,
21
21
  locations,
22
22
  isIntGeoCoder,
23
- businessZones
23
+ businessZones,
24
+ delta
24
25
  } = props
25
26
 
26
27
  const [, t] = useLanguage()
@@ -31,8 +32,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
31
32
  const [region, setRegion] = useState({
32
33
  latitude: location.lat,
33
34
  longitude: location.lng,
34
- latitudeDelta: 0.0010,
35
- longitudeDelta: 0.0010 * ASPECT_RATIO
35
+ latitudeDelta: delta ?? 0.0010,
36
+ longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO
36
37
  })
37
38
  const [MARKERS, SETMARKERS] = useState(locations)
38
39
  let mapRef = useRef<any>(null)
@@ -83,7 +84,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
83
84
  }
84
85
  handleChangeAddressMap && handleChangeAddressMap(address, details)
85
86
  setSaveLocation && setSaveLocation(false)
86
- if(!isMovingRegion){
87
+ if(!isMovingRegion){
87
88
  handleToggleMap && handleToggleMap()
88
89
  }
89
90
  } else {
@@ -265,7 +266,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
265
266
  )}
266
267
  {(businessZone.type === 5 && businessZone?.data?.distance) && (
267
268
  <Circle
268
- center={{ latitude: businessZone?.data?.center.lat, longitude: businessZone?.data?.center.lng}}
269
+ center={{ latitude: center.lat, longitude: center.lng}}
269
270
  radius={businessZone?.data.distance * units[businessZone?.data?.unit]}
270
271
  fillColor={fillStyles.fillColor}
271
272
  strokeColor={fillStyles.strokeColor}
@@ -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
  `;
@@ -62,6 +62,7 @@ export const Home = (props: any) => {
62
62
  bgColor={theme.colors.primaryContrast}
63
63
  borderColor={theme.colors.primaryContrast}
64
64
  style={styles.buttons}
65
+ textStyle={{ color: 'black' }}
65
66
  onClick={() => onNavigationRedirect('Signup')}
66
67
  imgRightSrc={null}
67
68
  />
@@ -92,7 +93,7 @@ const styles = StyleSheet.create({
92
93
  flex: 1,
93
94
  alignItems: 'center',
94
95
  justifyContent: 'space-between',
95
- paddingHorizontal: 40,
96
+ paddingHorizontal: 20,
96
97
  },
97
98
  logo: {
98
99
  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
  }
@@ -40,19 +40,19 @@ export const Otp = (props: otpParams) => {
40
40
  onSubmit()
41
41
  }
42
42
 
43
- const handleChangeCode = (code : string) => {
43
+ const handleChangeCode = (code: string) => {
44
44
  if (code?.length === pinCount) {
45
- setCheckingCode(true)
45
+ setCheckingCode && setCheckingCode(true)
46
46
  handleLoginOtp(code)
47
47
  inputRef.current?.reset && inputRef.current.reset()
48
48
  setTimeout(() => inputRef.current?.focus && inputRef.current.focus(), 100)
49
49
  }
50
- setOtpError(null)
50
+ setOtpError && setOtpError(null)
51
51
  }
52
52
 
53
53
  const handleCloseOtp = () => {
54
54
  setWillVerifyOtpState(false)
55
- setOtpError(null)
55
+ setOtpError && setOtpError(null)
56
56
  }
57
57
 
58
58
  useEffect(() => {
@@ -108,18 +108,6 @@ export const Otp = (props: otpParams) => {
108
108
  return (
109
109
  <SafeAreaView style={{ flex: 1, backgroundColor: theme.colors.backgroundPage }}>
110
110
  <OTPContainer>
111
- <View
112
- style={loginStyle.closeContainer}>
113
- <TouchableOpacity onPress={() => handleCloseOtp()} style={loginStyle.wrapperIcon}>
114
- <OIcon
115
- src={theme.images.general.close}
116
- width={22}
117
- />
118
- </TouchableOpacity>
119
- <OText size={22}>
120
- {t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
121
- </OText>
122
- </View>
123
111
  <OText size={24}>
124
112
  {formatSeconds(otpLeftTime)}
125
113
  </OText>
@@ -126,9 +126,13 @@ const MessagesUI = (props: MessagesParams) => {
126
126
  const messageConsole = (message: any) => {
127
127
  return message.change?.attribute !== 'driver_id'
128
128
  ?
129
- `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute) ?
130
- `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
131
- `${message.change?.attribute !== 'logistic_status' ? message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)]) : message.change.old !== null && getLogisticTag(message.change.old)} ${t('TO', 'to')} ${message.change?.attribute !== 'logistic_status' ? t(ORDER_STATUS[parseInt(message.change.new, 10)]) : getLogisticTag(message.change.new)}`
129
+ `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute)
130
+ ? `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}`
131
+ : `${message.change?.attribute !== 'logistic_status'
132
+ ? message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])
133
+ : message.change.old !== null && getLogisticTag(message.change.old)} ${t('TO', 'to')} ${message.change?.attribute !== 'logistic_status'
134
+ ? t(ORDER_STATUS[parseInt(message.change.new, 10)])
135
+ : getLogisticTag(message.change.new)}`
132
136
  }`
133
137
  : message.change.new
134
138
  ?
@@ -148,6 +152,7 @@ const MessagesUI = (props: MessagesParams) => {
148
152
  }
149
153
  const newMessage: any = [];
150
154
  messages.messages.map((message: any) => {
155
+ if (message.change?.attribute === 'driver_group_id') return
151
156
  if (business && message.type !== 0 && (messagesToShow?.messages?.length || message?.can_see?.includes('2'))) {
152
157
  newMessage.push({
153
158
  _id: message?.id,
@@ -456,7 +461,7 @@ const MessagesUI = (props: MessagesParams) => {
456
461
  active={business}
457
462
  >
458
463
  <OIcon
459
- url={order?.business?.logo || theme.images.dummies.businessLogo}
464
+ url={order?.business?.logo}
460
465
  width={32}
461
466
  height={32}
462
467
  style={{ borderRadius: 32 }}
@@ -10,7 +10,7 @@ export const Header = styled.View`
10
10
  background-color: ${(props: any) => props.theme.colors.white};
11
11
  box-shadow: 0 2px 2px #0000001A;
12
12
  padding-bottom: 10px;
13
- padding-horizontal: 20px;
13
+ padding-horizontal: 10px;
14
14
  `
15
15
 
16
16
  export const TitleHeader = styled.View``
@@ -327,8 +327,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
327
327
  <>
328
328
  <Container
329
329
  style={{
330
- paddingLeft: !cateringPreorder || isPage ? 40 : 0,
331
- paddingRight: !cateringPreorder || isPage ? 40 : 0
330
+ paddingLeft: !cateringPreorder || isPage ? 20 : 0,
331
+ paddingRight: !cateringPreorder || isPage ? 20 : 0
332
332
  }}
333
333
  nestedScrollEnabled
334
334
  >
@@ -394,6 +394,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
394
394
  <View style={{ flex: 1 }}>
395
395
  {selectDate && datesWhitelist[0]?.start !== null && (
396
396
  <CalendarStrip
397
+ locale={locale}
397
398
  scrollable
398
399
  style={styles.calendar}
399
400
  calendarHeaderContainerStyle={styles.calendarHeaderContainer}
@@ -467,7 +468,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
467
468
  <Spinner visible={momentState.isLoading === 1} />
468
469
  </Container>
469
470
  {!isCart && !cateringPreorder && (
470
- <View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal: 40, backgroundColor: 'white', width: '100%' }}>
471
+ <View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal: 20, backgroundColor: 'white', width: '100%' }}>
471
472
  <OButton onClick={() => handleChangeMoment()} isDisabled={!selectedTime} text={t('CONTINUE', 'Continue')} style={{ borderRadius: 7.6, height: 44, shadowOpacity: 0 }} textStyle={{ color: 'white', fontSize: 14 }} showNextIcon />
472
473
  </View>
473
474
  )}
@@ -11,7 +11,7 @@ export const MultiCartUI = () => {
11
11
  const theme = useTheme();
12
12
  return (
13
13
  <Container noPadding>
14
- <ChContainer style={{ paddingHorizontal: 40 }}>
14
+ <ChContainer style={{ paddingHorizontal: 20 }}>
15
15
  <ChSection>
16
16
  <ChUserDetails>
17
17
  <Placeholder Animation={Fade}>
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react'
1
+ import React, { useState, useEffect, useCallback } from 'react'
2
2
  import {
3
3
  useLanguage,
4
4
  useConfig,
@@ -10,11 +10,12 @@ import {
10
10
  ToastType,
11
11
  MultiCheckout as MultiCheckoutController
12
12
  } from 'ordering-components/native'
13
- import { View, StyleSheet, Platform } from 'react-native'
13
+ import { View, StyleSheet, Platform, ScrollView, SafeAreaView } from 'react-native'
14
14
  import { useTheme } from 'styled-components/native';
15
+ import IconAntDesign from 'react-native-vector-icons/AntDesign';
15
16
  import { Container } from '../../layouts/Container';
16
17
  import NavBar from '../NavBar';
17
- import { OText, OIcon, OModal } from '../shared';
18
+ import { OText, OIcon, OModal, OButton } from '../shared';
18
19
  import { getTypesText } from '../../utils';
19
20
  import { UserDetails } from '../UserDetails'
20
21
  import { AddressDetails } from '../AddressDetails'
@@ -26,8 +27,12 @@ import { DriverTips } from '../DriverTips'
26
27
  import { CouponControl } from '../CouponControl';
27
28
  import { DriverTipsContainer } from '../Cart/styles'
28
29
  import { OSTable, OSCoupon } from '../OrderSummary/styles';
30
+ import { SignupForm } from '../SignupForm'
31
+ import { LoginForm } from '../LoginForm'
29
32
 
30
33
  import {
34
+ TopHeader,
35
+ TopActions,
31
36
  ChContainer,
32
37
  ChSection,
33
38
  ChHeader,
@@ -71,10 +76,18 @@ const MultiCheckoutUI = (props: any) => {
71
76
  const theme = useTheme();
72
77
  const styles = StyleSheet.create({
73
78
  pagePadding: {
74
- paddingLeft: 40,
75
- paddingRight: 40
79
+ paddingLeft: 20,
80
+ paddingRight: 20
81
+ },
82
+ wrapperNavbar: {
83
+ paddingHorizontal: 20,
84
+ backgroundColor: theme?.colors?.white,
85
+ borderWidth: 0
86
+ },
87
+ detailWrapper: {
88
+ paddingHorizontal: 20,
89
+ width: '100%'
76
90
  },
77
- wrapperNavbar: { paddingHorizontal: 40 }
78
91
  })
79
92
 
80
93
  const [, { showToast }] = useToast();
@@ -83,7 +96,7 @@ const MultiCheckoutUI = (props: any) => {
83
96
  const [{ parsePrice, parseDate }] = useUtils();
84
97
  const [{ options, carts, loading }, { confirmCart }] = useOrder();
85
98
  const [validationFields] = useValidationFields();
86
- const [{ user }] = useSession()
99
+ const [{ user }, { login }] = useSession()
87
100
 
88
101
  const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
89
102
  const isPreOrder = configs?.preorder_status_enabled?.value === '1'
@@ -130,13 +143,20 @@ const MultiCheckoutUI = (props: any) => {
130
143
  ?.reduce((sum: any, cart: any) => sum + clearAmount((cart?.subtotal + getIncludedTaxes(cart)) * accumulationRateBusiness(cart?.business_id)), 0)
131
144
  ?.toFixed(configs.format_number_decimal_length?.value ?? 2)
132
145
 
146
+ const [showTitle, setShowTitle] = useState(false)
133
147
  const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
134
148
  const [phoneUpdate, setPhoneUpdate] = useState(false);
135
149
  const [userErrors, setUserErrors] = useState<any>([]);
150
+ const [cartsOpened, setCartsOpened] = useState([])
136
151
  const [placeByMethodPay, setPlaceByMethodPay] = useState(false)
152
+ const [allowedGuest, setAllowedGuest] = useState(false)
153
+ const [isOpen, setIsOpen] = useState(false)
154
+ const [requiredFields, setRequiredFields] = useState<any>([])
155
+ const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
156
+ const [openModal, setOpenModal] = useState({ login: false, signup: false, isGuest: false })
137
157
  const [methodPaySupported, setMethodPaySupported] = useState({ enabled: false, message: null, loading: true })
138
158
  const methodsPay = ['global_google_pay', 'global_apple_pay']
139
- const isDisablePlaceOrderButton = cartGroup?.loading || (!(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) && cartGroup?.result?.balance > 0) ||
159
+ const isDisablePlaceOrderButton = cartGroup?.loading || placing || (!(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) && cartGroup?.result?.balance > 0) ||
140
160
  (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data) ||
141
161
  walletCarts.length > 0
142
162
  || (methodsPay.includes(paymethodSelected?.gateway) && (!methodPaySupported.enabled || methodPaySupported.loading)) || openCarts?.length === 0
@@ -151,11 +171,12 @@ const MultiCheckoutUI = (props: any) => {
151
171
  setUserErrors([])
152
172
  const errors = []
153
173
  const notFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'zipcode', 'address_notes']
174
+ const _requiredFields: any = []
154
175
 
155
176
  Object.values(validationFields?.fields?.checkout).map((field: any) => {
156
177
  if (field?.required && !notFields.includes(field.code)) {
157
178
  if (!user[field?.code]) {
158
- errors.push(t(`VALIDATION_ERROR_${field.code.toUpperCase()}_REQUIRED`, `The field ${field?.name} is required`))
179
+ _requiredFields.push(field?.code)
159
180
  }
160
181
  }
161
182
  })
@@ -166,8 +187,9 @@ const MultiCheckoutUI = (props: any) => {
166
187
  validationFields?.fields?.checkout?.cellphone?.required) ||
167
188
  configs?.verification_phone_required?.value === '1')
168
189
  ) {
169
- errors.push(t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Phone number is required'))
190
+ _requiredFields.push('cellphone')
170
191
  }
192
+ setRequiredFields(_requiredFields)
171
193
 
172
194
  if (phoneUpdate) {
173
195
  errors.push(t('NECESSARY_UPDATE_COUNTRY_PHONE_CODE', 'It is necessary to update your phone number'))
@@ -181,10 +203,19 @@ const MultiCheckoutUI = (props: any) => {
181
203
  }
182
204
 
183
205
  const handlePlaceOrder = (confirmPayment?: any) => {
184
- if (!userErrors.length) {
206
+ if (stripePaymethods.includes(paymethodSelected?.gateway) && user?.guest_id) {
207
+ setOpenModal({ ...openModal, signup: true, isGuest: true })
208
+ return
209
+ }
210
+
211
+ if (!userErrors.length && (!requiredFields?.length || allowedGuest)) {
185
212
  handleGroupPlaceOrder && handleGroupPlaceOrder(confirmPayment)
186
213
  return
187
214
  }
215
+ if (requiredFields?.length) {
216
+ setIsOpen(true)
217
+ return
218
+ }
188
219
  let stringError = ''
189
220
  Object.values(userErrors).map((item: any, i: number) => {
190
221
  stringError += (i + 1) === userErrors.length ? `- ${item?.message || item}` : `- ${item?.message || item}\n`
@@ -193,6 +224,36 @@ const MultiCheckoutUI = (props: any) => {
193
224
  setIsUserDetailsEdit(true)
194
225
  }
195
226
 
227
+ const handlePlaceOrderAsGuest = () => {
228
+ setIsOpen(false)
229
+ handleGroupPlaceOrder && handleGroupPlaceOrder()
230
+ }
231
+
232
+ const handleSuccessSignup = (user: any) => {
233
+ login({
234
+ user,
235
+ token: user?.session?.access_token
236
+ })
237
+ openModal?.isGuest && handlePlaceOrderAsGuest()
238
+ setOpenModal({ ...openModal, signup: false, isGuest: false })
239
+ }
240
+
241
+ const handleSuccessLogin = (user: any) => {
242
+ if (user) setOpenModal({ ...openModal, login: false })
243
+ }
244
+
245
+ const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
246
+ setShowTitle(contentOffset.y > 30)
247
+ }
248
+
249
+ const handleGoBack = () => {
250
+ if (navigation?.canGoBack()) {
251
+ navigation.goBack()
252
+ } else {
253
+ navigation.navigate('BottomTab', { screen: 'Cart' })
254
+ }
255
+ }
256
+
196
257
  useEffect(() => {
197
258
  if (validationFields && validationFields?.fields?.checkout) {
198
259
  checkValidationFields()
@@ -231,17 +292,58 @@ const MultiCheckoutUI = (props: any) => {
231
292
  }
232
293
  }, [paymethodSelected])
233
294
 
295
+ const changeActiveState = useCallback((isClosed: boolean, uuid: string) => {
296
+ const isActive = cartsOpened?.includes?.(uuid)
297
+ if (isActive || !isClosed) {
298
+ setCartsOpened(cartsOpened?.filter?.((_uuid) => _uuid !== uuid))
299
+ } else {
300
+ setCartsOpened([
301
+ ...cartsOpened,
302
+ uuid
303
+ ])
304
+ }
305
+ }, [cartsOpened])
306
+
234
307
  return (
235
308
  <>
236
- <Container noPadding>
309
+ <SafeAreaView style={{ backgroundColor: theme.colors.backgroundPage }}>
310
+ <View style={styles.wrapperNavbar}>
311
+ <TopHeader>
312
+ <>
313
+ <TopActions onPress={() => handleGoBack()}>
314
+ <IconAntDesign
315
+ name='arrowleft'
316
+ size={26}
317
+ />
318
+ </TopActions>
319
+ {showTitle && (
320
+ <OText
321
+ size={16}
322
+ style={{ flex: 1, textAlign: 'center', right: 15 }}
323
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
324
+ numberOfLines={2}
325
+ ellipsizeMode='tail'
326
+ >
327
+ {t('CHECKOUT', 'Checkout')}
328
+ </OText>
329
+ )}
330
+ </>
331
+ </TopHeader>
332
+ </View>
333
+ </SafeAreaView>
334
+ <Container pt={0} noPadding onScroll={handleScroll} showsVerticalScrollIndicator={false}>
237
335
  <View style={styles.wrapperNavbar}>
238
336
  <NavBar
337
+ hideArrowLeft
239
338
  title={t('CHECKOUT', 'Checkout')}
240
339
  titleAlign={'center'}
241
340
  onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
242
341
  showCall={false}
243
342
  paddingTop={Platform.OS === 'ios' ? 0 : 4}
244
343
  btnStyle={{ paddingLeft: 0 }}
344
+ titleWrapStyle={{ paddingHorizontal: 0 }}
345
+ titleStyle={{ marginRight: 0, marginLeft: 0 }}
346
+ style={{ marginTop: 20 }}
245
347
  />
246
348
  </View>
247
349
  <ChContainer style={styles.pagePadding}>
@@ -285,15 +387,45 @@ const MultiCheckoutUI = (props: any) => {
285
387
 
286
388
  <ChSection>
287
389
  <ChUserDetails>
288
- <UserDetails
289
- isUserDetailsEdit={isUserDetailsEdit}
290
- useValidationFields
291
- useDefualtSessionManager
292
- useSessionUser
293
- isCheckout
294
- phoneUpdate={phoneUpdate}
295
- togglePhoneUpdate={togglePhoneUpdate}
296
- />
390
+ {(user?.guest_id && !allowedGuest) ? (
391
+ <View>
392
+ <OText size={14} numberOfLines={1} ellipsizeMode='tail' color={theme.colors.textNormal}>
393
+ {t('CUSTOMER_DETAILS', 'Customer details')}
394
+ </OText>
395
+ <OButton
396
+ text={t('SIGN_UP', 'Sign up')}
397
+ textStyle={{ color: theme.colors.white }}
398
+ style={{ borderRadius: 7.6, marginTop: 20 }}
399
+ onClick={() => setOpenModal({ ...openModal, signup: true })}
400
+ />
401
+ <OButton
402
+ text={t('LOGIN', 'Login')}
403
+ textStyle={{ color: theme.colors.primary }}
404
+ bgColor={theme.colors.white}
405
+ borderColor={theme.colors.primary}
406
+ style={{ borderRadius: 7.6, marginTop: 20 }}
407
+ onClick={() => setOpenModal({ ...openModal, login: true })}
408
+ />
409
+ <OButton
410
+ text={t('CONTINUE_AS_GUEST', 'Continue as guest')}
411
+ textStyle={{ color: theme.colors.black }}
412
+ bgColor={theme.colors.white}
413
+ borderColor={theme.colors.black}
414
+ style={{ borderRadius: 7.6, marginTop: 20 }}
415
+ onClick={() => setAllowedGuest(true)}
416
+ />
417
+ </View>
418
+ ) : (
419
+ <UserDetails
420
+ isUserDetailsEdit={isUserDetailsEdit}
421
+ useValidationFields
422
+ useDefualtSessionManager
423
+ useSessionUser
424
+ isCheckout
425
+ phoneUpdate={phoneUpdate}
426
+ togglePhoneUpdate={togglePhoneUpdate}
427
+ />
428
+ )}
297
429
  </ChUserDetails>
298
430
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
299
431
  </ChSection>
@@ -403,6 +535,9 @@ const MultiCheckoutUI = (props: any) => {
403
535
  hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
404
536
  onNavigationRedirect={(route: string, params: any) => props.navigation.navigate(route, params)}
405
537
  businessConfigs={cart?.business?.configs}
538
+ cartsOpened={cartsOpened}
539
+ changeActiveState={changeActiveState}
540
+ isActive={cartsOpened?.includes?.(cart?.uuid)}
406
541
  />
407
542
  {openCarts.length > 1 && (
408
543
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
@@ -484,6 +619,58 @@ const MultiCheckoutUI = (props: any) => {
484
619
  </OText>
485
620
  )}
486
621
  </ChContainer>
622
+ <OModal
623
+ open={openModal.signup}
624
+ onClose={() => setOpenModal({ ...openModal, signup: false, isGuest: false })}
625
+ >
626
+ <ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
627
+ <SignupForm
628
+ handleSuccessSignup={handleSuccessSignup}
629
+ isGuest
630
+ signupButtonText={t('SIGNUP', 'Signup')}
631
+ useSignupByEmail
632
+ useChekoutFileds
633
+ />
634
+ </ScrollView>
635
+ </OModal>
636
+ <OModal
637
+ open={openModal.login}
638
+ onClose={() => setOpenModal({ ...openModal, login: false })}
639
+ >
640
+ <ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
641
+ <LoginForm
642
+ handleSuccessLogin={handleSuccessLogin}
643
+ isGuest
644
+ loginButtonText={t('LOGIN', 'Login')}
645
+ loginButtonBackground={theme.colors.primary}
646
+ />
647
+ </ScrollView>
648
+ </OModal>
649
+ <OModal
650
+ open={isOpen}
651
+ onClose={() => setIsOpen(false)}
652
+ >
653
+ <View style={styles.detailWrapper}>
654
+ <UserDetails
655
+ isUserDetailsEdit
656
+ useValidationFields
657
+ useDefualtSessionManager
658
+ useSessionUser
659
+ isCheckout
660
+ isEdit
661
+ phoneUpdate={phoneUpdate}
662
+ togglePhoneUpdate={togglePhoneUpdate}
663
+ requiredFields={requiredFields}
664
+ hideUpdateButton
665
+ handlePlaceOrderAsGuest={handlePlaceOrderAsGuest}
666
+ onClose={() => {
667
+ setIsOpen(false)
668
+ handlePlaceOrder()
669
+ }}
670
+ setIsOpen={setIsOpen}
671
+ />
672
+ </View>
673
+ </OModal>
487
674
  </Container>
488
675
 
489
676
  <FloatingButton
@@ -1,5 +1,22 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
+ export const TopActions = styled.TouchableOpacity`
4
+ height: 60px;
5
+ justify-content: center;
6
+ min-width: 30px;
7
+ padding-right: 15px;
8
+ `;
9
+
10
+ export const TopHeader = styled.View`
11
+ width: 100%;
12
+ flex-direction: row;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ z-index: 1;
16
+ height: 60px;
17
+ min-height: 60px;
18
+ `
19
+
3
20
  export const ChContainer = styled.View`
4
21
  margin-bottom: 60px;
5
22
  `