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,222 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import Spinner from 'react-native-loading-spinner-overlay';
3
- import MaterialComIcon from 'react-native-vector-icons/MaterialCommunityIcons'
4
- import { Platform, SafeAreaView, StyleSheet, TouchableOpacity, View } from 'react-native'
5
- import {
6
- UpsellingPage as UpsellingPageController,
7
- useUtils,
8
- useLanguage,
9
- } from 'ordering-components/native'
10
- import { useTheme } from 'styled-components/native';
11
- import { OText, OIcon, OModal, OBottomPopup, OButton } from '../shared'
12
- import { UpsellingProductsParams } from '../../types'
13
- import {
14
- Container,
15
- UpsellingContainer,
16
- Item,
17
- Details,
18
- AddButton,
19
- CloseUpselling,
20
- TopBar,
21
- TopActions
22
- } from './styles'
23
- import { ProductForm } from '../ProductForm';
24
- import { OrderSummary } from '../OrderSummary';
25
- import { ScrollView } from 'react-native-gesture-handler';
26
- import NavBar from '../NavBar';
27
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
28
-
29
- const UpsellingProductsUI = (props: UpsellingProductsParams) => {
30
- const {
31
- isCustomMode,
32
- upsellingProducts,
33
- business,
34
- cart,
35
- handleUpsellingPage,
36
- handleCloseUpsellingPage,
37
- openUpselling,
38
- canOpenUpselling,
39
- setCanOpenUpselling
40
- } = props
41
-
42
- const theme = useTheme();
43
-
44
-
45
- const styles = StyleSheet.create({
46
- imageStyle: {
47
- width: 73,
48
- height: 73,
49
- resizeMode: 'cover',
50
- borderRadius: 7.6,
51
- },
52
- closeUpsellingButton: {
53
- borderRadius: 7.6,
54
- borderColor: theme.colors.primary,
55
- backgroundColor: theme.colors.primary,
56
- borderWidth: 1,
57
- height: 44,
58
- marginBottom: 10,
59
- shadowOpacity: 0
60
- },
61
- cancelBtn: {
62
- paddingHorizontal: 18,
63
- borderWidth: 1,
64
- borderRadius: 7.6,
65
- borderColor: theme.colors.textSecondary,
66
- height: 38
67
- }
68
- })
69
-
70
- const [actualProduct, setActualProduct] = useState<any>(null)
71
- const [modalIsOpen, setModalIsOpen] = useState(false)
72
- const [{ parsePrice }] = useUtils()
73
- const [, t] = useLanguage()
74
- const { bottom } = useSafeAreaInsets()
75
-
76
- useEffect(() => {
77
- if (!isCustomMode) {
78
- if (!upsellingProducts.loading) {
79
- setCanOpenUpselling && setCanOpenUpselling(true)
80
- }
81
- // if ((!upsellingProducts?.products?.length && !upsellingProducts.loading && !canOpenUpselling && openUpselling) ||
82
- // (!upsellingProducts?.products?.length && !upsellingProducts.loading && openUpselling)) {
83
- // handleUpsellingPage && handleUpsellingPage()
84
- // }
85
- }
86
- }, [upsellingProducts.loading, upsellingProducts?.products.length])
87
-
88
- const handleFormProduct = (product: any) => {
89
- setActualProduct(product)
90
- setModalIsOpen(true)
91
- }
92
-
93
- const handleSaveProduct = () => {
94
- setActualProduct(null)
95
- setModalIsOpen(false)
96
- }
97
-
98
- const UpsellingLayout = () => {
99
- return (
100
- <Container>
101
- <UpsellingContainer
102
- horizontal
103
- showsHorizontalScrollIndicator={false}
104
- contentContainerStyle={{ paddingHorizontal: Platform.OS === 'ios' ? 40 : 0 }}
105
- >
106
- {
107
- !upsellingProducts.loading && (
108
- <>
109
- {
110
- !upsellingProducts.error ? upsellingProducts.products.map((product: any) => (
111
- <Item key={product.id}>
112
- <View style={{ flexBasis: '57%' }}>
113
- <Details>
114
- <OText size={12} lineHeight={18} numberOfLines={1} ellipsizeMode='tail'>{product.name}</OText>
115
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>{parsePrice(product.price)}</OText>
116
- </Details>
117
- <AddButton onPress={() => handleFormProduct(product)}>
118
- <OText size={10} color={theme.colors.primary}>{t('ADD', 'Add')}</OText>
119
- </AddButton>
120
- </View>
121
- <View style={{}}>
122
- <OIcon url={product.images} style={styles.imageStyle} />
123
- </View>
124
- </Item>
125
- )) : (
126
- <OText>
127
- {upsellingProducts.message}
128
- </OText>
129
- )
130
- }
131
- </>
132
- )
133
- }
134
- </UpsellingContainer>
135
- </Container>
136
- )
137
- }
138
-
139
- return (
140
- <>
141
- {isCustomMode ? (
142
- <UpsellingLayout />
143
- ) : (
144
- <>
145
- {!canOpenUpselling ? null : (
146
- <>
147
- {!modalIsOpen && (
148
- <OBottomPopup
149
- title={''}
150
- open={openUpselling}
151
- onClose={() => handleUpsellingPage()}
152
- >
153
- <TopBar style={{ paddingTop: Platform.OS == 'ios' ? 10 : 30 }}>
154
- <TopActions onPress={() => handleCloseUpsellingPage()}>
155
- <OIcon src={theme.images.general.arrow_left} width={20} />
156
- </TopActions>
157
- {/* <TopActions style={styles.cancelBtn} onPress={() => handleCloseUpsellingPage()}>
158
- <OText size={12} color={theme.colors.textSecondary}>{t('CANCEL', 'Cancel')}</OText>
159
- </TopActions> */}
160
- </TopBar>
161
- <ScrollView style={{ marginBottom: bottom + (Platform.OS == 'ios' ? 46 : 70) }} showsVerticalScrollIndicator={false}>
162
- <View style={{ paddingHorizontal: 40 }}>
163
- <OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
164
- <OrderSummary
165
- cart={cart}
166
- isCartPending={cart?.status === 2}
167
- />
168
- </View>
169
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40, marginBottom: 23 }} />
170
- <View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
171
- {upsellingProducts?.products?.length > 0 &&
172
- <>
173
- <OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
174
- <UpsellingLayout />
175
- </>
176
- }
177
- <CloseUpselling>
178
- <OButton
179
- imgRightSrc=''
180
- text={t('CHECKOUT', 'Checkout')}
181
- style={styles.closeUpsellingButton}
182
- textStyle={{ color: theme.colors.white, fontSize: 14 }}
183
- onClick={() => handleUpsellingPage()}
184
- />
185
- </CloseUpselling>
186
- </View>
187
- </ScrollView>
188
- </OBottomPopup>
189
- )}
190
- </>
191
- )}
192
- </>
193
- )}
194
- <OModal
195
- open={modalIsOpen}
196
- onClose={() => setModalIsOpen(false)}
197
- entireModal
198
- customClose
199
- >
200
- {actualProduct && (
201
- <ProductForm
202
- product={actualProduct}
203
- businessId={actualProduct?.api?.businessId}
204
- businessSlug={business.slug}
205
- onSave={() => handleSaveProduct()}
206
- onClose={() => setModalIsOpen(false)}
207
- />
208
- )}
209
- </OModal>
210
- </>
211
- )
212
- }
213
-
214
- export const UpsellingProducts = (props: UpsellingProductsParams) => {
215
- const upsellingProductsProps = {
216
- ...props,
217
- UIComponent: UpsellingProductsUI
218
- }
219
- return (
220
- <UpsellingPageController {...upsellingProductsProps} />
221
- )
222
- }
@@ -1,50 +0,0 @@
1
- import styled from 'styled-components/native'
2
-
3
- export const Container = styled.View`
4
- margin: 20px 0;
5
- margin-start: -40px;
6
- margin-end: -40px;
7
- `
8
- export const UpsellingContainer = styled.ScrollView`
9
- max-height: 92px;
10
- `
11
- export const Item = styled.View`
12
- border-width: 1px;
13
- border-color: ${(props: any) => props.theme.colors.border};
14
- border-radius: 7.6px;
15
- flex-direction: row;
16
- align-items: flex-start;
17
- justify-content: space-between;
18
- padding: 10px;
19
- margin-right: 12px;
20
- min-width: 207px;
21
- max-width: 207px;
22
- width: 207px;
23
- `
24
- export const Details = styled.View`
25
- align-items: flex-start;
26
- justify-content: center;
27
- `
28
- export const AddButton = styled.TouchableOpacity`
29
- padding: 4px 8px;
30
- background-color: ${(props: any) => props.theme.colors.primaryContrast};
31
- border-radius: 30px;
32
- width: 40%;
33
- align-items: center;
34
- margin-top: 6px;
35
- `
36
- export const CloseUpselling = styled.View`
37
- margin-vertical: 10px;
38
- width: 100%;
39
- `
40
- export const TopBar = styled.View`
41
- flex-direction: row;
42
- justify-content: space-between;
43
- align-items: center;
44
- min-height: 50px;
45
- padding-horizontal: 40px;
46
- `
47
- export const TopActions = styled.TouchableOpacity`
48
- height: 44px;
49
- justify-content: center;
50
- `;
@@ -1,134 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { TouchableOpacity, View } from 'react-native';
3
- import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
4
-
5
- import { UDContainer, UDHeader, UDForm, UDInfo, EditBtn } from './styles';
6
-
7
- import {
8
- UserFormDetails as UserFormController,
9
- useLanguage,
10
- useSession,
11
- } from 'ordering-components/native';
12
- import { useTheme } from 'styled-components/native';
13
- import { OIcon, OText } from '../shared';
14
-
15
- import { UserFormDetailsUI } from '../UserFormDetails';
16
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
17
-
18
- const UserDetailsUI = (props: any) => {
19
- const {
20
- isEdit,
21
- formState,
22
- cleanFormState,
23
- cartStatus,
24
- toggleIsEdit,
25
- validationFields,
26
- isUserDetailsEdit,
27
- phoneUpdate,
28
- togglePhoneUpdate
29
- } = props
30
-
31
- const theme = useTheme();
32
-
33
- const [, t] = useLanguage()
34
- const [{ user }] = useSession()
35
- const userData = props.userData || (!formState.result.error && formState.result?.result) || user
36
-
37
-
38
- useEffect(() => {
39
- if (isUserDetailsEdit) {
40
- !isEdit && toggleIsEdit()
41
- }
42
- }, [isUserDetailsEdit])
43
-
44
- const toggleEditState = () => {
45
- toggleIsEdit()
46
- cleanFormState({ changes: {} })
47
- }
48
-
49
- useEffect(() => {
50
- if (user?.cellphone && !user?.country_phone_code) {
51
- togglePhoneUpdate(true)
52
- } else {
53
- togglePhoneUpdate(false)
54
- }
55
- }, [user?.country_phone_code])
56
-
57
- return (
58
- <>
59
- {(validationFields.loading || formState.loading) && (
60
- <Placeholder Animation={Fade}>
61
- <PlaceholderLine height={20} width={70} />
62
- <PlaceholderLine height={15} width={60} />
63
- <PlaceholderLine height={15} width={60} />
64
- <PlaceholderLine height={15} width={80} style={{ marginBottom: 20 }} />
65
- </Placeholder>
66
- )}
67
-
68
- {!(validationFields.loading || formState.loading) && (
69
- <UDContainer>
70
- <UDHeader>
71
- <OText size={16} lineHeight={24} weight={'500'}>
72
- {t('CUSTOMER_DETAILS', 'Customer Details')}
73
- </OText>
74
- {cartStatus !== 2 && (
75
- !isEdit ? (
76
- <EditBtn onPress={() => toggleIsEdit()} activeOpacity={0.7}>
77
- <OIcon
78
- src={theme.images.general.pencil}
79
- width={16}
80
- height={16}
81
- color={theme.colors.editColor}
82
- style={{ marginBottom: 10, marginLeft: 5 }}
83
- />
84
- </EditBtn>
85
- ) : (
86
- <EditBtn onPress={() => toggleEditState()} activeOpacity={0.7}>
87
- <OIcon
88
- src={theme.images.general.close}
89
- color={theme.colors.cancelColor}
90
- width={16}
91
- height={16}
92
- style={{ marginBottom: 5, marginLeft: 5 }}
93
- />
94
- </EditBtn>
95
- )
96
- )}
97
- </UDHeader>
98
-
99
- {!isEdit ? (
100
- <UDInfo>
101
- <OText size={12} lineHeight={18} weight={'400'}>
102
- {userData?.name} {userData?.middle_name} {userData?.lastname} {userData?.second_lastname}
103
- </OText>
104
- <OText size={12} lineHeight={18} weight={'400'}>
105
- {userData?.email}
106
- </OText>
107
- {!!(userData?.cellphone || user?.cellphone) && (
108
- <>
109
- <OText size={12} lineHeight={18} weight={'400'}>
110
- {(userData?.country_phone_code) && `+${(userData?.country_phone_code)} `}{(userData?.cellphone)}
111
- </OText>
112
- {!!phoneUpdate && (
113
- <OText color={theme.colors.error} style={{ textAlign: 'center' }}>{t('NECESSARY_UPDATE_COUNTRY_PHONE_CODE', 'It is necessary to update your phone number')}</OText>
114
- )}
115
- </>
116
- )}
117
- </UDInfo>
118
- ) : (
119
- <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} />
120
- )}
121
- </UDContainer>
122
- )}
123
- </>
124
- )
125
- }
126
-
127
- export const UserDetails = (props: any) => {
128
- const userDetailsProps = {
129
- ...props,
130
- UIComponent: UserDetailsUI
131
- }
132
-
133
- return <UserFormController {...userDetailsProps} />
134
- }
@@ -1,26 +0,0 @@
1
- import styled, { css } from 'styled-components/native';
2
-
3
- export const UDContainer = styled.View``
4
-
5
- export const UDHeader = styled.View`
6
- flex-direction: row;
7
- align-items: center;
8
- `
9
-
10
- export const UDForm = styled.View`
11
- width: 100%;
12
- /* margin-top: 25px; */
13
- `
14
-
15
- export const UDInfo = styled.View`
16
- display: flex;
17
- flex-direction: column;
18
- width: 100%;
19
- text-align: left;
20
- `
21
- export const EditBtn = styled.TouchableOpacity`
22
- align-items: center;
23
- justify-content: center;
24
- padding-top: 9px;
25
- width: 40px;
26
- `;