ordering-ui-react-native 0.21.50 → 0.21.51-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 -8
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +6 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +3 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +72 -27
- package/themes/business/src/components/BusinessProductList/index.tsx +57 -25
- package/themes/business/src/components/DriverMap/index.tsx +36 -23
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +30 -15
- package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
- package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +42 -23
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +40 -20
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderSummary/index.tsx +240 -76
- package/themes/business/src/components/OrdersOption/index.tsx +263 -135
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +37 -40
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +23 -5
- package/themes/business/src/utils/index.tsx +5 -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/Checkout/index.tsx +6 -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/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +6 -2
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +41 -15
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +18 -4
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +18 -10
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +4 -3
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +30 -18
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +30 -9
- package/themes/original/src/components/CartContent/index.tsx +96 -58
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +144 -62
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +18 -2
- package/themes/original/src/components/Favorite/index.tsx +9 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +7 -0
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
- package/themes/original/src/components/HelpGuide/index.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +5 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -8
- package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
- package/themes/original/src/components/LoginForm/index.tsx +9 -3
- package/themes/original/src/components/MessageListing/index.tsx +6 -0
- package/themes/original/src/components/Messages/index.tsx +8 -7
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +19 -4
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +126 -61
- package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
- package/themes/original/src/components/MyOrders/index.tsx +28 -28
- package/themes/original/src/components/NavBar/index.tsx +5 -0
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +9 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +701 -662
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +22 -3
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +3 -5
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +47 -4
- package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
- package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +170 -252
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -44
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +13 -11
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +1 -1
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/Sessions/index.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +67 -59
- package/themes/original/src/components/SingleOrderCard/index.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +4 -3
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +12 -35
- package/themes/original/src/components/StripeElementsForm/index.tsx +79 -59
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +100 -86
- package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
- package/themes/original/src/components/UserProfile/index.tsx +3 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +7 -4
- package/themes/original/src/components/Wallets/styles.tsx +2 -1
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +6 -1
- package/themes/original/src/utils/index.tsx +12 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -327,8 +327,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
327
327
|
<>
|
|
328
328
|
<Container
|
|
329
329
|
style={{
|
|
330
|
-
paddingLeft: !cateringPreorder || isPage ?
|
|
331
|
-
paddingRight: !cateringPreorder || isPage ?
|
|
330
|
+
paddingLeft: !cateringPreorder || isPage ? 20 : 0,
|
|
331
|
+
paddingRight: !cateringPreorder || isPage ? 20 : 0
|
|
332
332
|
}}
|
|
333
333
|
nestedScrollEnabled
|
|
334
334
|
>
|
|
@@ -343,6 +343,11 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
343
343
|
titleAlign={'center'}
|
|
344
344
|
titleStyle={{ fontSize: 20, marginRight: 0, marginLeft: 0 }}
|
|
345
345
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
346
|
+
buttonProps={{
|
|
347
|
+
bgColor: theme.colors.white,
|
|
348
|
+
borderColor: theme.colors.white,
|
|
349
|
+
textStyle: { color: theme.colors.btnFont }
|
|
350
|
+
}}
|
|
346
351
|
/>
|
|
347
352
|
)}
|
|
348
353
|
{(preorderMinimumDays === 0 && preorderLeadTime === 0) || !cateringPreorder && (
|
|
@@ -394,6 +399,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
394
399
|
<View style={{ flex: 1 }}>
|
|
395
400
|
{selectDate && datesWhitelist[0]?.start !== null && (
|
|
396
401
|
<CalendarStrip
|
|
402
|
+
locale={locale}
|
|
397
403
|
scrollable
|
|
398
404
|
style={styles.calendar}
|
|
399
405
|
calendarHeaderContainerStyle={styles.calendarHeaderContainer}
|
|
@@ -467,8 +473,17 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
467
473
|
<Spinner visible={momentState.isLoading === 1} />
|
|
468
474
|
</Container>
|
|
469
475
|
{!isCart && !cateringPreorder && (
|
|
470
|
-
<View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal:
|
|
471
|
-
<OButton
|
|
476
|
+
<View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal: 20, backgroundColor: 'white', width: '100%' }}>
|
|
477
|
+
<OButton
|
|
478
|
+
onClick={() => handleChangeMoment()}
|
|
479
|
+
bgColor={theme.colors.primary}
|
|
480
|
+
borderColor={theme.colors.primary}
|
|
481
|
+
isDisabled={!selectedTime}
|
|
482
|
+
text={t('CONTINUE', 'Continue')}
|
|
483
|
+
style={{ borderRadius: 7.6, height: 44, shadowOpacity: 0 }}
|
|
484
|
+
textStyle={{ color: 'white', fontSize: 14 }}
|
|
485
|
+
showNextIcon
|
|
486
|
+
/>
|
|
472
487
|
</View>
|
|
473
488
|
)}
|
|
474
489
|
</>
|
|
@@ -11,7 +11,7 @@ export const MultiCartUI = () => {
|
|
|
11
11
|
const theme = useTheme();
|
|
12
12
|
return (
|
|
13
13
|
<Container noPadding>
|
|
14
|
-
<ChContainer style={{ paddingHorizontal:
|
|
14
|
+
<ChContainer style={{ paddingHorizontal: 20 }}>
|
|
15
15
|
<ChSection>
|
|
16
16
|
<ChUserDetails>
|
|
17
17
|
<Placeholder Animation={Fade}>
|
|
@@ -51,7 +51,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
51
51
|
const { confirmApplePayPayment } = useApplePay()
|
|
52
52
|
|
|
53
53
|
const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
|
|
54
|
-
|
|
54
|
+
const [newCardAdded, setNewCardAdded] = useState(null)
|
|
55
55
|
const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
|
|
56
56
|
const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
|
|
57
57
|
|
|
@@ -223,6 +223,8 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
223
223
|
handlePaymethodDataChange={handlePaymethodDataChange}
|
|
224
224
|
clientSecret={props.clientSecret}
|
|
225
225
|
onPaymentChange={handlePaymethodDataChange}
|
|
226
|
+
newCardAdded={newCardAdded}
|
|
227
|
+
addNewCardAsDefault
|
|
226
228
|
/>
|
|
227
229
|
</View>
|
|
228
230
|
)}
|
|
@@ -233,6 +235,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
233
235
|
toSave
|
|
234
236
|
businessId={businessIds[0]}
|
|
235
237
|
businessIds={businessIds}
|
|
238
|
+
businessNames={openCarts?.map?.((cart: any) => cart?.business?.name)}
|
|
236
239
|
publicKey={paymethodSelected?.data?.publishable}
|
|
237
240
|
requirements={props.clientSecret}
|
|
238
241
|
handleSource={handlePaymethodDataChange}
|
|
@@ -306,7 +309,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
306
309
|
</>
|
|
307
310
|
)}
|
|
308
311
|
|
|
309
|
-
|
|
312
|
+
<OModal
|
|
310
313
|
entireModal
|
|
311
314
|
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
312
315
|
open={addCardOpen.stripe}
|
|
@@ -326,10 +329,11 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
326
329
|
publicKey={paymethodSelected?.data?.publishable}
|
|
327
330
|
requirements={props.clientSecret}
|
|
328
331
|
onSelectCard={handlePaymethodDataChange}
|
|
332
|
+
setNewCardAdded={setNewCardAdded}
|
|
329
333
|
onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
330
334
|
/>
|
|
331
335
|
</KeyboardAvoidingView>
|
|
332
|
-
</OModal>
|
|
336
|
+
</OModal>
|
|
333
337
|
</PMContainer>
|
|
334
338
|
)
|
|
335
339
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
useLanguage,
|
|
4
4
|
useConfig,
|
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
ToastType,
|
|
11
11
|
MultiCheckout as MultiCheckoutController
|
|
12
12
|
} from 'ordering-components/native'
|
|
13
|
-
import { View, StyleSheet, Platform, ScrollView } from 'react-native'
|
|
13
|
+
import { View, StyleSheet, Platform, ScrollView, SafeAreaView } from 'react-native'
|
|
14
14
|
import { useTheme } from 'styled-components/native';
|
|
15
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
15
16
|
import { Container } from '../../layouts/Container';
|
|
16
17
|
import NavBar from '../NavBar';
|
|
17
18
|
import { OText, OIcon, OModal, OButton } from '../shared';
|
|
@@ -30,6 +31,8 @@ import { SignupForm } from '../SignupForm'
|
|
|
30
31
|
import { LoginForm } from '../LoginForm'
|
|
31
32
|
|
|
32
33
|
import {
|
|
34
|
+
TopHeader,
|
|
35
|
+
TopActions,
|
|
33
36
|
ChContainer,
|
|
34
37
|
ChSection,
|
|
35
38
|
ChHeader,
|
|
@@ -73,14 +76,18 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
73
76
|
const theme = useTheme();
|
|
74
77
|
const styles = StyleSheet.create({
|
|
75
78
|
pagePadding: {
|
|
76
|
-
paddingLeft:
|
|
77
|
-
paddingRight:
|
|
79
|
+
paddingLeft: 20,
|
|
80
|
+
paddingRight: 20
|
|
81
|
+
},
|
|
82
|
+
wrapperNavbar: {
|
|
83
|
+
paddingHorizontal: 20,
|
|
84
|
+
backgroundColor: theme?.colors?.white,
|
|
85
|
+
borderWidth: 0
|
|
78
86
|
},
|
|
79
|
-
wrapperNavbar: { paddingHorizontal: 40 },
|
|
80
87
|
detailWrapper: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
paddingHorizontal: 20,
|
|
89
|
+
width: '100%'
|
|
90
|
+
},
|
|
84
91
|
})
|
|
85
92
|
|
|
86
93
|
const [, { showToast }] = useToast();
|
|
@@ -136,18 +143,20 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
136
143
|
?.reduce((sum: any, cart: any) => sum + clearAmount((cart?.subtotal + getIncludedTaxes(cart)) * accumulationRateBusiness(cart?.business_id)), 0)
|
|
137
144
|
?.toFixed(configs.format_number_decimal_length?.value ?? 2)
|
|
138
145
|
|
|
146
|
+
const [showTitle, setShowTitle] = useState(false)
|
|
139
147
|
const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
|
|
140
148
|
const [phoneUpdate, setPhoneUpdate] = useState(false);
|
|
141
149
|
const [userErrors, setUserErrors] = useState<any>([]);
|
|
150
|
+
const [cartsOpened, setCartsOpened] = useState([])
|
|
142
151
|
const [placeByMethodPay, setPlaceByMethodPay] = useState(false)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
const [allowedGuest, setAllowedGuest] = useState(false)
|
|
153
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
154
|
+
const [requiredFields, setRequiredFields] = useState<any>([])
|
|
155
|
+
const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
|
|
156
|
+
const [openModal, setOpenModal] = useState({ login: false, signup: false, isGuest: false })
|
|
148
157
|
const [methodPaySupported, setMethodPaySupported] = useState({ enabled: false, message: null, loading: true })
|
|
149
158
|
const methodsPay = ['global_google_pay', 'global_apple_pay']
|
|
150
|
-
const isDisablePlaceOrderButton = cartGroup?.loading || (!(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) && cartGroup?.result?.balance > 0) ||
|
|
159
|
+
const isDisablePlaceOrderButton = cartGroup?.loading || placing || (!(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) && cartGroup?.result?.balance > 0) ||
|
|
151
160
|
(paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data) ||
|
|
152
161
|
walletCarts.length > 0
|
|
153
162
|
|| (methodsPay.includes(paymethodSelected?.gateway) && (!methodPaySupported.enabled || methodPaySupported.loading)) || openCarts?.length === 0
|
|
@@ -162,7 +171,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
162
171
|
setUserErrors([])
|
|
163
172
|
const errors = []
|
|
164
173
|
const notFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'zipcode', 'address_notes']
|
|
165
|
-
|
|
174
|
+
const _requiredFields: any = []
|
|
166
175
|
|
|
167
176
|
Object.values(validationFields?.fields?.checkout).map((field: any) => {
|
|
168
177
|
if (field?.required && !notFields.includes(field.code)) {
|
|
@@ -180,7 +189,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
180
189
|
) {
|
|
181
190
|
_requiredFields.push('cellphone')
|
|
182
191
|
}
|
|
183
|
-
|
|
192
|
+
setRequiredFields(_requiredFields)
|
|
184
193
|
|
|
185
194
|
if (phoneUpdate) {
|
|
186
195
|
errors.push(t('NECESSARY_UPDATE_COUNTRY_PHONE_CODE', 'It is necessary to update your phone number'))
|
|
@@ -195,18 +204,18 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
195
204
|
|
|
196
205
|
const handlePlaceOrder = (confirmPayment?: any) => {
|
|
197
206
|
if (stripePaymethods.includes(paymethodSelected?.gateway) && user?.guest_id) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
207
|
+
setOpenModal({ ...openModal, signup: true, isGuest: true })
|
|
208
|
+
return
|
|
209
|
+
}
|
|
201
210
|
|
|
202
211
|
if (!userErrors.length && (!requiredFields?.length || allowedGuest)) {
|
|
203
212
|
handleGroupPlaceOrder && handleGroupPlaceOrder(confirmPayment)
|
|
204
213
|
return
|
|
205
214
|
}
|
|
206
215
|
if (requiredFields?.length) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
216
|
+
setIsOpen(true)
|
|
217
|
+
return
|
|
218
|
+
}
|
|
210
219
|
let stringError = ''
|
|
211
220
|
Object.values(userErrors).map((item: any, i: number) => {
|
|
212
221
|
stringError += (i + 1) === userErrors.length ? `- ${item?.message || item}` : `- ${item?.message || item}\n`
|
|
@@ -216,22 +225,34 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
216
225
|
}
|
|
217
226
|
|
|
218
227
|
const handlePlaceOrderAsGuest = () => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
228
|
+
setIsOpen(false)
|
|
229
|
+
handleGroupPlaceOrder && handleGroupPlaceOrder()
|
|
230
|
+
}
|
|
222
231
|
|
|
223
232
|
const handleSuccessSignup = (user: any) => {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
login({
|
|
234
|
+
user,
|
|
235
|
+
token: user?.session?.access_token
|
|
236
|
+
})
|
|
237
|
+
openModal?.isGuest && handlePlaceOrderAsGuest()
|
|
238
|
+
setOpenModal({ ...openModal, signup: false, isGuest: false })
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const handleSuccessLogin = (user: any) => {
|
|
242
|
+
if (user) setOpenModal({ ...openModal, login: false })
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
|
|
246
|
+
setShowTitle(contentOffset.y > 30)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const handleGoBack = () => {
|
|
250
|
+
if (navigation?.canGoBack()) {
|
|
251
|
+
navigation.goBack()
|
|
252
|
+
} else {
|
|
253
|
+
navigation.navigate('BottomTab', { screen: 'Cart' })
|
|
254
|
+
}
|
|
255
|
+
}
|
|
235
256
|
|
|
236
257
|
useEffect(() => {
|
|
237
258
|
if (validationFields && validationFields?.fields?.checkout) {
|
|
@@ -271,17 +292,58 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
271
292
|
}
|
|
272
293
|
}, [paymethodSelected])
|
|
273
294
|
|
|
295
|
+
const changeActiveState = useCallback((isClosed: boolean, uuid: string) => {
|
|
296
|
+
const isActive = cartsOpened?.includes?.(uuid)
|
|
297
|
+
if (isActive || !isClosed) {
|
|
298
|
+
setCartsOpened(cartsOpened?.filter?.((_uuid) => _uuid !== uuid))
|
|
299
|
+
} else {
|
|
300
|
+
setCartsOpened([
|
|
301
|
+
...cartsOpened,
|
|
302
|
+
uuid
|
|
303
|
+
])
|
|
304
|
+
}
|
|
305
|
+
}, [cartsOpened])
|
|
306
|
+
|
|
274
307
|
return (
|
|
275
308
|
<>
|
|
276
|
-
<
|
|
309
|
+
<SafeAreaView style={{ backgroundColor: theme.colors.backgroundPage }}>
|
|
310
|
+
<View style={styles.wrapperNavbar}>
|
|
311
|
+
<TopHeader>
|
|
312
|
+
<>
|
|
313
|
+
<TopActions onPress={() => handleGoBack()}>
|
|
314
|
+
<IconAntDesign
|
|
315
|
+
name='arrowleft'
|
|
316
|
+
size={26}
|
|
317
|
+
/>
|
|
318
|
+
</TopActions>
|
|
319
|
+
{showTitle && (
|
|
320
|
+
<OText
|
|
321
|
+
size={16}
|
|
322
|
+
style={{ flex: 1, textAlign: 'center', right: 15 }}
|
|
323
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
324
|
+
numberOfLines={2}
|
|
325
|
+
ellipsizeMode='tail'
|
|
326
|
+
>
|
|
327
|
+
{t('CHECKOUT', 'Checkout')}
|
|
328
|
+
</OText>
|
|
329
|
+
)}
|
|
330
|
+
</>
|
|
331
|
+
</TopHeader>
|
|
332
|
+
</View>
|
|
333
|
+
</SafeAreaView>
|
|
334
|
+
<Container pt={0} noPadding onScroll={handleScroll} showsVerticalScrollIndicator={false}>
|
|
277
335
|
<View style={styles.wrapperNavbar}>
|
|
278
336
|
<NavBar
|
|
337
|
+
hideArrowLeft
|
|
279
338
|
title={t('CHECKOUT', 'Checkout')}
|
|
280
339
|
titleAlign={'center'}
|
|
281
340
|
onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
|
|
282
341
|
showCall={false}
|
|
283
342
|
paddingTop={Platform.OS === 'ios' ? 0 : 4}
|
|
284
343
|
btnStyle={{ paddingLeft: 0 }}
|
|
344
|
+
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
345
|
+
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
346
|
+
style={{ marginTop: 20 }}
|
|
285
347
|
/>
|
|
286
348
|
</View>
|
|
287
349
|
<ChContainer style={styles.pagePadding}>
|
|
@@ -473,6 +535,9 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
473
535
|
hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
|
|
474
536
|
onNavigationRedirect={(route: string, params: any) => props.navigation.navigate(route, params)}
|
|
475
537
|
businessConfigs={cart?.business?.configs}
|
|
538
|
+
cartsOpened={cartsOpened}
|
|
539
|
+
changeActiveState={changeActiveState}
|
|
540
|
+
isActive={cartsOpened?.includes?.(cart?.uuid)}
|
|
476
541
|
/>
|
|
477
542
|
{openCarts.length > 1 && (
|
|
478
543
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
@@ -582,30 +647,30 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
582
647
|
</ScrollView>
|
|
583
648
|
</OModal>
|
|
584
649
|
<OModal
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
650
|
+
open={isOpen}
|
|
651
|
+
onClose={() => setIsOpen(false)}
|
|
652
|
+
>
|
|
653
|
+
<View style={styles.detailWrapper}>
|
|
654
|
+
<UserDetails
|
|
655
|
+
isUserDetailsEdit
|
|
656
|
+
useValidationFields
|
|
657
|
+
useDefualtSessionManager
|
|
658
|
+
useSessionUser
|
|
659
|
+
isCheckout
|
|
660
|
+
isEdit
|
|
661
|
+
phoneUpdate={phoneUpdate}
|
|
662
|
+
togglePhoneUpdate={togglePhoneUpdate}
|
|
663
|
+
requiredFields={requiredFields}
|
|
664
|
+
hideUpdateButton
|
|
665
|
+
handlePlaceOrderAsGuest={handlePlaceOrderAsGuest}
|
|
666
|
+
onClose={() => {
|
|
667
|
+
setIsOpen(false)
|
|
668
|
+
handlePlaceOrder()
|
|
669
|
+
}}
|
|
670
|
+
setIsOpen={setIsOpen}
|
|
671
|
+
/>
|
|
672
|
+
</View>
|
|
673
|
+
</OModal>
|
|
609
674
|
</Container>
|
|
610
675
|
|
|
611
676
|
<FloatingButton
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
|
+
export const TopActions = styled.TouchableOpacity`
|
|
4
|
+
height: 60px;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
min-width: 30px;
|
|
7
|
+
padding-right: 15px;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const TopHeader = styled.View`
|
|
11
|
+
width: 100%;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
z-index: 1;
|
|
16
|
+
height: 60px;
|
|
17
|
+
min-height: 60px;
|
|
18
|
+
`
|
|
19
|
+
|
|
3
20
|
export const ChContainer = styled.View`
|
|
4
21
|
margin-bottom: 60px;
|
|
5
22
|
`
|
|
@@ -53,6 +53,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
53
53
|
const [{ configs }] = useConfig()
|
|
54
54
|
|
|
55
55
|
const isTaxIncludedOnPrice = orders.every((_order: any) => _order.taxes?.length ? _order.taxes?.every((_tax: any) => _tax.type === 1) : true)
|
|
56
|
+
const deliveryType = orders.find((order: any) => order.delivery_type)?.delivery_type
|
|
56
57
|
const progressBarStyle = configs.multi_business_checkout_progress_bar_style?.value
|
|
57
58
|
const showBarInOrder = ['group', 'both']
|
|
58
59
|
const showBarInIndividual = ['individual', 'both']
|
|
@@ -71,7 +72,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
71
72
|
navigation?.canGoBack() && navigation.goBack();
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
|
-
navigation.navigate('
|
|
75
|
+
navigation.navigate('BottomTab');
|
|
75
76
|
return true
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -93,7 +94,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
93
94
|
}, [])
|
|
94
95
|
|
|
95
96
|
return (
|
|
96
|
-
<OrdersDetailsContainer keyboardShouldPersistTaps="handled" contentContainerStyle={{ paddingHorizontal:
|
|
97
|
+
<OrdersDetailsContainer keyboardShouldPersistTaps="handled" contentContainerStyle={{ paddingHorizontal: 20 }}>
|
|
97
98
|
<View style={{ flexDirection: 'row' }}>
|
|
98
99
|
<OButton
|
|
99
100
|
imgRightSrc={null}
|
|
@@ -171,19 +172,23 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
171
172
|
))}
|
|
172
173
|
</Section>
|
|
173
174
|
<Divider />
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
175
|
+
{deliveryType === 1 && (
|
|
176
|
+
<>
|
|
177
|
+
<Section>
|
|
178
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={20}>
|
|
179
|
+
{t('DELIVERYA_V21', 'Delivery address')}
|
|
180
|
+
</OText>
|
|
181
|
+
{loading ? (
|
|
182
|
+
<PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
|
|
183
|
+
) : (
|
|
184
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
|
|
185
|
+
{customer?.address}
|
|
186
|
+
</OText>
|
|
187
|
+
)}
|
|
188
|
+
</Section>
|
|
189
|
+
<Divider />
|
|
190
|
+
</>
|
|
191
|
+
)}
|
|
187
192
|
{loading ? (
|
|
188
193
|
<Placeholder Animation={Fade}>
|
|
189
194
|
<PlaceholderLine
|
|
@@ -2,13 +2,14 @@ import React, { useState, useEffect } from 'react'
|
|
|
2
2
|
import { useLanguage } from 'ordering-components/native';
|
|
3
3
|
import { View, StyleSheet, RefreshControl, Platform } from 'react-native';
|
|
4
4
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
5
|
-
|
|
5
|
+
import { GiftCardOrdersList } from '../GiftCard/GiftCardOrdersList'
|
|
6
6
|
import { OrdersOption } from '../OrdersOption'
|
|
7
7
|
import { HeaderTitle, OButton, OText } from '../shared'
|
|
8
8
|
import { ScrollView } from 'react-native-gesture-handler';
|
|
9
9
|
import { Tab } from './styles'
|
|
10
10
|
import { useTheme } from 'styled-components/native';
|
|
11
11
|
import { Container } from '../../layouts/Container';
|
|
12
|
+
import NavBar from '../NavBar'
|
|
12
13
|
|
|
13
14
|
export const MyOrders = (props: any) => {
|
|
14
15
|
const {
|
|
@@ -40,7 +41,8 @@ export const MyOrders = (props: any) => {
|
|
|
40
41
|
const MyOrdersMenu = [
|
|
41
42
|
{ key: 'orders', value: t('ORDERS', 'Orders'), disabled: false },
|
|
42
43
|
{ key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
|
|
43
|
-
{ key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
|
|
44
|
+
{ key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab },
|
|
45
|
+
{ key: 'giftCards', value: t('GIFT_CARD', 'Gift card'), disabled: false }
|
|
44
46
|
]
|
|
45
47
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
46
48
|
|
|
@@ -87,34 +89,25 @@ export const MyOrders = (props: any) => {
|
|
|
87
89
|
display: 'flex',
|
|
88
90
|
flexDirection: 'row',
|
|
89
91
|
alignItems: 'center',
|
|
90
|
-
paddingHorizontal:
|
|
92
|
+
paddingHorizontal: 20,
|
|
91
93
|
},
|
|
92
94
|
...props.titleStyle
|
|
93
95
|
}}>
|
|
94
96
|
{!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
paddingRight: 0,
|
|
107
|
-
marginTop: 30,
|
|
108
|
-
}}
|
|
109
|
-
onClick={goToBack}
|
|
110
|
-
icon={AntDesignIcon}
|
|
111
|
-
iconProps={{
|
|
112
|
-
name: 'arrowleft',
|
|
113
|
-
size: 26
|
|
97
|
+
<NavBar
|
|
98
|
+
title={t('MY_ORDERS', 'My Orders')}
|
|
99
|
+
titleAlign={'center'}
|
|
100
|
+
onActionLeft={goToBack}
|
|
101
|
+
showCall={false}
|
|
102
|
+
paddingTop={30}
|
|
103
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
104
|
+
buttonProps={{
|
|
105
|
+
bgColor: theme.colors.white,
|
|
106
|
+
borderColor: theme.colors.white,
|
|
107
|
+
textStyle: { color: theme.colors.btnFont }
|
|
114
108
|
}}
|
|
115
109
|
/>
|
|
116
110
|
)}
|
|
117
|
-
<HeaderTitle ph={10} text={t('MY_ORDERS', 'My Orders')} />
|
|
118
111
|
</View>
|
|
119
112
|
)}
|
|
120
113
|
{!hideOrders && !isChewLayout && !showNavbar && (
|
|
@@ -124,7 +117,7 @@ export const MyOrders = (props: any) => {
|
|
|
124
117
|
<ScrollView
|
|
125
118
|
horizontal
|
|
126
119
|
style={{ ...styles.container, borderBottomWidth: 1 }}
|
|
127
|
-
contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 :
|
|
120
|
+
contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 20 }}
|
|
128
121
|
showsHorizontalScrollIndicator={false}
|
|
129
122
|
scrollEventThrottle={16}
|
|
130
123
|
>
|
|
@@ -148,7 +141,7 @@ export const MyOrders = (props: any) => {
|
|
|
148
141
|
)}
|
|
149
142
|
{selectedOption === 'orders' && (
|
|
150
143
|
<>
|
|
151
|
-
<View style={{ paddingHorizontal:
|
|
144
|
+
<View style={{ paddingHorizontal: 20 }}>
|
|
152
145
|
<OrdersOption
|
|
153
146
|
{...props}
|
|
154
147
|
preOrders
|
|
@@ -158,7 +151,7 @@ export const MyOrders = (props: any) => {
|
|
|
158
151
|
refreshOrders={refreshOrders}
|
|
159
152
|
/>
|
|
160
153
|
</View>
|
|
161
|
-
<View style={{ paddingHorizontal:
|
|
154
|
+
<View style={{ paddingHorizontal: 20 }}>
|
|
162
155
|
<OrdersOption
|
|
163
156
|
{...props}
|
|
164
157
|
activeOrders
|
|
@@ -168,7 +161,7 @@ export const MyOrders = (props: any) => {
|
|
|
168
161
|
refreshOrders={refreshOrders}
|
|
169
162
|
/>
|
|
170
163
|
</View>
|
|
171
|
-
<View style={{ paddingHorizontal:
|
|
164
|
+
<View style={{ paddingHorizontal: 20 }}>
|
|
172
165
|
<OrdersOption
|
|
173
166
|
{...props}
|
|
174
167
|
ordersLength={ordersLength}
|
|
@@ -215,7 +208,14 @@ export const MyOrders = (props: any) => {
|
|
|
215
208
|
setOrdersLength={setOrdersLength}
|
|
216
209
|
/>
|
|
217
210
|
)}
|
|
211
|
+
|
|
212
|
+
{selectedOption === 'giftCards' && (
|
|
213
|
+
<View style={{ paddingHorizontal: 20 }}>
|
|
214
|
+
<GiftCardOrdersList
|
|
215
|
+
onNavigationRedirect={props?.onNavigationRedirect}
|
|
216
|
+
/>
|
|
217
|
+
</View>
|
|
218
|
+
)}
|
|
218
219
|
</Container>
|
|
219
|
-
|
|
220
220
|
)
|
|
221
221
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
import * as React from 'react'
|
|
2
5
|
import styled, { useTheme } from 'styled-components/native'
|
|
3
6
|
import { OButton, OIcon, OText } from '../shared'
|
|
@@ -44,6 +47,7 @@ interface Props {
|
|
|
44
47
|
isVertical?: boolean,
|
|
45
48
|
noMargin?: any
|
|
46
49
|
hideArrowLeft?: boolean
|
|
50
|
+
buttonProps?: any
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
const NavBar = (props: Props) => {
|
|
@@ -64,6 +68,7 @@ const NavBar = (props: Props) => {
|
|
|
64
68
|
<Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
|
|
65
69
|
{!props.hideArrowLeft && (
|
|
66
70
|
<OButton
|
|
71
|
+
{...props.buttonProps}
|
|
67
72
|
iconProps={{
|
|
68
73
|
name: 'arrowleft',
|
|
69
74
|
size: 26
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { useLanguage
|
|
2
|
+
import { useLanguage } from 'ordering-components/native'
|
|
3
3
|
import { Dimensions } from 'react-native'
|
|
4
4
|
import RNRestart from 'react-native-restart'
|
|
5
5
|
import { OText, OIcon, OButton } from '../shared'
|
|
@@ -16,8 +16,7 @@ export const NetworkError = (props: NoNetworkParams) => {
|
|
|
16
16
|
} = props
|
|
17
17
|
const theme = useTheme()
|
|
18
18
|
const [, t] = useLanguage()
|
|
19
|
-
const
|
|
20
|
-
const urlimage = orderingTheme?.theme?.no_internet?.components?.image
|
|
19
|
+
const urlimage = theme?.no_internet?.components?.image
|
|
21
20
|
const noNetworkImage = image || theme.images.general.noNetwork
|
|
22
21
|
const deviceWidth = Dimensions.get('screen').width
|
|
23
22
|
|
|
@@ -2,10 +2,10 @@ import styled from 'styled-components/native'
|
|
|
2
2
|
|
|
3
3
|
export const Container = styled.View`
|
|
4
4
|
flex: 1;
|
|
5
|
-
padding: 20px
|
|
5
|
+
padding: 20px;
|
|
6
6
|
`
|
|
7
7
|
export const ImageContainer = styled.View`
|
|
8
8
|
flex: 1;
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
|
-
`
|
|
11
|
+
`
|