ordering-ui-react-native 0.15.99 → 0.16.0-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.
- package/package.json +8 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessController/index.tsx +10 -8
- package/src/components/BusinessInformation/index.tsx +22 -0
- package/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/DriverTips/index.tsx +11 -6
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +120 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +7 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +145 -61
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/StripeMethodForm/index.tsx +1 -2
- package/src/components/UpsellingProducts/index.tsx +1 -1
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/components/shared/OModal.tsx +1 -1
- package/src/index.tsx +2 -0
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/theme.json +0 -1
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/types/index.tsx +15 -9
- package/src/utils/index.tsx +0 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +1 -1
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +42 -34
- package/themes/business/src/components/DriverMap/index.tsx +12 -8
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +1 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -18
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OModal.tsx +41 -38
- package/themes/business/src/types/index.tsx +14 -9
- package/themes/business/src/utils/index.tsx +10 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessMenu/index.tsx +2 -1
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
- package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +70 -31
- package/themes/kiosk/src/components/Checkout/index.tsx +18 -3
- package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +1 -1
- package/themes/kiosk/src/components/ProductForm/index.tsx +6 -7
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +3 -0
- package/themes/original/index.tsx +22 -0
- package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
- package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
- package/themes/original/src/components/AddressForm/index.tsx +137 -134
- package/themes/original/src/components/AddressList/index.tsx +2 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +302 -160
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +179 -96
- package/themes/original/src/components/BusinessController/styles.tsx +5 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +106 -126
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
- package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +66 -73
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +289 -178
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -38
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +673 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +102 -464
- package/themes/original/src/components/Cart/index.tsx +82 -37
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +107 -67
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- package/themes/original/src/components/DriverTips/index.tsx +11 -6
- package/themes/original/src/components/Favorite/index.tsx +92 -0
- package/themes/original/src/components/Favorite/styles.tsx +22 -0
- package/themes/original/src/components/FavoriteList/index.tsx +317 -0
- package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +25 -17
- package/themes/original/src/components/GoogleMap/index.tsx +21 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
- package/themes/original/src/components/HelpGuide/index.tsx +8 -3
- package/themes/original/src/components/HelpOrder/index.tsx +8 -3
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
- package/themes/original/src/components/LoginForm/index.tsx +86 -43
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +304 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +262 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +132 -27
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +136 -57
- package/themes/original/src/components/OrderDetails/styles.tsx +5 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +73 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +8 -2
- package/themes/original/src/components/OrderSummary/index.tsx +2 -35
- package/themes/original/src/components/OrderTypeSelector/index.tsx +84 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +140 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +56 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +143 -47
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +15 -23
- package/themes/original/src/components/PaymentOptions/index.tsx +57 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
- package/themes/original/src/components/ProductForm/index.tsx +697 -649
- package/themes/original/src/components/ProductForm/styles.tsx +9 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +38 -25
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +298 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +13 -5
- package/themes/original/src/components/ServiceForm/index.tsx +579 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/SignupForm/index.tsx +307 -159
- package/themes/original/src/components/SingleOrderCard/index.tsx +316 -0
- package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +215 -95
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
- package/themes/original/src/components/SingleProductReview/index.tsx +30 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +25 -9
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +7 -3
- package/themes/original/src/components/UserDetails/index.tsx +32 -18
- package/themes/original/src/components/UserFormDetails/index.tsx +107 -73
- package/themes/original/src/components/UserProfile/index.tsx +4 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -162
- package/themes/original/src/components/Wallets/styles.tsx +10 -8
- package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/components/shared/OModal.tsx +4 -2
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +200 -47
- package/themes/original/src/utils/index.tsx +77 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -26,6 +26,7 @@ interface Props {
|
|
|
26
26
|
isNotDecoration?: boolean;
|
|
27
27
|
styleCloseButton?: any;
|
|
28
28
|
order?: any;
|
|
29
|
+
hideIcons?: boolean
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const OModal = (props: Props): React.ReactElement => {
|
|
@@ -47,6 +48,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
47
48
|
style,
|
|
48
49
|
styleCloseButton,
|
|
49
50
|
order,
|
|
51
|
+
hideIcons
|
|
50
52
|
} = props;
|
|
51
53
|
|
|
52
54
|
const theme = useTheme();
|
|
@@ -70,8 +72,8 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
70
72
|
alignItems: 'center',
|
|
71
73
|
paddingHorizontal: 30,
|
|
72
74
|
paddingTop: 30,
|
|
73
|
-
paddingBottom: 25,
|
|
74
|
-
borderBottomWidth: 2,
|
|
75
|
+
paddingBottom: !hideIcons ? 25 : 15,
|
|
76
|
+
borderBottomWidth: !hideIcons ? 2 : 0,
|
|
75
77
|
borderBottomColor: '#e6e6e6',
|
|
76
78
|
},
|
|
77
79
|
titleGroups: {
|
|
@@ -165,7 +167,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
165
167
|
transparent={isTransparent}
|
|
166
168
|
visible={open}
|
|
167
169
|
onRequestClose={() => {
|
|
168
|
-
onClose();
|
|
170
|
+
onClose && onClose();
|
|
169
171
|
}}
|
|
170
172
|
style={{
|
|
171
173
|
height: '100%',
|
|
@@ -218,50 +220,51 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
218
220
|
{title}
|
|
219
221
|
</OText>
|
|
220
222
|
</View>
|
|
223
|
+
{!hideIcons && (
|
|
224
|
+
<View style={styles.titleGroups}>
|
|
225
|
+
<View style={styles.shadow}>
|
|
226
|
+
{order?.business?.logo ? (
|
|
227
|
+
<OIcon
|
|
228
|
+
url={optimizeImage(
|
|
229
|
+
order?.business?.logo,
|
|
230
|
+
'h_300,c_limit',
|
|
231
|
+
)}
|
|
232
|
+
style={styles.titleIcons}
|
|
233
|
+
/>
|
|
234
|
+
) : (
|
|
235
|
+
<OIcon
|
|
236
|
+
src={theme.images.dummies.businessLogo}
|
|
237
|
+
style={styles.titleIcons}
|
|
238
|
+
/>
|
|
239
|
+
)}
|
|
240
|
+
</View>
|
|
221
241
|
|
|
222
|
-
|
|
223
|
-
<View style={styles.shadow}>
|
|
224
|
-
{order?.business?.logo ? (
|
|
242
|
+
<View style={styles.shadow}>
|
|
225
243
|
<OIcon
|
|
226
244
|
url={optimizeImage(
|
|
227
|
-
order?.
|
|
245
|
+
order?.customer?.photo ||
|
|
246
|
+
theme?.images?.dummies?.customerPhoto,
|
|
228
247
|
'h_300,c_limit',
|
|
229
248
|
)}
|
|
230
249
|
style={styles.titleIcons}
|
|
231
250
|
/>
|
|
232
|
-
|
|
233
|
-
<OIcon
|
|
234
|
-
src={theme.images.dummies.businessLogo}
|
|
235
|
-
style={styles.titleIcons}
|
|
236
|
-
/>
|
|
237
|
-
)}
|
|
238
|
-
</View>
|
|
251
|
+
</View>
|
|
239
252
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
253
|
+
{order?.driver && (
|
|
254
|
+
<View style={styles.shadow}>
|
|
255
|
+
<OIcon
|
|
256
|
+
url={
|
|
257
|
+
optimizeImage(
|
|
258
|
+
order?.driver?.photo,
|
|
259
|
+
'h_300,c_limit',
|
|
260
|
+
) || theme?.images?.dummies?.driverPhoto
|
|
261
|
+
}
|
|
262
|
+
style={styles.titleIcons}
|
|
263
|
+
/>
|
|
264
|
+
</View>
|
|
265
|
+
)}
|
|
249
266
|
</View>
|
|
250
|
-
|
|
251
|
-
{order?.driver && (
|
|
252
|
-
<View style={styles.shadow}>
|
|
253
|
-
<OIcon
|
|
254
|
-
url={
|
|
255
|
-
optimizeImage(
|
|
256
|
-
order?.driver?.photo,
|
|
257
|
-
'h_300,c_limit',
|
|
258
|
-
) || theme?.images?.dummies?.driverPhoto
|
|
259
|
-
}
|
|
260
|
-
style={styles.titleIcons}
|
|
261
|
-
/>
|
|
262
|
-
</View>
|
|
263
|
-
)}
|
|
264
|
-
</View>
|
|
267
|
+
)}
|
|
265
268
|
</View>
|
|
266
269
|
)}
|
|
267
270
|
{children}
|
|
@@ -21,8 +21,8 @@ export interface LoginParams {
|
|
|
21
21
|
allowedLevels?: any;
|
|
22
22
|
useRootPoint?: any;
|
|
23
23
|
notificationState?: any;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
handleReCaptcha?: any;
|
|
25
|
+
enableReCaptcha?: any;
|
|
26
26
|
}
|
|
27
27
|
export interface ProfileParams {
|
|
28
28
|
navigation?: any;
|
|
@@ -41,6 +41,7 @@ export interface ProfileParams {
|
|
|
41
41
|
validationFields?: any;
|
|
42
42
|
showField?: any;
|
|
43
43
|
isRequiredField?: any;
|
|
44
|
+
isAlsea?: boolean;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
export interface AddressListParams {
|
|
@@ -255,6 +256,7 @@ export interface MessagesOptionParams {
|
|
|
255
256
|
messagesReadList?: any;
|
|
256
257
|
onNavigationRedirect?: any;
|
|
257
258
|
setSortBy?: any;
|
|
259
|
+
getOrders: any
|
|
258
260
|
}
|
|
259
261
|
export interface OrdersOptionParams {
|
|
260
262
|
orderList?: any;
|
|
@@ -265,7 +267,7 @@ export interface OrdersOptionParams {
|
|
|
265
267
|
titleContent?: string;
|
|
266
268
|
customArray?: Array<any>;
|
|
267
269
|
loadMoreOrders?: () => {};
|
|
268
|
-
loadOrders?: ({}: any) => {};
|
|
270
|
+
loadOrders?: ({ }: any) => {};
|
|
269
271
|
messages?: any;
|
|
270
272
|
setMessages?: () => {};
|
|
271
273
|
loadMessages?: () => {};
|
|
@@ -279,7 +281,7 @@ export interface OrdersOptionParams {
|
|
|
279
281
|
ordersGroup?: any;
|
|
280
282
|
setOrdersGroup?: any;
|
|
281
283
|
setCurrentFilters?: any;
|
|
282
|
-
onFiltered?: ({}: any) => {};
|
|
284
|
+
onFiltered?: ({ }: any) => {};
|
|
283
285
|
filtered?: any;
|
|
284
286
|
handleClickOrder?: any;
|
|
285
287
|
orderGroupStatusCustom?: {
|
|
@@ -290,9 +292,11 @@ export interface OrdersOptionParams {
|
|
|
290
292
|
};
|
|
291
293
|
isBusinessApp?: boolean;
|
|
292
294
|
handleClickLogisticOrder: (status: number, orderId: number) => void,
|
|
293
|
-
logisticOrders: {orders: Array<any>, loading: boolean, error: Array<string> | string},
|
|
295
|
+
logisticOrders: { orders: Array<any>, loading: boolean, error: Array<string> | string },
|
|
294
296
|
loadLogisticOrders: () => void;
|
|
295
|
-
isLogisticActivated?: boolean
|
|
297
|
+
isLogisticActivated?: boolean;
|
|
298
|
+
isAlsea?: boolean;
|
|
299
|
+
checkNotification?: boolean;
|
|
296
300
|
}
|
|
297
301
|
export interface ActiveOrdersParams {
|
|
298
302
|
orders?: any;
|
|
@@ -390,6 +394,7 @@ export interface ProductItemAccordionParams {
|
|
|
390
394
|
offsetDisabled?: any;
|
|
391
395
|
isFromCheckout?: any;
|
|
392
396
|
isClickableEvent?: any;
|
|
397
|
+
currency?: any;
|
|
393
398
|
}
|
|
394
399
|
export interface ReviewOrderParams {
|
|
395
400
|
order?: { orderId: number; businessId: number; logo: string };
|
|
@@ -405,7 +410,7 @@ export interface MessagesParams {
|
|
|
405
410
|
order?: any;
|
|
406
411
|
orderId?: number;
|
|
407
412
|
messages?: any;
|
|
408
|
-
message
|
|
413
|
+
message: string;
|
|
409
414
|
image?: string;
|
|
410
415
|
messagesToShow?: any;
|
|
411
416
|
sendMessage?: any;
|
|
@@ -561,13 +566,13 @@ export interface AcceptOrRejectOrderParams {
|
|
|
561
566
|
}
|
|
562
567
|
|
|
563
568
|
export interface MapViewParams {
|
|
564
|
-
onNavigationRedirect: (page
|
|
569
|
+
onNavigationRedirect: (page: string, params?: any) => void,
|
|
565
570
|
getBusinessLocations: () => void,
|
|
566
571
|
isLoadingBusinessMarkers?: boolean,
|
|
567
572
|
markerGroups: Array<any>,
|
|
568
573
|
customerMarkerGroups: Array<any>,
|
|
569
574
|
alertState: { open: boolean, content: Array<string>, key?: string | null },
|
|
570
|
-
setAlertState: ({open, content, key}
|
|
575
|
+
setAlertState: ({ open, content, key }: { open: boolean, content: Array<string>, key?: string | null }) => void
|
|
571
576
|
}
|
|
572
577
|
|
|
573
578
|
export interface ReviewCustomerParams {
|
|
@@ -38,6 +38,8 @@ export const getTraduction = (key: string, t: any) => {
|
|
|
38
38
|
ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
|
|
39
39
|
ERROR_USER_UPDATE_YOU_HAVE_ASSIGNED_ORDERS:
|
|
40
40
|
"You can't because you have assigned orders",
|
|
41
|
+
ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
|
|
42
|
+
ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation'
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
return keyList[key] ? t(key, keyList[key]) : t(key);
|
|
@@ -343,3 +345,11 @@ export const getOrderStatus = (s: string, t: any) => {
|
|
|
343
345
|
|
|
344
346
|
return objectStatus && objectStatus;
|
|
345
347
|
};
|
|
348
|
+
|
|
349
|
+
export const transformDistance = (value : number, distanceUnit?: string) => {
|
|
350
|
+
return distanceUnit === 'mi'
|
|
351
|
+
? (value / 1.609).toFixed(2)
|
|
352
|
+
: distanceUnit === 'ft'
|
|
353
|
+
? (value * 3280.84).toFixed(0)
|
|
354
|
+
: (value).toFixed(2)
|
|
355
|
+
}
|
|
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
197
197
|
{isFarAway && (
|
|
198
198
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
199
199
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
200
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
200
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
201
201
|
</FarAwayMessage>
|
|
202
202
|
)}
|
|
203
203
|
{!auth && (
|
|
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
410
410
|
textInputProps={{
|
|
411
411
|
returnKeyType: 'next',
|
|
412
412
|
onSubmitEditing: () => inputRef?.current?.focus?.(),
|
|
413
|
-
style: { borderWidth: 0, fontSize: 12 }
|
|
414
|
-
maxLength: 10
|
|
413
|
+
style: { borderWidth: 0, fontSize: 12 }
|
|
415
414
|
}}
|
|
416
415
|
textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
|
|
417
416
|
/>
|
|
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
155
155
|
{isFarAway && (
|
|
156
156
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
157
157
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
158
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
158
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
159
159
|
</FarAwayMessage>
|
|
160
160
|
)}
|
|
161
161
|
<View style={styles.wrapperOrderOptions}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { PanResponder, TouchableOpacity, View } from 'react-native';
|
|
2
|
+
import { PanResponder, Platform, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
useLanguage,
|
|
5
5
|
useOrder,
|
|
@@ -120,6 +120,7 @@ const BusinessMenu = (props:any): React.ReactElement => {
|
|
|
120
120
|
}}
|
|
121
121
|
>
|
|
122
122
|
<Container nopadding nestedScrollEnabled>
|
|
123
|
+
{Platform.OS === 'android' && (<View style={{ paddingTop: 20 }} />)}
|
|
123
124
|
<NavBar
|
|
124
125
|
title={t('MENU_V21', 'Menu')}
|
|
125
126
|
onActionLeft={goToBack}
|
|
@@ -62,6 +62,10 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
const handleEditProduct = (product: any) => {
|
|
65
|
+
if (props.onEditProduct) {
|
|
66
|
+
props.onEditProduct(product)
|
|
67
|
+
return
|
|
68
|
+
}
|
|
65
69
|
setCurProduct(product)
|
|
66
70
|
setModalIsOpen(true)
|
|
67
71
|
}
|
|
@@ -148,7 +152,7 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
|
|
|
148
152
|
<StyledBottomContent
|
|
149
153
|
style={{bottom:10}}
|
|
150
154
|
minHeight={props.height * 0.01}
|
|
151
|
-
>
|
|
155
|
+
>
|
|
152
156
|
<OButton
|
|
153
157
|
text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
|
|
154
158
|
!openUpselling !== canOpenUpselling ? `${t('CHECKOUT', 'Checkout')} ${parsePrice(cart?.total)}`: t('LOADING', 'Loading')
|
|
@@ -198,6 +202,7 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
|
|
|
198
202
|
canOpenUpselling={canOpenUpselling}
|
|
199
203
|
setCanOpenUpselling={setCanOpenUpselling}
|
|
200
204
|
onClose={onCloseUpselling}
|
|
205
|
+
onAddProduct={props.onAddProduct}
|
|
201
206
|
resetInactivityTimeout={resetInactivityTimeout}
|
|
202
207
|
/>
|
|
203
208
|
)}
|
|
@@ -231,7 +236,7 @@ const TopBar = (props:any) => {
|
|
|
231
236
|
<OIconButton
|
|
232
237
|
bgColor="transparent"
|
|
233
238
|
borderColor="transparent"
|
|
234
|
-
RenderIcon={() =>
|
|
239
|
+
RenderIcon={() =>
|
|
235
240
|
<EvilIcons
|
|
236
241
|
name={'close'}
|
|
237
242
|
size={40}
|
|
@@ -260,6 +265,8 @@ interface CartBottomSheetUIProps {
|
|
|
260
265
|
onNavigationRedirect: any,
|
|
261
266
|
clearInactivityTimeout: any,
|
|
262
267
|
resetInactivityTimeout: any,
|
|
268
|
+
onEditProduct: any,
|
|
269
|
+
onAddProduct: any,
|
|
263
270
|
}
|
|
264
271
|
|
|
265
272
|
export const CartBottomSheet = (props: any) => {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { useLanguage } from 'ordering-components/native';
|
|
3
2
|
import { useCartBottomSheet } from '../../providers/CartBottomSheetProvider';
|
|
4
|
-
import { CCNotCarts } from './styles';
|
|
5
3
|
|
|
6
4
|
import { Cart } from '../Cart';
|
|
7
|
-
import { OText } from '../shared';
|
|
8
5
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
9
6
|
import { Cart as TypeCart } from '../../types';
|
|
10
7
|
|
|
@@ -20,7 +17,6 @@ export const CartContent = (props: any) => {
|
|
|
20
17
|
resetInactivityTimeout,
|
|
21
18
|
}: Props = props
|
|
22
19
|
|
|
23
|
-
const [, t] = useLanguage()
|
|
24
20
|
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
25
21
|
const [, { hideCartBottomSheet }] = useCartBottomSheet();
|
|
26
22
|
|
|
@@ -56,13 +52,6 @@ export const CartContent = (props: any) => {
|
|
|
56
52
|
}
|
|
57
53
|
</>
|
|
58
54
|
)}
|
|
59
|
-
{/* {(!cart && showNotFound) && (
|
|
60
|
-
<CCNotCarts>
|
|
61
|
-
<OText size={24} style={{ textAlign: 'center' }}>
|
|
62
|
-
{t('CARTS_NOT_FOUND', 'You don\'t have carts available')}
|
|
63
|
-
</OText>
|
|
64
|
-
</CCNotCarts>
|
|
65
|
-
)} */}
|
|
66
55
|
<Spinner visible={isCartsLoading} />
|
|
67
56
|
</>
|
|
68
57
|
)
|
|
@@ -56,9 +56,10 @@ const CartItem = (props: CartItemProps) => {
|
|
|
56
56
|
return product
|
|
57
57
|
}
|
|
58
58
|
const isProductIngredients = productInfo()?.ingredients.length > 0 || productInfo()?.options.length > 0 || product?.comment
|
|
59
|
-
const getFormattedSubOptionName = ({ quantity, name, position, price }: { quantity: number, name: string, position: string, price:
|
|
59
|
+
const getFormattedSubOptionName = ({ quantity, name, position, price }: { quantity: number, name: string, position: string, price: any }) => {
|
|
60
60
|
const pos = position ? `(${position})` : ''
|
|
61
|
-
|
|
61
|
+
const str = `${quantity} x ${name} ${pos}`
|
|
62
|
+
return price ? `${str} ${price}` : str
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
return (
|
|
@@ -184,7 +185,7 @@ const CartItem = (props: CartItemProps) => {
|
|
|
184
185
|
quantity: suboption.quantity,
|
|
185
186
|
name: suboption.name,
|
|
186
187
|
position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
|
|
187
|
-
price: parsePrice(suboption.price)
|
|
188
|
+
price: suboption.price > 0 && `+${parsePrice(suboption.price)}`
|
|
188
189
|
})}
|
|
189
190
|
</OText>
|
|
190
191
|
</ProductSubOption>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import { Dimensions, Platform, View } from 'react-native';
|
|
3
3
|
import { useLanguage, useOrder, useUtils } from 'ordering-components/native';
|
|
4
4
|
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
@@ -41,20 +41,22 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
41
41
|
|
|
42
42
|
const theme = useTheme()
|
|
43
43
|
const [, t] = useLanguage();
|
|
44
|
-
const [curIndexCateg, setIndexCateg] = useState(categories.indexOf(category));
|
|
45
44
|
const [{ parsePrice }] = useUtils();
|
|
46
45
|
const [orientationState] = useDeviceOrientation();
|
|
47
46
|
const [bottomSheetVisibility, { showCartBottomSheet, hideCartBottomSheet }] = useCartBottomSheet();
|
|
48
|
-
|
|
47
|
+
|
|
48
|
+
const [productState, setProductState] = useState<any>(null)
|
|
49
|
+
const [productSelected, setProductSelected] = useState<any>({})
|
|
50
|
+
const [curIndexCateg, setIndexCateg] = useState(categories.indexOf(category));
|
|
49
51
|
const [drawerState, setDrawerState] = useState({ isOpen: false, data: { order: null } });
|
|
50
52
|
|
|
51
53
|
const width_dimension = Dimensions.get('window').width;
|
|
52
54
|
const height_dimension = Dimensions.get('window').height;
|
|
53
|
-
|
|
55
|
+
|
|
54
56
|
const KeyboardView = styled.KeyboardAvoidingView`
|
|
55
57
|
flex: 1;
|
|
56
58
|
`;
|
|
57
|
-
|
|
59
|
+
|
|
58
60
|
const onChangeTabs = (idx: number) => {
|
|
59
61
|
resetInactivityTimeout();
|
|
60
62
|
setIndexCateg(idx);
|
|
@@ -76,6 +78,16 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
76
78
|
cart = cartsList?.find((item: any) => item.business_id == businessId);
|
|
77
79
|
}
|
|
78
80
|
|
|
81
|
+
const onEditProduct = (product: any) => {
|
|
82
|
+
setProductSelected({ ...product, _isEditProduct: true })
|
|
83
|
+
setDrawerValues({ isOpen: true, data: null })
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const onAddProduct = (product: any) => {
|
|
87
|
+
setProductSelected(product)
|
|
88
|
+
setDrawerValues({ isOpen: true, data: null })
|
|
89
|
+
}
|
|
90
|
+
|
|
79
91
|
const cartProps = {
|
|
80
92
|
...props,
|
|
81
93
|
cart,
|
|
@@ -88,16 +100,32 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
88
100
|
visible: bottomSheetVisibility,
|
|
89
101
|
clearInactivityTimeout,
|
|
90
102
|
resetInactivityTimeout,
|
|
103
|
+
onEditProduct,
|
|
104
|
+
onAddProduct
|
|
91
105
|
},
|
|
92
106
|
showNotFound: false,
|
|
93
107
|
showCartBottomSheet,
|
|
94
108
|
}
|
|
95
109
|
|
|
110
|
+
const onClickDrawer = () => {
|
|
111
|
+
setDrawerValues({ isOpen: !drawerState.isOpen, data: null })
|
|
112
|
+
setProductState(null)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const onSaveProductForm = () => {
|
|
116
|
+
showCartBottomSheet()
|
|
117
|
+
onClickDrawer()
|
|
118
|
+
}
|
|
119
|
+
|
|
96
120
|
const onToggleCart = () => {
|
|
97
121
|
if (bottomSheetVisibility) hideCartBottomSheet();
|
|
98
122
|
else showCartBottomSheet();
|
|
99
123
|
}
|
|
100
124
|
|
|
125
|
+
const onProductStateChange = useCallback((val: any) => {
|
|
126
|
+
setProductState({ ...productState, ...val })
|
|
127
|
+
}, [setProductState])
|
|
128
|
+
|
|
101
129
|
return (
|
|
102
130
|
<>
|
|
103
131
|
<View style={{
|
|
@@ -113,6 +141,7 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
113
141
|
}}
|
|
114
142
|
>
|
|
115
143
|
<Container nopadding nestedScrollEnabled>
|
|
144
|
+
{Platform.OS === 'android' && (<View style={{ paddingTop: 20 }} />)}
|
|
116
145
|
<NavBar
|
|
117
146
|
title={categories[curIndexCateg].name}
|
|
118
147
|
onActionLeft={goToBack}
|
|
@@ -144,12 +173,14 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
144
173
|
onSelectItem={onChangeTabs}
|
|
145
174
|
/>
|
|
146
175
|
|
|
147
|
-
<GridContainer
|
|
148
|
-
style={{
|
|
149
|
-
marginTop: 20,
|
|
176
|
+
<GridContainer
|
|
177
|
+
style={{
|
|
178
|
+
marginTop: 20,
|
|
150
179
|
paddingLeft: orientationState?.orientation === LANDSCAPE
|
|
151
|
-
|
|
152
|
-
|
|
180
|
+
? bottomSheetVisibility
|
|
181
|
+
? orientationState?.dimensions?.width * 0.004
|
|
182
|
+
: orientationState?.dimensions?.width * 0.008
|
|
183
|
+
: 0
|
|
153
184
|
}}
|
|
154
185
|
>
|
|
155
186
|
{categories[curIndexCateg].products.map((product) => (
|
|
@@ -170,8 +201,7 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
170
201
|
onPress={() => {
|
|
171
202
|
resetInactivityTimeout()
|
|
172
203
|
if (isDrawer) {
|
|
173
|
-
|
|
174
|
-
setDrawerValues({ isOpen: true, data: null })
|
|
204
|
+
onAddProduct && onAddProduct(product)
|
|
175
205
|
} else {
|
|
176
206
|
navigation.navigate('ProductDetails', {
|
|
177
207
|
businessId,
|
|
@@ -191,23 +221,22 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
191
221
|
</GridContainer>
|
|
192
222
|
</Container>
|
|
193
223
|
</View>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
</View>
|
|
224
|
+
<View
|
|
225
|
+
style={{
|
|
226
|
+
flex: bottomSheetVisibility && orientationState?.orientation === PORTRAIT ? 0 : 0.8,
|
|
227
|
+
display: bottomSheetVisibility ? 'flex' : 'none'
|
|
228
|
+
}}
|
|
229
|
+
>
|
|
230
|
+
<CartContent
|
|
231
|
+
{...cartProps}
|
|
232
|
+
/>
|
|
233
|
+
</View>
|
|
205
234
|
</View>
|
|
206
235
|
<DrawerView
|
|
207
236
|
isOpen={drawerState.isOpen}
|
|
208
237
|
width={width_dimension - (width_dimension * 0.4)}
|
|
209
238
|
height={height_dimension}
|
|
210
|
-
onClickIcon={
|
|
239
|
+
onClickIcon={onClickDrawer}
|
|
211
240
|
>
|
|
212
241
|
<KeyboardView
|
|
213
242
|
enabled
|
|
@@ -215,14 +244,24 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
215
244
|
>
|
|
216
245
|
<ProductForm
|
|
217
246
|
isDrawer
|
|
218
|
-
product={productSelected}
|
|
219
|
-
businessId={parseInt(businessId, 10)}
|
|
220
|
-
businessSlug={businessSlug}
|
|
221
|
-
onSave={() => {
|
|
222
|
-
showCartBottomSheet()
|
|
223
|
-
setDrawerValues({ isOpen: !drawerState.isOpen, data: null })
|
|
224
|
-
}}
|
|
225
247
|
navigation={navigation}
|
|
248
|
+
{...(productSelected?._isEditProduct ? {
|
|
249
|
+
isEdit: true,
|
|
250
|
+
productCart: productState?.productCart ?? productSelected,
|
|
251
|
+
product: productState?.product,
|
|
252
|
+
businessSlug: cart?.business?.slug,
|
|
253
|
+
businessId: cart?.business_id,
|
|
254
|
+
categoryId: productSelected?.category_id,
|
|
255
|
+
productId: productSelected?.id,
|
|
256
|
+
} : {
|
|
257
|
+
product: productSelected,
|
|
258
|
+
businessSlug: businessSlug,
|
|
259
|
+
businessId: parseInt(businessId, 10),
|
|
260
|
+
productState: productState,
|
|
261
|
+
productCart: productState,
|
|
262
|
+
})}
|
|
263
|
+
onSave={onSaveProductForm}
|
|
264
|
+
onProductStateChange={onProductStateChange}
|
|
226
265
|
/>
|
|
227
266
|
</KeyboardView>
|
|
228
267
|
</DrawerView>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
|
|
2
|
+
import { _retrieveStoreData } from '../../../../../src/providers/StoreUtil';
|
|
3
3
|
import {
|
|
4
4
|
Checkout as CheckoutController,
|
|
5
5
|
useOrder,
|
|
@@ -35,6 +35,20 @@ const CheckoutUI = (props: any) => {
|
|
|
35
35
|
} = props
|
|
36
36
|
|
|
37
37
|
const [errorCash, setErrorCash] = useState(false);
|
|
38
|
+
const [customerName, setCustomerName] = useState(null);
|
|
39
|
+
|
|
40
|
+
const getCustomerName = async () => {
|
|
41
|
+
const data = await _retrieveStoreData('customer_name');
|
|
42
|
+
setCustomerName(data?.customerName)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
|
|
47
|
+
navigation?.canGoBack() && navigation.goBack()
|
|
48
|
+
} else {
|
|
49
|
+
getCustomerName()
|
|
50
|
+
}
|
|
51
|
+
}, [cart])
|
|
38
52
|
|
|
39
53
|
useEffect(() => {
|
|
40
54
|
if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
|
|
@@ -48,6 +62,7 @@ const CheckoutUI = (props: any) => {
|
|
|
48
62
|
navigation={navigation}
|
|
49
63
|
cart={cart}
|
|
50
64
|
errors={errors}
|
|
65
|
+
customerName={customerName}
|
|
51
66
|
onPaymentChange={handlePaymethodChange}
|
|
52
67
|
onNavigationRedirect={onNavigationRedirect}
|
|
53
68
|
paySelected={paymethodSelected}
|
|
@@ -110,7 +125,7 @@ export const Checkout = (props: any) => {
|
|
|
110
125
|
loading: false,
|
|
111
126
|
cart: result
|
|
112
127
|
})
|
|
113
|
-
} catch (error) {
|
|
128
|
+
} catch (error: any) {
|
|
114
129
|
showToast(ToastType.Error, error?.toString() || error.message)
|
|
115
130
|
}
|
|
116
131
|
} else {
|
|
@@ -122,7 +137,7 @@ export const Checkout = (props: any) => {
|
|
|
122
137
|
error: cart ? null : result
|
|
123
138
|
})
|
|
124
139
|
}
|
|
125
|
-
} catch (e) {
|
|
140
|
+
} catch (e: any) {
|
|
126
141
|
setCartState({
|
|
127
142
|
...cartState,
|
|
128
143
|
loading: false,
|
|
@@ -113,12 +113,6 @@ const CustomerName = (props: Props): React.ReactElement => {
|
|
|
113
113
|
style={{ bottom: 20 }}
|
|
114
114
|
>
|
|
115
115
|
{t('WHATS_YOUR_NAME', "What's your name?")}
|
|
116
|
-
{/* <OText
|
|
117
|
-
size={orientationState?.dimensions?.width * 0.05}
|
|
118
|
-
weight={'700'}
|
|
119
|
-
>
|
|
120
|
-
{`${t('ORDER_BE_FOR', 'order be for?')}`}
|
|
121
|
-
</OText> */}
|
|
122
116
|
</OText>
|
|
123
117
|
<Controller
|
|
124
118
|
control={control}
|
|
@@ -19,12 +19,12 @@ export const WrapperFloatBtn = styled.View`
|
|
|
19
19
|
top: 10%;
|
|
20
20
|
right: ${(props: any) => props.outside ? 11 : 58}%;
|
|
21
21
|
z-index: 20002;
|
|
22
|
-
elevation:
|
|
22
|
+
elevation: 17;
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
25
|
export const IconControl = styled.TouchableOpacity`
|
|
26
26
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
27
27
|
padding: 10px;
|
|
28
28
|
border-radius: 8px;
|
|
29
|
-
elevation:
|
|
29
|
+
elevation: 17;
|
|
30
30
|
`;
|