ordering-ui-react-native 0.12.57 → 0.12.58

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 (175) hide show
  1. package/package.json +1 -1
  2. package/themes/single-business/src/components/Cart/index.tsx +91 -15
  3. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  4. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  5. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  6. package/themes/franchises/index.tsx +0 -111
  7. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  8. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  9. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  10. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  11. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  12. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  13. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  14. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  15. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  16. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  17. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  18. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  19. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  20. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  21. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  22. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  23. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  24. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  25. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  26. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  27. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  28. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  29. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  30. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  31. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  32. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  33. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  34. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  35. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  36. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  37. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  38. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  39. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  40. package/themes/franchises/src/components/Cart/index.tsx +0 -332
  41. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  42. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  43. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  44. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  45. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  46. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  47. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  48. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  49. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  50. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  51. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  52. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  53. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  54. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  55. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  56. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  57. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  58. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  59. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  60. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  61. package/themes/franchises/src/components/Help/index.tsx +0 -56
  62. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  63. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  64. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  65. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  66. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  67. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  68. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  69. package/themes/franchises/src/components/Home/index.tsx +0 -102
  70. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  71. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  72. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  73. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  74. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  75. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  76. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  77. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  78. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  79. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  80. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  81. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  82. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  83. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  84. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  85. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  86. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  87. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  88. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  89. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -828
  90. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  91. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -266
  92. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  93. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  94. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  95. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  96. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  97. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  98. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  99. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  100. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  101. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  102. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  103. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  104. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  105. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  106. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  107. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  108. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  109. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  110. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  111. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  112. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  113. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  114. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  115. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  116. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  117. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  118. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  119. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  120. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  121. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  122. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  123. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  124. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  125. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  126. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  127. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  128. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  129. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  130. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  131. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  132. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  133. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  134. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  135. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  136. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  137. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  138. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  139. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  140. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  141. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  142. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  143. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  144. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  145. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  146. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  147. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  148. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  149. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  150. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  151. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  152. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  153. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  154. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  155. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  156. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  157. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  158. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  159. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  160. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  161. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  162. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  163. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  164. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  165. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  166. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  167. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  168. package/themes/franchises/src/components/shared/index.tsx +0 -29
  169. package/themes/franchises/src/config/constants.tsx +0 -57
  170. package/themes/franchises/src/layouts/Container.tsx +0 -23
  171. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  172. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  173. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  174. package/themes/franchises/src/types/index.tsx +0 -445
  175. 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,266 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { ActivityIndicator, 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 { OInput, 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
- commentState,
39
- handleChangeComment
40
- } = props;
41
-
42
- const theme = useTheme()
43
- const [, t] = useLanguage();
44
- const [{ configs }] = useConfig();
45
- const [orderState] = useOrder();
46
- const [{ parsePrice, parseNumber }] = useUtils();
47
- const [validationFields] = useValidationFields();
48
- const [openProduct, setModalIsOpen] = useState(false)
49
- const [curProduct, setCurProduct] = useState<any>(null)
50
- const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null })
51
-
52
- const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled;
53
-
54
- const handleDeleteClick = (product: any) => {
55
- removeProduct(product, cart)
56
- }
57
-
58
- const handleEditProduct = (product: any) => {
59
- setCurProduct(product)
60
- setModalIsOpen(true)
61
- }
62
-
63
- const handlerProductAction = (product: any) => {
64
- if (Object.keys(product).length) {
65
- setModalIsOpen(false)
66
- }
67
- }
68
-
69
- const getIncludedTaxes = () => {
70
- if (cart?.taxes === null) {
71
- return cart.business.tax_type === 1 ? cart?.tax : 0
72
- } else {
73
- return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
74
- return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
75
- }, 0)
76
- }
77
- }
78
-
79
- return (
80
- <OSContainer>
81
- {cart?.products?.length > 0 && (
82
- <>
83
- <OSProductList>
84
- {cart?.products.map((product: any) => (
85
- <ProductItemAccordion
86
- key={product.code}
87
- product={product}
88
- isCartPending={isCartPending}
89
- isCartProduct
90
- changeQuantity={changeQuantity}
91
- getProductMax={getProductMax}
92
- offsetDisabled={offsetDisabled}
93
- onDeleteProduct={handleDeleteClick}
94
- onEditProduct={handleEditProduct}
95
- isFromCheckout={isFromCheckout}
96
- />
97
- ))}
98
- </OSProductList>
99
- {cart?.valid && (
100
- <OSBill>
101
- <OSTable>
102
- <OText size={12}>{t('SUBTOTAL', 'Subtotal')}</OText>
103
- <OText size={12}>{parsePrice(cart?.subtotal + getIncludedTaxes())}</OText>
104
- </OSTable>
105
- {cart?.discount > 0 && cart?.total >= 0 && (
106
- <OSTable>
107
- {cart?.discount_type === 1 ? (
108
- <OText size={12}>
109
- {t('DISCOUNT', 'Discount')}
110
- <OText size={12}>{`(${verifyDecimals(cart?.discount_rate, parsePrice)}%)`}</OText>
111
- </OText>
112
- ) : (
113
- <OText size={12}>{t('DISCOUNT', 'Discount')}</OText>
114
- )}
115
- <OText size={12}>- {parsePrice(cart?.discount || 0)}</OText>
116
- </OSTable>
117
- )}
118
- {
119
- cart?.taxes?.length > 0 && cart?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
120
- <OSTable key={tax?.id}>
121
- <OSRow>
122
- <OText size={12} numberOfLines={1}>
123
- {tax?.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
124
- {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
125
- </OText>
126
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax })} >
127
- <AntIcon name='exclamationcircleo' size={20} color={theme.colors.primary} />
128
- </TouchableOpacity>
129
- </OSRow>
130
- <OText size={12}>{parsePrice(tax?.summary?.tax || 0)}</OText>
131
- </OSTable>
132
- ))
133
- }
134
- {
135
- cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
136
- <OSTable key={fee.id}>
137
- <OSRow>
138
- <OText size={12} numberOfLines={1}>
139
- {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
140
- ({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
141
- </OText>
142
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })} >
143
- <AntIcon name='exclamationcircleo' size={20} color={theme.colors.primary} />
144
- </TouchableOpacity>
145
- </OSRow>
146
- <OText size={12}>{parsePrice(fee?.summary?.fixed + fee?.summary?.percentage || 0)}</OText>
147
- </OSTable>
148
- ))
149
- }
150
- {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
151
- <OSTable>
152
- <OText size={12}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
153
- <OText size={12}>{parsePrice(cart?.delivery_price)}</OText>
154
- </OSTable>
155
- )}
156
- {cart?.driver_tip > 0 && (
157
- <OSTable>
158
- <OText size={12}>
159
- {t('DRIVER_TIP', 'Driver tip')}
160
- {cart?.driver_tip_rate > 0 &&
161
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
162
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
163
- (
164
- `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
165
- )}
166
- </OText>
167
- <OText size={12}>{parsePrice(cart?.driver_tip)}</OText>
168
- </OSTable>
169
- )}
170
- {isCouponEnabled && !isCartPending && (
171
- <View>
172
- <View style={{ paddingVertical: 5 }}>
173
- <CouponControl
174
- businessId={cart.business_id}
175
- price={cart.total}
176
- />
177
- </View>
178
- </View>
179
- )}
180
- {cart?.total >= 1 && (
181
- <View style={{ marginTop: 15, borderTopWidth: 1, borderTopColor: '#d9d9d9' }}>
182
- <OSTable style={{ marginTop: 15 }}>
183
- <OText size={14} style={{ fontWeight: 'bold' }}>
184
- {t('TOTAL', 'Total')}
185
- </OText>
186
- <OText size={14} style={{ fontWeight: 'bold' }} >
187
- {parsePrice(cart?.total)}
188
- </OText>
189
- </OSTable>
190
- </View>
191
- )}
192
- {cart?.status !== 2 && (
193
- <OSTable>
194
- <View style={{ width: '100%', marginTop: 20 }}>
195
- <OText size={12}>{t('COMMENTS', 'Comments')}</OText>
196
- <View style={{ flex: 1, width: '100%' }}>
197
- <OInput
198
- value={cart?.comment}
199
- placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
200
- onChange={(value: string) => handleChangeComment(value)}
201
- style={{
202
- alignItems: 'flex-start',
203
- width: '100%',
204
- height: 100,
205
- borderColor: theme.colors.textSecondary,
206
- paddingRight: 50,
207
- marginTop: 10
208
- }}
209
- multiline
210
- />
211
- {commentState?.loading && (
212
- <View style={{ position: 'absolute', right: 20 }}>
213
- <ActivityIndicator
214
- size='large'
215
- style={{ height: 100 }}
216
- color={theme.colors.primary}
217
- />
218
- </View>
219
- )}
220
- </View>
221
- </View>
222
- </OSTable>
223
- )}
224
- </OSBill>
225
- )}
226
- <OModal
227
- open={openProduct}
228
- entireModal
229
- customClose
230
- onClose={() => setModalIsOpen(false)}
231
- >
232
- <ProductForm
233
- isCartProduct
234
- productCart={curProduct}
235
- businessSlug={cart?.business?.slug}
236
- businessId={cart?.business_id}
237
- categoryId={curProduct?.category_id}
238
- productId={curProduct?.id}
239
- onSave={handlerProductAction}
240
- onClose={() => setModalIsOpen(false)}
241
- isFromCheckout={isFromCheckout}
242
- />
243
- </OModal>
244
- <OModal
245
- open={openTaxModal.open}
246
- onClose={() => setOpenTaxModal({ open: false, data: null })}
247
- entireModal
248
- >
249
- <TaxInformation data={openTaxModal.data} products={cart.products} />
250
- </OModal>
251
- </>
252
- )}
253
- </OSContainer>
254
- )
255
- }
256
-
257
- export const OrderSummary = (props: any) => {
258
- const orderSummaryProps = {
259
- ...props,
260
- UIComponent: OrderSummaryUI
261
- }
262
-
263
- return (
264
- <Cart {...orderSummaryProps} />
265
- )
266
- }
@@ -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
- `;