ordering-ui-react-native 0.12.55 → 0.12.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
  7. package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
  8. package/themes/business/src/layouts/Container.tsx +3 -1
  9. package/themes/doordash/src/components/Cart/index.tsx +37 -2
  10. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  11. package/themes/doordash/src/components/OrderSummary/index.tsx +37 -3
  12. package/themes/doordash/src/layouts/Container.tsx +1 -1
  13. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  14. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  15. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  16. package/themes/instacart/src/layouts/Container.tsx +1 -1
  17. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  18. package/themes/original/src/components/Cart/index.tsx +268 -234
  19. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  20. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  21. package/themes/original/src/layouts/Container.tsx +1 -1
  22. package/themes/single-business/src/components/Cart/index.tsx +127 -16
  23. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  24. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  25. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  26. package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
  27. package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
  28. package/themes/single-business/src/layouts/Container.tsx +1 -1
  29. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  30. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  31. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  32. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
  33. package/themes/franchises/index.tsx +0 -111
  34. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  35. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  36. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  37. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  38. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  39. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  40. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  41. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  42. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  43. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  44. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  45. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  46. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  47. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  48. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  49. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  50. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  51. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  52. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  53. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  54. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  55. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  56. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  57. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  58. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  59. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  60. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  61. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  62. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  63. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  64. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  65. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  66. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  67. package/themes/franchises/src/components/Cart/index.tsx +0 -298
  68. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  69. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  70. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  71. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  72. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  73. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  74. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  75. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  76. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  77. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  78. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  79. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  80. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  81. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  82. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  83. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  84. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  85. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  86. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  87. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  88. package/themes/franchises/src/components/Help/index.tsx +0 -56
  89. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  90. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  91. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  92. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  93. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  94. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  95. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  96. package/themes/franchises/src/components/Home/index.tsx +0 -102
  97. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  98. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  99. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  100. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  101. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  102. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  103. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  104. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  105. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  106. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  107. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  108. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  109. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  110. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  111. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  112. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  113. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  114. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  115. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  116. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
  117. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  118. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
  119. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  120. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  121. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  122. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  123. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  124. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  125. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  126. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  127. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  128. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  129. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  130. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  131. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  132. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  133. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  134. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  135. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  136. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  137. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  138. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  139. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  140. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  141. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  142. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  143. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  144. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  145. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  146. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  147. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  148. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  149. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  150. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  151. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  152. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  153. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  154. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  155. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  156. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  157. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  158. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  159. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  160. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  161. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  162. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  163. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  164. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  165. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  166. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  167. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  168. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  169. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  170. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  171. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  172. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  173. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  174. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  175. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  176. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  177. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  178. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  179. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  180. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  181. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  182. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  183. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  184. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  185. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  186. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  187. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  188. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  189. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  190. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  191. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  192. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  193. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  194. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  195. package/themes/franchises/src/components/shared/index.tsx +0 -29
  196. package/themes/franchises/src/config/constants.tsx +0 -57
  197. package/themes/franchises/src/layouts/Container.tsx +0 -23
  198. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  199. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  200. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  201. package/themes/franchises/src/types/index.tsx +0 -445
  202. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -1,120 +0,0 @@
1
- import styled from 'styled-components/native'
2
-
3
- export const OrderDetailsContainer = styled.ScrollView`
4
-
5
- `
6
-
7
- export const NavBack = styled.TouchableOpacity`
8
-
9
- `
10
-
11
-
12
- export const Header = styled.View`
13
- padding: 10px 40px;
14
- flex: 1;
15
- `
16
-
17
- export const Logo = styled.View`
18
- margin-right: 20px;
19
- `
20
-
21
- export const OrderContent = styled.View`
22
- `
23
-
24
- export const OrderBusiness = styled.View`
25
- position: relative;
26
- padding-vertical: 10px;
27
- padding-horizontal: 40px;
28
- background-color: ${(props: any) => props.theme.colors.white};
29
- align-items: flex-start;
30
- `
31
- export const Icons = styled.View`
32
- flex-direction: row;
33
- align-items: center;
34
- `
35
-
36
- export const OrderInfo = styled.View`
37
- padding: 10px 0;
38
- flex: 1;
39
- `
40
-
41
- export const OrderData = styled.View`
42
-
43
- `
44
-
45
-
46
- export const OrderStatus = styled.View`
47
- padding: 20px;
48
- align-items: center;
49
- width: 35%;
50
- flex-wrap: wrap;
51
- `
52
-
53
- export const StaturBar = styled.View`
54
- margin-top: 30px;
55
- margin-bottom: 18px;
56
- `
57
-
58
- export const StatusImage = styled.View`
59
-
60
- `
61
-
62
- export const SectionTitle = styled.View`
63
-
64
- `
65
-
66
- export const OrderCustomer = styled.View`
67
- padding: 20px 40px 10px;
68
- background-color: ${(props: any) => props.theme.colors.white};
69
- `
70
-
71
- export const OrderDriver = styled(OrderCustomer)``
72
-
73
- export const Customer = styled.View`
74
- flex-direction: row;
75
- align-items: center;
76
- `
77
-
78
- export const CustomerPhoto = styled.View`
79
- margin-right: 20px;
80
- `
81
-
82
- export const InfoBlock = styled.View`
83
- width: 100%;
84
- `
85
-
86
- export const HeaderInfo = styled.View`
87
- flex: 1;
88
- background-color: ${(props: any) => props.theme.colors.backgroundGray100};
89
- padding: 20px 40px;
90
- `
91
-
92
- export const OrderProducts = styled(OrderCustomer)``
93
-
94
- export const Table = styled.View`
95
- flex-direction: row;
96
- justify-content: space-between;
97
- flex: 1;
98
- align-items: center;
99
- padding-bottom: 10px;
100
- `
101
-
102
- export const OrderBill = styled.View`
103
- padding-horizontal: 40px;
104
- padding-vertical: 10px;
105
- flex: 1;
106
- background-color: ${(props: any) => props.theme.colors.white};
107
- `
108
-
109
- export const Total = styled.View`
110
- border-top-width: 1px;
111
- border-top-color: ${(props: any) => props.theme.colors.border};
112
- padding-vertical: 10px
113
- `
114
-
115
- export const Map = styled.View`
116
- width: 100%;
117
- height: 250px;
118
- margin-top: 20px;
119
- border-radius: 20px
120
- `
@@ -1,232 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { TouchableOpacity, View } from 'react-native'
3
- import {
4
- Cart,
5
- useOrder,
6
- useLanguage,
7
- useUtils,
8
- useConfig,
9
- useValidationFields,
10
- } from 'ordering-components/native';
11
-
12
- import {
13
- OSContainer,
14
- OSProductList,
15
- OSBill,
16
- OSTable,
17
- OSRow
18
- } from './styles';
19
-
20
- import { ProductItemAccordion } from '../ProductItemAccordion';
21
- import { CouponControl } from '../CouponControl';
22
- import { OModal, OText } from '../shared';
23
- import { ProductForm } from '../ProductForm';
24
- import { verifyDecimals } from '../../utils';
25
- import { TaxInformation } from '../TaxInformation';
26
- import AntIcon from 'react-native-vector-icons/AntDesign'
27
- import { useTheme } from 'styled-components/native';
28
-
29
- const OrderSummaryUI = (props: any) => {
30
- const {
31
- cart,
32
- changeQuantity,
33
- getProductMax,
34
- offsetDisabled,
35
- removeProduct,
36
- isCartPending,
37
- isFromCheckout
38
- } = props;
39
-
40
- const theme = useTheme()
41
- const [, t] = useLanguage();
42
- const [{ configs }] = useConfig();
43
- const [orderState] = useOrder();
44
- const [{ parsePrice, parseNumber }] = useUtils();
45
- const [validationFields] = useValidationFields();
46
- const [openProduct, setModalIsOpen] = useState(false)
47
- const [curProduct, setCurProduct] = useState<any>(null)
48
- const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null })
49
-
50
- const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled;
51
-
52
- const handleDeleteClick = (product: any) => {
53
- removeProduct(product, cart)
54
- }
55
-
56
- const handleEditProduct = (product: any) => {
57
- setCurProduct(product)
58
- setModalIsOpen(true)
59
- }
60
-
61
- const handlerProductAction = (product: any) => {
62
- if (Object.keys(product).length) {
63
- setModalIsOpen(false)
64
- }
65
- }
66
-
67
- const getIncludedTaxes = () => {
68
- if (cart?.taxes === null) {
69
- return cart.business.tax_type === 1 ? cart?.tax : 0
70
- } else {
71
- return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
72
- return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
73
- }, 0)
74
- }
75
- }
76
-
77
- return (
78
- <OSContainer>
79
- {cart?.products?.length > 0 && (
80
- <>
81
- <OSProductList>
82
- {cart?.products.map((product: any) => (
83
- <ProductItemAccordion
84
- key={product.code}
85
- product={product}
86
- isCartPending={isCartPending}
87
- isCartProduct
88
- changeQuantity={changeQuantity}
89
- getProductMax={getProductMax}
90
- offsetDisabled={offsetDisabled}
91
- onDeleteProduct={handleDeleteClick}
92
- onEditProduct={handleEditProduct}
93
- isFromCheckout={isFromCheckout}
94
- />
95
- ))}
96
- </OSProductList>
97
- {cart?.valid && (
98
- <OSBill>
99
- <OSTable>
100
- <OText size={12}>{t('SUBTOTAL', 'Subtotal')}</OText>
101
- <OText size={12}>{parsePrice(cart?.subtotal + getIncludedTaxes())}</OText>
102
- </OSTable>
103
- {cart?.discount > 0 && cart?.total >= 0 && (
104
- <OSTable>
105
- {cart?.discount_type === 1 ? (
106
- <OText size={12}>
107
- {t('DISCOUNT', 'Discount')}
108
- <OText size={12}>{`(${verifyDecimals(cart?.discount_rate, parsePrice)}%)`}</OText>
109
- </OText>
110
- ) : (
111
- <OText size={12}>{t('DISCOUNT', 'Discount')}</OText>
112
- )}
113
- <OText size={12}>- {parsePrice(cart?.discount || 0)}</OText>
114
- </OSTable>
115
- )}
116
- {
117
- cart?.taxes?.length > 0 && cart?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
118
- <OSTable key={tax?.id}>
119
- <OSRow>
120
- <OText size={12} numberOfLines={1}>
121
- {tax?.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
122
- {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
123
- </OText>
124
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax })} >
125
- <AntIcon name='exclamationcircleo' size={20} color={theme.colors.primary} />
126
- </TouchableOpacity>
127
- </OSRow>
128
- <OText size={12}>{parsePrice(tax?.summary?.tax || 0)}</OText>
129
- </OSTable>
130
- ))
131
- }
132
- {
133
- cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
134
- <OSTable key={fee.id}>
135
- <OSRow>
136
- <OText size={12} numberOfLines={1}>
137
- {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
138
- ({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
139
- </OText>
140
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })} >
141
- <AntIcon name='exclamationcircleo' size={20} color={theme.colors.primary} />
142
- </TouchableOpacity>
143
- </OSRow>
144
- <OText size={12}>{parsePrice(fee?.summary?.fixed + fee?.summary?.percentage || 0)}</OText>
145
- </OSTable>
146
- ))
147
- }
148
- {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
149
- <OSTable>
150
- <OText size={12}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
151
- <OText size={12}>{parsePrice(cart?.delivery_price)}</OText>
152
- </OSTable>
153
- )}
154
- {cart?.driver_tip > 0 && (
155
- <OSTable>
156
- <OText size={12}>
157
- {t('DRIVER_TIP', 'Driver tip')}
158
- {cart?.driver_tip_rate > 0 &&
159
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
160
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
161
- (
162
- `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
163
- )}
164
- </OText>
165
- <OText size={12}>{parsePrice(cart?.driver_tip)}</OText>
166
- </OSTable>
167
- )}
168
- {isCouponEnabled && !isCartPending && (
169
- <View>
170
- <View style={{ paddingVertical: 5 }}>
171
- <CouponControl
172
- businessId={cart.business_id}
173
- price={cart.total}
174
- />
175
- </View>
176
- </View>
177
- )}
178
- {cart?.total >= 1 && (
179
- <View style={{ marginTop: 15, borderTopWidth: 1, borderTopColor: '#d9d9d9' }}>
180
- <OSTable style={{ marginTop: 15 }}>
181
- <OText size={14} style={{ fontWeight: 'bold' }}>
182
- {t('TOTAL', 'Total')}
183
- </OText>
184
- <OText size={14} style={{ fontWeight: 'bold' }} >
185
- {parsePrice(cart?.total)}
186
- </OText>
187
- </OSTable>
188
- </View>
189
- )}
190
- </OSBill>
191
- )}
192
- <OModal
193
- open={openProduct}
194
- entireModal
195
- customClose
196
- onClose={() => setModalIsOpen(false)}
197
- >
198
- <ProductForm
199
- isCartProduct
200
- productCart={curProduct}
201
- businessSlug={cart?.business?.slug}
202
- businessId={cart?.business_id}
203
- categoryId={curProduct?.category_id}
204
- productId={curProduct?.id}
205
- onSave={handlerProductAction}
206
- onClose={() => setModalIsOpen(false)}
207
- isFromCheckout={isFromCheckout}
208
- />
209
- </OModal>
210
- <OModal
211
- open={openTaxModal.open}
212
- onClose={() => setOpenTaxModal({ open: false, data: null })}
213
- entireModal
214
- >
215
- <TaxInformation data={openTaxModal.data} products={cart.products} />
216
- </OModal>
217
- </>
218
- )}
219
- </OSContainer>
220
- )
221
- }
222
-
223
- export const OrderSummary = (props: any) => {
224
- const orderSummaryProps = {
225
- ...props,
226
- UIComponent: OrderSummaryUI
227
- }
228
-
229
- return (
230
- <Cart {...orderSummaryProps} />
231
- )
232
- }
@@ -1,41 +0,0 @@
1
- import styled from 'styled-components/native';
2
-
3
- export const OSContainer = styled.View`
4
- width: 100%;
5
- display: flex;
6
- flex-direction: column;
7
- justify-content: center;
8
- `
9
-
10
- export const OSProductList = styled.View``
11
-
12
- export const OSBill = styled.View`
13
- padding: 14px 0px 20px;
14
- border-top-width: 1px;
15
- border-top-color: ${(props: any) => props.theme.colors.border};
16
- margin-top: 20px;
17
- `
18
-
19
- export const OSTable = styled.View`
20
- flex-direction: row;
21
- justify-content: space-between;
22
- align-items: center;
23
- padding-vertical: 5px;
24
- `
25
-
26
- export const OSTotal = styled.View`
27
- border-top-width: 1px;
28
- border-top-color: #d9d9d9;
29
- margin-top: 15px;
30
- `
31
-
32
- export const OSCoupon = styled.View`
33
- width: 100%;
34
- padding: 5px 0px;
35
- `
36
-
37
- export const OSRow = styled.View`
38
- flex-direction: row;
39
- overflow: hidden;
40
- width: 80%;
41
- `
@@ -1,92 +0,0 @@
1
- import React from 'react'
2
- import {
3
- OrderTypeControl,
4
- useLanguage,
5
- useOrder,
6
- } from 'ordering-components/native'
7
- import { useTheme } from 'styled-components/native';
8
- import { Platform, View } from 'react-native'
9
- import { BgImage, ListWrapper, MaskCont, OrderTypeWrapper, Wrapper } from './styles'
10
- import { OrderTypeSelectParams } from '../../types'
11
- import { OIcon, OText } from '../shared'
12
- import NavBar from '../NavBar';
13
- import { ORDER_TYPES } from '../../config/constants';
14
-
15
- const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
16
- const {
17
- navigation,
18
- handleChangeOrderType,
19
- typeSelected,
20
- defaultValue,
21
- configTypes,
22
- orderTypes
23
- } = props
24
-
25
- const theme = useTheme();
26
- const [orderState] = useOrder();
27
- const [, t] = useLanguage();
28
- const _orderTypes = orderTypes.filter((type: any) => configTypes?.includes(type.value));
29
-
30
- const items = _orderTypes.map((type) => {
31
- return {
32
- value: type.value,
33
- label: t(type.content, type.content),
34
- description: t(type.description, 'Lorem ipsum dolor sit amet, consectetur.')
35
- }
36
- })
37
-
38
- const goToBack = () => !orderState?.loading && navigation?.canGoBack() && navigation.goBack();
39
-
40
- const handleChangeOrderTypeCallback = (orderType: number) => {
41
- if (!orderState.loading) {
42
- handleChangeOrderType(orderType)
43
- }
44
- }
45
-
46
- return (
47
- <Wrapper>
48
- <NavBar
49
- onActionLeft={() => goToBack()}
50
- btnStyle={{ paddingLeft: 0 }}
51
- paddingTop={0}
52
- style={{ paddingBottom: 0 }}
53
- title={t('HOW_WILL_YOUR_ORDER_TYPE', 'How will your order type?')}
54
- titleAlign={'center'}
55
- titleStyle={{ fontSize: 14 }}
56
- />
57
- {
58
- items.length > 0 && (
59
- <ListWrapper>
60
- {
61
- items.map((item: any, idx: number) =>
62
- <OrderTypeWrapper key={idx} disabled={orderState.loading} onPress={() => handleChangeOrderTypeCallback(item.value)}>
63
- <BgImage source={theme.images.orderTypes[`type${item?.value || 1}`]} resizeMode={'cover'} style={{opacity: item?.value == typeSelected || typeSelected === undefined ? 1 : 0.4}}>
64
- <MaskCont>
65
- <OText size={12} lineHeight={18} color={theme.colors.white} weight={Platform.OS === 'android' ? 'bold' : '600'}>{item?.label}</OText>
66
- <OText size={10} lineHeight={15} color={theme.colors.white}>{item?.description}</OText>
67
- <View style={{flexDirection: 'row', alignItems: 'center'}}>
68
- <OText size={10} lineHeight={15} color={theme.colors.white}>{t('START_MY_ORDER', 'Start my order')}</OText>
69
- <OIcon src={theme.images.general.arrow_left} width={16} color={theme.colors.white} style={{transform: [{ rotate: '180deg' }], marginStart: 4}} />
70
- </View>
71
- </MaskCont>
72
- </BgImage>
73
- </OrderTypeWrapper>
74
- )
75
- }
76
- </ListWrapper>
77
- )
78
- }
79
- </Wrapper>
80
- )
81
- }
82
-
83
- export const OrderTypeSelector = (props: any) => {
84
-
85
- const orderTypeProps = {
86
- ...props,
87
- UIComponent: OrderTypeSelectorUI,
88
- orderTypes: props.orderType || ORDER_TYPES
89
- }
90
-
91
- return <OrderTypeControl {...orderTypeProps} />
92
- }
@@ -1,27 +0,0 @@
1
- import styled from 'styled-components/native'
2
-
3
- export const OrderTypeWrapper = styled.TouchableOpacity`
4
- height: 100px;
5
- min-height: 100px;
6
- border-radius: 7.6px;
7
- overflow: hidden;
8
- margin-bottom: 24px;
9
- `
10
- export const Wrapper = styled.View`
11
- flex: 1;
12
- `;
13
-
14
- export const ListWrapper = styled.View`
15
- margin-top: 20px;
16
- `;
17
-
18
- export const BgImage = styled.ImageBackground`
19
- width: 100%;
20
- height: 100px;
21
- `;
22
- export const MaskCont = styled.View`
23
- justify-content: center;
24
- padding: 16px 39px;
25
- background-color: #0000004D;
26
- height: 100%;
27
- `;