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
@@ -1,43 +0,0 @@
1
- import React, { useEffect } from 'react'
2
- import { BusinessesListing as BusinessListingController } from '../components/BusinessesListing'
3
- import styled from 'styled-components/native'
4
- import { useTheme } from 'styled-components/native'
5
-
6
- const BusinessesListing = (props: any) => {
7
- const theme = useTheme()
8
- const businessId = props.route.params?.businessId
9
- const categoryId = props.route.params?.categoryId
10
- const productId = props.route.params?.productId
11
- const store = props.route.params?.store
12
-
13
- useEffect(() => {
14
- if (store) {
15
- props.navigation.navigate('Business', { store, businessId, categoryId, productId })
16
- return
17
- }
18
- }, [businessId, categoryId, productId, store])
19
-
20
- const BusinessesListingProps = {
21
- ...props,
22
- navigation: props?.navigation,
23
- isSearchByName: true,
24
- isSearchByDescription: true,
25
- propsToFetch: ['id', 'name', 'header', 'logo', 'ribbon', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
26
- onBusinessClick: (business: any) => {
27
- props.navigation.navigate('Business', { store: store || business.slug, header: business.header, logo: business.logo })
28
- }
29
- }
30
-
31
- const BusinessListView = styled.SafeAreaView`
32
- flex: 1;
33
- background-color: ${theme.colors.backgroundPage};
34
- `
35
-
36
- return (
37
- <BusinessListView>
38
- <BusinessListingController {...BusinessesListingProps} />
39
- </BusinessListView>
40
- )
41
- }
42
-
43
- export default BusinessesListing
@@ -1,49 +0,0 @@
1
- import * as React from 'react';
2
- import { useFocusEffect } from '@react-navigation/native'
3
- import styled from 'styled-components/native';
4
- import { useOrder } from 'ordering-components/native';
5
- import { Platform } from 'react-native';
6
- import { CartContent } from '../components/CartContent';
7
- import { Container } from '../layouts/Container'
8
-
9
- const KeyboardView = styled.KeyboardAvoidingView`
10
- flex-grow: 1;
11
- `;
12
-
13
- interface Props {
14
- navigation: any;
15
- route: any;
16
- }
17
-
18
- const CartList = (props: Props) => {
19
- const [{ carts }, { refreshOrderOptions }] = useOrder();
20
- const cartsList = (carts && Object.values(carts).filter((cart: any) => cart.products.length > 0)) || []
21
-
22
- useFocusEffect(
23
- React.useCallback(() => {
24
- refreshOrderOptions()
25
- }, [props.navigation])
26
- )
27
-
28
- const cartProps = {
29
- ...props,
30
- carts: cartsList,
31
- isOrderStateCarts: !!carts,
32
- onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
33
- }
34
-
35
- return (
36
- <>
37
- <KeyboardView
38
- enabled
39
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
40
- >
41
- <Container>
42
- <CartContent {...cartProps} />
43
- </Container>
44
- </KeyboardView>
45
- </>
46
- );
47
- };
48
-
49
- export default CartList;
@@ -1,101 +0,0 @@
1
- import React from 'react';
2
- import { Platform } from 'react-native';
3
- import { Checkout } from '../components/Checkout';
4
-
5
- import { initStripe, useConfirmPayment } from '@stripe/stripe-react-native';
6
- import styled from 'styled-components/native';
7
-
8
- import { useOrder, useLanguage, ToastType, useToast } from 'ordering-components/native';
9
-
10
- const stripePaymentOptions = ['stripe', 'stripe_direct', 'stripe_connect', 'google_pay', 'apple_pay'];
11
-
12
- const KeyboardView = styled.KeyboardAvoidingView`
13
- flex: 1;
14
- `;
15
-
16
- export const CheckoutPage = (props: any) => {
17
- const [, { showToast }] = useToast();
18
- const [, t] = useLanguage();
19
- const [orderState, { confirmCart, changeMoment }] = useOrder();
20
- const { confirmPayment, loading: confirmPaymentLoading } = useConfirmPayment();
21
- const checkoutProps = {
22
- ...props,
23
- cartUuid: props?.cartUuid || props.route?.params?.cartUuid,
24
- businessLogo: props.route?.params?.businessLogo,
25
- businessName: props.route?.params?.businessName,
26
- cartTotal: props.route?.params?.cartTotal,
27
- stripePaymentOptions,
28
- onPlaceOrderClick: async (data: any, paymethod: any, cart: any) => {
29
- if (cart?.order?.uuid) {
30
- if (orderState?.options?.moment) {
31
- changeMoment(null);
32
- }
33
- props.navigation.navigate('OrderDetails', { orderId: cart.order?.uuid, isFromCheckout: true });
34
- return
35
- }
36
-
37
- if (cart?.status === 2 && stripePaymentOptions.includes(paymethod?.gateway)) {
38
- const clientSecret = cart?.paymethod_data?.result?.client_secret;
39
- const paymentMethodId = paymethod?.gateway === 'stripe_connect'
40
- ? cart.paymethod_data?.result?.payment_method_id
41
- : cart.paymethod_data?.data?.source_id
42
- const stripeAccountId = paymethod?.paymethod?.credentials?.user;
43
- const publicKey = paymethod?.paymethod?.credentials?.publishable;
44
-
45
- try {
46
- const stripeParams = stripeAccountId
47
- ? { publishableKey: publicKey, stripeAccountId: stripeAccountId}
48
- : { publishableKey: publicKey };
49
- initStripe(stripeParams);
50
- } catch (error: any) {
51
- showToast(ToastType.Error, error?.toString() || error.message)
52
- }
53
-
54
- try {
55
- const { paymentIntent, error } = await confirmPayment(clientSecret, {
56
- type: 'Card',
57
- paymentMethodId
58
- });
59
-
60
- if (error) {
61
- showToast(ToastType.Error, error.message)
62
- }
63
-
64
- props.handleIsRedirect && props.handleIsRedirect(true);
65
- try {
66
- const confirmCartRes = await confirmCart(cart?.uuid)
67
- if (confirmCartRes.error) {
68
- showToast(ToastType.Error, confirmCartRes.error.message)
69
- }
70
- if (confirmCartRes.result.order?.uuid) {
71
- props.navigation.navigate('OrderDetails', { orderId: confirmCartRes.result.order.uuid, isFromCheckout: true })
72
- return
73
- }
74
- } catch (error: any) {
75
- showToast(ToastType.Error, error?.toString() || error.message)
76
- }
77
- return
78
- } catch (error: any) {
79
- const e = error?.message?.toLowerCase() === 'failed'
80
- ? t('FAILED_PAYMENT', 'The payment has failed')
81
- : error?.toString() || error.message
82
- showToast(ToastType.Error, e)
83
- }
84
- }
85
- },
86
- onNavigationRedirect: (page: string, params: any) => {
87
- if (!page) return
88
- props.navigation.navigate(page, params);
89
- }
90
- }
91
- return (
92
- <KeyboardView
93
- enabled
94
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
95
- >
96
- <Checkout {...checkoutProps} />
97
- </KeyboardView>
98
- )
99
- }
100
-
101
- export default CheckoutPage;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import { Platform } from 'react-native';
3
- import styled from 'styled-components/native';
4
- import { ForgotPasswordForm } from '../components/ForgotPasswordForm';
5
- import { Container } from '../layouts/Container';
6
-
7
- const KeyboardView = styled.KeyboardAvoidingView`
8
- flex: 1;
9
- `;
10
-
11
- export const ForgotPassword = (props: any) => {
12
- return (
13
- <KeyboardView
14
- enabled
15
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
16
- >
17
- <Container>
18
- <ForgotPasswordForm {...props} />
19
- </Container>
20
- </KeyboardView>
21
- )
22
- }
23
-
24
- export default ForgotPassword;
@@ -1,23 +0,0 @@
1
- import React from 'react'
2
- import { Container } from '../layouts/Container'
3
- import { Help as HelpController } from '../components/Help'
4
-
5
-
6
- interface Props {
7
- navigation: any;
8
- route: any;
9
- }
10
-
11
- const Help = (props: Props) => {
12
- const helpProps = {
13
- ...props
14
- }
15
-
16
- return (
17
- <Container>
18
- <HelpController {...helpProps} />
19
- </Container>
20
- )
21
- }
22
-
23
- export default Help
@@ -1,23 +0,0 @@
1
- import React from 'react'
2
- import { Container } from '../layouts/Container'
3
- import { HelpAccountAndPayment as HelpAccountAndPaymentController } from '../components/HelpAccountAndPayment'
4
-
5
-
6
- interface Props {
7
- navigation: any;
8
- route: any;
9
- }
10
-
11
- const HelpAccountAndPayment = (props: Props) => {
12
- const helpAccountAndPaymentProps = {
13
- ...props
14
- }
15
-
16
- return (
17
- <Container>
18
- <HelpAccountAndPaymentController {...helpAccountAndPaymentProps} />
19
- </Container>
20
- )
21
- }
22
-
23
- export default HelpAccountAndPayment
@@ -1,23 +0,0 @@
1
- import React from 'react'
2
- import { Container } from '../layouts/Container'
3
- import { HelpGuide as HelpGuideController } from '../components/HelpGuide'
4
-
5
-
6
- interface Props {
7
- navigation: any;
8
- route: any;
9
- }
10
-
11
- const HelpGuide = (props: Props) => {
12
- const helpGuideProps = {
13
- ...props
14
- }
15
-
16
- return (
17
- <Container>
18
- <HelpGuideController {...helpGuideProps} />
19
- </Container>
20
- )
21
- }
22
-
23
- export default HelpGuide
@@ -1,23 +0,0 @@
1
- import React from 'react'
2
- import { Container } from '../layouts/Container'
3
- import { HelpOrder as HelpOrderController } from '../components/HelpOrder'
4
-
5
-
6
- interface Props {
7
- navigation: any;
8
- route: any;
9
- }
10
-
11
- const HelpOrder = (props: Props) => {
12
- const helpOrderProps = {
13
- ...props
14
- }
15
-
16
- return (
17
- <Container>
18
- <HelpOrderController {...helpOrderProps} />
19
- </Container>
20
- )
21
- }
22
-
23
- export default HelpOrder
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- import { StyleSheet, SafeAreaView } from 'react-native';
3
- import { Home as HomePage } from '../components/Home';
4
- import { useTheme } from 'styled-components/native';
5
-
6
- export const Home = (props: any) => {
7
- const theme = useTheme();
8
-
9
- const homeProps = {
10
- ...props,
11
- onNavigationRedirect: (page: string, params: any) => {
12
- if (!page) return
13
- props.navigation.navigate(page, params);
14
- },
15
- }
16
-
17
- const styles = StyleSheet.create({
18
- wrapper: {
19
- flex: 1,
20
- display: 'flex',
21
- flexDirection: 'column',
22
- justifyContent: 'center',
23
- alignItems: 'center',
24
- height: '100%',
25
- backgroundColor: theme.colors.backgroundPage,
26
- }
27
- })
28
-
29
- return (
30
- <SafeAreaView style={styles.wrapper}>
31
- <HomePage {...homeProps} />
32
- </SafeAreaView>
33
- );
34
- };
35
-
36
- export default Home;
@@ -1,170 +0,0 @@
1
- import React from 'react';
2
- import {View, Text, Image, StyleSheet, StatusBar} from 'react-native';
3
- import AppIntroSlider from 'react-native-app-intro-slider';
4
- import { _setStoreData } from '../providers/StoreUtil';
5
- import { useTheme } from 'styled-components/native';
6
- import { useLanguage } from 'ordering-components/native';
7
-
8
-
9
- const IntroductoryTutorial = ({ navigation, route }: any) => {
10
- const [, t] = useLanguage();
11
- const theme = useTheme()
12
- const setTutorial = route?.params?.setTutorial
13
- const data = [
14
- {
15
- title: t('DELIVERY_BY_ADDRESS', 'Delivery by Address'),
16
- text: t('DELIVERY_BY_ADDRESS_INST', 'DELIVERY_BY_ADDRESS_INST'),
17
- image: theme.images.tutorials.slide1,
18
- bg: theme.colors.primaryContrast
19
- },
20
- {
21
- title: t('SELECT_A_BUSINESS', 'SELECT_A_BUSINESS'),
22
- text: t('SELECT_A_BUSINESS_INST', 'SELECT_A_BUSINESS_INST'),
23
- image: theme.images.tutorials.slide2,
24
- bg: theme.colors.primaryContrast
25
- },
26
- {
27
- title: t('BUSINESS_MENU', 'BUSINESS_MENU'),
28
- text: t('BUSINESS_MENU_INST', 'BUSINESS_MENU_INST'),
29
- image: theme.images.tutorials.slide3,
30
- bg: theme.colors.primaryContrast
31
- },
32
- {
33
- title: t('PRODUCT_LIST', 'PRODUCT_LIST'),
34
- text: t('PRODUCT_LIST_INST', 'PRODUCT_LIST_INST'),
35
- image: theme.images.tutorials.slide4,
36
- bg: theme.colors.primaryContrast
37
- },
38
- {
39
- title: t('CHECKOUT_SCREEN', 'CHECKOUT_SCREEN'),
40
- text: t('CHECKOUT_SCREEN_INST', 'CHECKOUT_SCREEN_INST'),
41
- image: theme.images.tutorials.slide5,
42
- bg: theme.colors.primaryContrast
43
- },
44
- {
45
- title: t('TUTORIAL_ORDER_COMPLETED', 'TUTORIAL_ORDER_COMPLETED'),
46
- text: t('TUTORIAL_ORDER_COMPLETED_INST', 'TUTORIAL_ORDER_COMPLETED_INST'),
47
- image: theme.images.tutorials.slide6,
48
- bg: theme.colors.primaryContrast
49
- },
50
- ];
51
- type Item = typeof data[0];
52
- const styles = StyleSheet.create({
53
- slide: {
54
- flex: 1,
55
- alignItems: 'center',
56
- justifyContent: 'center',
57
- paddingBottom: 80,
58
- },
59
- image: {
60
- flex: 0,
61
- top: 30,
62
- width: '100%',
63
- height: '75%',
64
- resizeMode: 'contain',
65
- },
66
- text: {
67
- color: theme.colors.colorTextTutorial,
68
- textAlign: 'center',
69
- fontSize: 17,
70
- paddingRight: '2%',
71
- paddingLeft: '2%',
72
- top: '4%',
73
- },
74
- title: {
75
- top: '2%',
76
- fontSize: 25,
77
- color: theme.colors.colorTextTutorial,
78
- textAlign: 'center',
79
- },
80
- buttonCircle: {
81
- top: '15%',
82
- width: 50,
83
- height: 40,
84
- justifyContent: 'center',
85
- alignItems: 'center',
86
- position:'relative'
87
- },
88
- tutorialText: {
89
- fontSize: 18,
90
- fontWeight: '300',
91
- color: theme.colors.primary
92
- }
93
- });
94
-
95
- const _renderItem = ({item}: {item: Item}) => {
96
- return (
97
- <View
98
- style={[
99
- styles.slide,
100
- {
101
- backgroundColor: item.bg,
102
- },
103
- ]}>
104
- <Text style={styles.title}>{item.title}</Text>
105
- <Text style={styles.text}>{item.text}</Text>
106
- <Image source={item.image} style={styles.image} />
107
- </View>
108
- );
109
- };
110
-
111
- const RenderNextButton = () => {
112
- return (
113
- <View style={styles.buttonCircle}>
114
- <Text style={styles.tutorialText}>{t('TUTORIAL_NEXT', 'Next')}</Text>
115
- </View>
116
- );
117
- };
118
-
119
- const RenderSkipButton = () => {
120
- return (
121
- <View style={styles.buttonCircle}>
122
- <Text style={styles.tutorialText}>{t('TUTORIAL_SKIP', 'Skip')}</Text>
123
- </View>
124
- );
125
- };
126
-
127
- const RenderPrevButton = () => {
128
- return (
129
- <View style={styles.buttonCircle}>
130
- <Text style={styles.tutorialText}>{t('TUTORIAL_BACK', 'Back')}</Text>
131
- </View>
132
- );
133
- };
134
-
135
- const RenderDoneButton = () => {
136
- return (
137
- <View style={styles.buttonCircle}>
138
- <Text style={styles.tutorialText}>{t('TUTORIAL_DONE', 'Done')}</Text>
139
- </View>
140
- );
141
- }
142
-
143
- const _onDone = () => {
144
- setTutorial(false)
145
- _setStoreData('isTutorial', false)
146
- }
147
-
148
- const _keyExtractor = (item: Item) => item.title;
149
-
150
- return (
151
- <View style={{flex: 1}}>
152
- <StatusBar translucent backgroundColor="transparent" />
153
- <AppIntroSlider
154
- keyExtractor={_keyExtractor}
155
- renderItem={_renderItem}
156
- data={data}
157
- onDone={_onDone}
158
- activeDotStyle= {{backgroundColor: theme.colors.primary}}
159
- renderDoneButton={RenderDoneButton}
160
- renderNextButton={RenderNextButton}
161
- renderSkipButton={RenderSkipButton}
162
- renderPrevButton={RenderPrevButton}
163
- showSkipButton
164
- showPrevButton
165
- />
166
- </View>
167
- );
168
-
169
- }
170
- export default IntroductoryTutorial;
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { Platform } from 'react-native';
3
- import styled from 'styled-components/native';
4
- import { LoginForm } from '../components/LoginForm';
5
- import { Container } from '../layouts/Container';
6
-
7
- import { useLanguage } from 'ordering-components/native';
8
- import { _setStoreData } from '../providers/StoreUtil';
9
- import { useTheme } from 'styled-components/native';
10
-
11
- const KeyboardView = styled.KeyboardAvoidingView`
12
- flex: 1;
13
- `;
14
-
15
- export const Login = ({ navigation, route }: any) => {
16
- const [, t] = useLanguage()
17
- const theme = useTheme()
18
-
19
- const loginProps = {
20
- navigation,
21
- useLoginByCellphone: true,
22
- loginButtonText: t('LOGIN', 'Login'),
23
- loginButtonBackground: theme.colors.primary,
24
- forgotButtonText: t('FORGOT_YOUR_PASSWORD', 'Forgot your password?'),
25
- registerButtonText: t('SIGNUP', 'Signup'),
26
- onNavigationRedirect: (page: string) => {
27
- if (!page) return
28
- navigation.navigate(page);
29
- },
30
- notificationState: route?.params?.notification_state
31
- }
32
-
33
- _setStoreData('notification_state', route?.params?.notification_state);
34
-
35
- return (
36
- <KeyboardView
37
- enabled
38
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
39
- >
40
- <Container>
41
- <LoginForm {...loginProps} />
42
- </Container>
43
- </KeyboardView>
44
- );
45
- };
46
-
47
- export default Login;
@@ -1,30 +0,0 @@
1
- import React from 'react'
2
- import { useConfig } from 'ordering-components/native'
3
- import { MomentOption as MomentOptionController } from '../components/MomentOption'
4
-
5
- const MomentOption = ({ navigation, props }: any) => {
6
- const [{ configs }] = useConfig()
7
- const limitDays = configs?.max_days_preorder?.value
8
- const currentDate = new Date()
9
- const time = limitDays > 1
10
- ? currentDate.getTime() + ((limitDays - 1) * 24 * 60 * 60 * 1000)
11
- : limitDays === 1 ? currentDate.getTime() : currentDate.getTime() + (6 * 24 * 60 * 60 * 1000)
12
-
13
- currentDate.setTime(time)
14
- currentDate.setHours(23)
15
- currentDate.setMinutes(59)
16
- const momentOptionProps = {
17
- ...props,
18
- navigation: navigation,
19
- maxDate: currentDate
20
- }
21
- return (
22
- <>
23
- {currentDate && (
24
- <MomentOptionController {...momentOptionProps} />
25
- )}
26
- </>
27
- )
28
- }
29
-
30
- export default MomentOption
@@ -1,31 +0,0 @@
1
- import React from 'react'
2
- import { Platform, KeyboardAvoidingView, StyleSheet } from 'react-native'
3
- import { MultiCheckout as MultiCheckoutController } from '../../themes/original/src/components/MultiCheckout'
4
-
5
- const MultiCheckout = (props: any) => {
6
- const multiCheckoutProps = {
7
- ...props,
8
- onPlaceOrderClick: (orderUuids: any) => {
9
- props.navigation.navigate('MultiOrdersDetails', { orderUuids: orderUuids, isFromMultiCheckout: true })
10
- }
11
- }
12
-
13
- return (
14
- <KeyboardAvoidingView
15
- enabled
16
- behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
17
- style={styles.container}
18
- >
19
- <MultiCheckoutController {...multiCheckoutProps} />
20
- </KeyboardAvoidingView>
21
- )
22
- }
23
-
24
- const styles = StyleSheet.create({
25
- container: {
26
- flexGrow: 1,
27
- paddingBottom: 70,
28
- },
29
- });
30
-
31
- export default MultiCheckout
@@ -1,27 +0,0 @@
1
- import React from 'react'
2
- import { Platform } from 'react-native'
3
- import { MultiOrdersDetails as MultiOrdersDetailsController } from '../../themes/original/src/components/MultiOrdersDetails'
4
- import styled from 'styled-components/native';
5
-
6
- const SafeAreaContainer = styled.SafeAreaView`
7
- flex: 1;
8
- background-color: ${(props: any) => props.theme.colors.backgroundPage};
9
- padding-top: ${Platform.OS === 'ios' ? '0px' : '24px'};
10
- `;
11
-
12
- const MultiOrdersDetails = ({ navigation, route }: any) => {
13
- const multiOrdersDetailsProps = {
14
- navigation,
15
- orderUuids: route.params?.orderUuids || [],
16
- isFromMultiCheckout: route.params?.isFromMultiCheckout,
17
- onRedirectPage: () => navigation.navigate('BusinessList')
18
- }
19
-
20
- return (
21
- <SafeAreaContainer>
22
- <MultiOrdersDetailsController {...multiOrdersDetailsProps} />
23
- </SafeAreaContainer>
24
- )
25
- }
26
-
27
- export default MultiOrdersDetails