ordering-ui-react-native 0.19.2-testing → 0.19.3-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 +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +41 -13
- package/themes/business/src/components/DriverMap/index.tsx +4 -2
- package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +121 -103
- package/themes/business/src/components/OrderDetails/Delivery.tsx +19 -10
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -51
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +26 -6
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +27 -13
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +83 -37
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +24 -31
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- 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/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserProfileForm/index.tsx +27 -10
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/types/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/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
- 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 +7 -3
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +3 -3
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +9 -6
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- 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/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +43 -19
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- 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 +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
- 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 +27 -8
- package/themes/original/src/components/CartContent/index.tsx +61 -39
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +199 -55
- 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 +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +4 -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/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- 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/GoogleMap/index.tsx +50 -5
- 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 +1 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
- package/themes/original/src/components/LoginForm/index.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +4 -4
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +13 -4
- package/themes/original/src/components/MultiCheckout/index.tsx +184 -51
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +5 -5
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- 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 +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
- package/themes/original/src/components/OrderDetails/index.tsx +716 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +7 -7
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +5 -3
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -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 +4 -3
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -32
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +81 -167
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SingleOrderCard/index.tsx +4 -3
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +53 -7
- package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -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 +53 -7
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- 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 +10 -2
- package/themes/original/src/utils/index.tsx +124 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native'
|
|
3
|
+
import {
|
|
4
|
+
useLanguage,
|
|
5
|
+
useOrder,
|
|
6
|
+
useConfig
|
|
7
|
+
} from 'ordering-components/native'
|
|
8
|
+
import { useTheme } from 'styled-components/native';
|
|
9
|
+
import { OText, OButton } from '../shared'
|
|
10
|
+
import {
|
|
11
|
+
CartList,
|
|
12
|
+
CartDivider,
|
|
13
|
+
TopActionsHeader,
|
|
14
|
+
TopHeader
|
|
15
|
+
} from './styles'
|
|
16
|
+
import { OrderSummary } from '../OrderSummary';
|
|
17
|
+
import { Cart } from '../Cart';
|
|
18
|
+
import { ScrollView } from 'react-native-gesture-handler';
|
|
19
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
20
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
21
|
+
import { UpsellingLayout } from './UpsellingLayout';
|
|
22
|
+
|
|
23
|
+
export const UpsellingContent = (props : any) => {
|
|
24
|
+
const {
|
|
25
|
+
onGoBack,
|
|
26
|
+
handleUpsellingPage,
|
|
27
|
+
onNavigationRedirect,
|
|
28
|
+
cart,
|
|
29
|
+
productsList
|
|
30
|
+
} = props
|
|
31
|
+
|
|
32
|
+
const theme = useTheme();
|
|
33
|
+
|
|
34
|
+
const [{ carts }] = useOrder()
|
|
35
|
+
const [{ configs }] = useConfig()
|
|
36
|
+
const [, t] = useLanguage()
|
|
37
|
+
const { bottom } = useSafeAreaInsets()
|
|
38
|
+
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
39
|
+
const [showTitle, setShowTitle] = useState(false)
|
|
40
|
+
|
|
41
|
+
const isMultiCheckout = configs?.checkout_multi_business_enabled?.value === '1'
|
|
42
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
43
|
+
const showCartList = isChewLayout
|
|
44
|
+
const commentDelayTime = isChewLayout ? 500 : null
|
|
45
|
+
|
|
46
|
+
const cartList = (carts && Object.values(carts).filter((_cart: any) => _cart?.products?.length > 0 && _cart.uuid !== cart?.uuid)) || []
|
|
47
|
+
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
closeUpsellingButton: {
|
|
50
|
+
borderRadius: 7.6,
|
|
51
|
+
borderColor: theme.colors.primary,
|
|
52
|
+
backgroundColor: theme.colors.primary,
|
|
53
|
+
borderWidth: 1,
|
|
54
|
+
alignSelf: 'center',
|
|
55
|
+
height: 44,
|
|
56
|
+
shadowOpacity: 0,
|
|
57
|
+
width: '80%',
|
|
58
|
+
},
|
|
59
|
+
cancelBtn: {
|
|
60
|
+
paddingHorizontal: 18,
|
|
61
|
+
borderWidth: 1,
|
|
62
|
+
borderRadius: 7.6,
|
|
63
|
+
borderColor: theme.colors.textSecondary,
|
|
64
|
+
height: 38
|
|
65
|
+
},
|
|
66
|
+
headerItem: {
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
marginVertical: 2,
|
|
70
|
+
marginHorizontal: 20,
|
|
71
|
+
},
|
|
72
|
+
btnBackArrow: {
|
|
73
|
+
borderWidth: 0,
|
|
74
|
+
width: 26,
|
|
75
|
+
height: 26,
|
|
76
|
+
backgroundColor: theme.colors.clear,
|
|
77
|
+
borderColor: theme.colors.clear,
|
|
78
|
+
shadowColor: theme.colors.clear,
|
|
79
|
+
paddingLeft: 0,
|
|
80
|
+
paddingRight: 0,
|
|
81
|
+
marginLeft: 20,
|
|
82
|
+
marginBottom: 10
|
|
83
|
+
},
|
|
84
|
+
wrapperNavbar: {
|
|
85
|
+
paddingHorizontal: 20,
|
|
86
|
+
paddingTop: 0,
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
|
|
92
|
+
setShowTitle(contentOffset.y > 30)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<>
|
|
97
|
+
<View style={styles.wrapperNavbar}>
|
|
98
|
+
<TopHeader>
|
|
99
|
+
<>
|
|
100
|
+
<TopActionsHeader onPress={() => onGoBack()}>
|
|
101
|
+
<IconAntDesign
|
|
102
|
+
name='arrowleft'
|
|
103
|
+
size={26}
|
|
104
|
+
/>
|
|
105
|
+
</TopActionsHeader>
|
|
106
|
+
{showTitle && (
|
|
107
|
+
<OText
|
|
108
|
+
size={16}
|
|
109
|
+
style={{ flex: 1, textAlign: 'center', right: 15 }}
|
|
110
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
111
|
+
numberOfLines={2}
|
|
112
|
+
ellipsizeMode='tail'
|
|
113
|
+
>
|
|
114
|
+
{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}
|
|
115
|
+
</OText>
|
|
116
|
+
)}
|
|
117
|
+
</>
|
|
118
|
+
</TopHeader>
|
|
119
|
+
</View>
|
|
120
|
+
<ScrollView style={{ marginTop: 10, marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false} onScroll={handleScroll}>
|
|
121
|
+
{productsList.length > 0 &&
|
|
122
|
+
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
123
|
+
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
124
|
+
<UpsellingLayout {...props} />
|
|
125
|
+
</View>
|
|
126
|
+
}
|
|
127
|
+
<View style={{ paddingHorizontal: 40 }}>
|
|
128
|
+
<OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
|
|
129
|
+
<OrderSummary
|
|
130
|
+
cart={cart}
|
|
131
|
+
commentDelayTime={commentDelayTime}
|
|
132
|
+
isCartPending={cart?.status === 2}
|
|
133
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
134
|
+
/>
|
|
135
|
+
</View>
|
|
136
|
+
{showCartList && cartList.map((cart: any, i: number) => (
|
|
137
|
+
<CartList key={i}>
|
|
138
|
+
<Cart
|
|
139
|
+
isFromUpselling
|
|
140
|
+
cart={cart}
|
|
141
|
+
cartuuid={cart.uuid}
|
|
142
|
+
hideUpselling
|
|
143
|
+
singleBusiness={props.singleBusiness}
|
|
144
|
+
isFranchiseApp={props.isFranchiseApp}
|
|
145
|
+
isCartsLoading={isCartsLoading}
|
|
146
|
+
setIsCartsLoading={setIsCartsLoading}
|
|
147
|
+
isMultiCheckout={isMultiCheckout}
|
|
148
|
+
onNavigationRedirect={props.onNavigationRedirect}
|
|
149
|
+
/>
|
|
150
|
+
<CartDivider />
|
|
151
|
+
</CartList>
|
|
152
|
+
))}
|
|
153
|
+
</ScrollView>
|
|
154
|
+
<View
|
|
155
|
+
style={{
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
bottom: props.isPage ? Platform.OS === 'ios' ? 0 : 20 : Platform.OS === 'ios' ? bottom + 59 : bottom + 125
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<OButton
|
|
161
|
+
imgRightSrc=''
|
|
162
|
+
text={t('CHECKOUT', 'Checkout')}
|
|
163
|
+
style={{ ...styles.closeUpsellingButton }}
|
|
164
|
+
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
165
|
+
onClick={() => handleUpsellingPage(cart)}
|
|
166
|
+
/>
|
|
167
|
+
</View>
|
|
168
|
+
</>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native'
|
|
3
|
+
import {
|
|
4
|
+
useUtils,
|
|
5
|
+
useLanguage
|
|
6
|
+
} from 'ordering-components/native'
|
|
7
|
+
import {
|
|
8
|
+
Container,
|
|
9
|
+
UpsellingContainer,
|
|
10
|
+
Item,
|
|
11
|
+
Details,
|
|
12
|
+
AddButton,
|
|
13
|
+
} from './styles'
|
|
14
|
+
import { OIcon, OText } from '../shared'
|
|
15
|
+
import { useTheme } from 'styled-components/native';
|
|
16
|
+
|
|
17
|
+
export const UpsellingLayout = (props : any) => {
|
|
18
|
+
const {
|
|
19
|
+
upsellingProducts,
|
|
20
|
+
productsList,
|
|
21
|
+
onNavigationRedirect,
|
|
22
|
+
business
|
|
23
|
+
} = props
|
|
24
|
+
const theme = useTheme()
|
|
25
|
+
const [{ parsePrice }] = useUtils()
|
|
26
|
+
const [, t] = useLanguage()
|
|
27
|
+
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
imageStyle: {
|
|
30
|
+
width: 73,
|
|
31
|
+
height: 73,
|
|
32
|
+
resizeMode: 'cover',
|
|
33
|
+
borderRadius: 7.6,
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const handleFormProduct = (product: any) => {
|
|
38
|
+
onNavigationRedirect && onNavigationRedirect('ProductDetails', {
|
|
39
|
+
product: product,
|
|
40
|
+
businessId: product?.api?.businessId,
|
|
41
|
+
businessSlug: business.slug,
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<Container>
|
|
49
|
+
<UpsellingContainer
|
|
50
|
+
horizontal
|
|
51
|
+
showsHorizontalScrollIndicator={false}
|
|
52
|
+
contentContainerStyle={{ paddingHorizontal: Platform.OS === 'ios' ? 40 : 0 }}
|
|
53
|
+
>
|
|
54
|
+
{
|
|
55
|
+
!upsellingProducts.loading && (
|
|
56
|
+
<>
|
|
57
|
+
{
|
|
58
|
+
!upsellingProducts.error ? productsList.map((product: any, i: number) => (
|
|
59
|
+
<Item key={`${product.id}_${i}`}>
|
|
60
|
+
<View style={{ flexBasis: '57%' }}>
|
|
61
|
+
<Details>
|
|
62
|
+
<OText size={12} lineHeight={18} numberOfLines={1} ellipsizeMode='tail'>{product.name}</OText>
|
|
63
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal}>{parsePrice(product.price)}</OText>
|
|
64
|
+
</Details>
|
|
65
|
+
<AddButton onPress={() => handleFormProduct(product)}>
|
|
66
|
+
<OText size={10} color={theme.colors.primary}>{t('ADD', 'Add')}</OText>
|
|
67
|
+
</AddButton>
|
|
68
|
+
</View>
|
|
69
|
+
<View>
|
|
70
|
+
<OIcon url={product?.images || theme?.images?.dummies?.product} style={styles.imageStyle} />
|
|
71
|
+
</View>
|
|
72
|
+
</Item>
|
|
73
|
+
)) : (
|
|
74
|
+
<OText>
|
|
75
|
+
{upsellingProducts.message}
|
|
76
|
+
</OText>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
</>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
</UpsellingContainer>
|
|
83
|
+
</Container>
|
|
84
|
+
</>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
@@ -1,116 +1,41 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { Platform, StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
3
2
|
import {
|
|
4
3
|
UpsellingPage as UpsellingPageController,
|
|
5
|
-
useUtils,
|
|
6
|
-
useLanguage,
|
|
7
4
|
useOrder,
|
|
8
|
-
useConfig
|
|
9
5
|
} from 'ordering-components/native'
|
|
10
|
-
import {
|
|
11
|
-
import { OText, OIcon, OBottomPopup, OButton } from '../shared'
|
|
6
|
+
import { OBottomPopup } from '../shared'
|
|
12
7
|
import { UpsellingProductsParams } from '../../types'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Item,
|
|
17
|
-
Details,
|
|
18
|
-
AddButton,
|
|
19
|
-
CartList,
|
|
20
|
-
CartDivider
|
|
21
|
-
} from './styles'
|
|
22
|
-
import { OrderSummary } from '../OrderSummary';
|
|
23
|
-
import { Cart } from '../Cart';
|
|
24
|
-
import { ScrollView } from 'react-native-gesture-handler';
|
|
25
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
8
|
+
|
|
9
|
+
import { UpsellingLayout } from './UpsellingLayout';
|
|
10
|
+
import { UpsellingContent } from './UpsellingContent';
|
|
26
11
|
|
|
27
12
|
const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
28
13
|
const {
|
|
29
14
|
isCustomMode,
|
|
30
15
|
upsellingProducts,
|
|
31
|
-
business,
|
|
32
16
|
handleUpsellingPage,
|
|
33
17
|
openUpselling,
|
|
34
18
|
canOpenUpselling,
|
|
35
19
|
setCanOpenUpselling,
|
|
36
|
-
isFromCart
|
|
37
|
-
onNavigationRedirect,
|
|
38
|
-
onGoBack
|
|
20
|
+
isFromCart
|
|
39
21
|
} = props
|
|
40
22
|
|
|
41
|
-
const theme = useTheme();
|
|
42
|
-
|
|
43
|
-
const styles = StyleSheet.create({
|
|
44
|
-
imageStyle: {
|
|
45
|
-
width: 73,
|
|
46
|
-
height: 73,
|
|
47
|
-
resizeMode: 'cover',
|
|
48
|
-
borderRadius: 7.6,
|
|
49
|
-
},
|
|
50
|
-
closeUpsellingButton: {
|
|
51
|
-
borderRadius: 7.6,
|
|
52
|
-
borderColor: theme.colors.primary,
|
|
53
|
-
backgroundColor: theme.colors.primary,
|
|
54
|
-
borderWidth: 1,
|
|
55
|
-
alignSelf: 'center',
|
|
56
|
-
height: 44,
|
|
57
|
-
shadowOpacity: 0,
|
|
58
|
-
width: '80%',
|
|
59
|
-
},
|
|
60
|
-
cancelBtn: {
|
|
61
|
-
paddingHorizontal: 18,
|
|
62
|
-
borderWidth: 1,
|
|
63
|
-
borderRadius: 7.6,
|
|
64
|
-
borderColor: theme.colors.textSecondary,
|
|
65
|
-
height: 38
|
|
66
|
-
},
|
|
67
|
-
headerItem: {
|
|
68
|
-
flexDirection: 'row',
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
marginVertical: 2,
|
|
71
|
-
marginHorizontal: 20,
|
|
72
|
-
},
|
|
73
|
-
btnBackArrow: {
|
|
74
|
-
borderWidth: 0,
|
|
75
|
-
width: 26,
|
|
76
|
-
height: 26,
|
|
77
|
-
backgroundColor: theme.colors.clear,
|
|
78
|
-
borderColor: theme.colors.clear,
|
|
79
|
-
shadowColor: theme.colors.clear,
|
|
80
|
-
paddingLeft: 0,
|
|
81
|
-
paddingRight: 0,
|
|
82
|
-
marginLeft: 20,
|
|
83
|
-
marginBottom: 10
|
|
84
|
-
},
|
|
85
|
-
})
|
|
86
|
-
|
|
87
23
|
const [{ carts }] = useOrder()
|
|
88
|
-
const [{ parsePrice }] = useUtils()
|
|
89
|
-
const [{ configs }] = useConfig()
|
|
90
|
-
const [, t] = useLanguage()
|
|
91
|
-
const { bottom } = useSafeAreaInsets()
|
|
92
|
-
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
93
|
-
|
|
94
|
-
const isMultiCheckout = configs?.checkout_multi_business_enabled?.value === '1'
|
|
95
|
-
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
96
|
-
const showCartList = isChewLayout
|
|
97
|
-
const commentDelayTime = isChewLayout ? 500 : null
|
|
98
24
|
|
|
99
25
|
const cart = carts?.[`businessId:${props.businessId}`] ?? {}
|
|
100
|
-
const cartList = (carts && Object.values(carts).filter((_cart: any) => _cart?.products?.length > 0 && _cart.uuid !== cart?.uuid)) || []
|
|
101
26
|
const cartProducts = cart?.products?.length
|
|
102
|
-
|
|
103
|
-
|
|
27
|
+
? cart?.products.map((product: any) => product.id)
|
|
28
|
+
: []
|
|
104
29
|
|
|
105
30
|
const productsList = !upsellingProducts.loading && !upsellingProducts.error
|
|
106
|
-
|
|
31
|
+
? upsellingProducts?.products?.length
|
|
107
32
|
? upsellingProducts?.products.filter((product: any) => !cartProducts.includes(product.id))
|
|
108
33
|
: (props?.products ?? []).filter((product: any) => !cartProducts.includes(product.id)) ?? []
|
|
109
|
-
|
|
34
|
+
: []
|
|
110
35
|
|
|
111
36
|
useEffect(() => {
|
|
112
37
|
if (!isCustomMode && !props.products) {
|
|
113
|
-
if (!upsellingProducts
|
|
38
|
+
if (!upsellingProducts?.loading) {
|
|
114
39
|
if (upsellingProducts?.products?.length && !isFromCart) {
|
|
115
40
|
setCanOpenUpselling && setCanOpenUpselling(true)
|
|
116
41
|
} else {
|
|
@@ -118,125 +43,16 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
118
43
|
}
|
|
119
44
|
}
|
|
120
45
|
}
|
|
121
|
-
}, [upsellingProducts
|
|
122
|
-
|
|
123
|
-
const handleFormProduct = (product: any) => {
|
|
124
|
-
onNavigationRedirect && onNavigationRedirect('ProductDetails', {
|
|
125
|
-
product: product,
|
|
126
|
-
businessId: product?.api?.businessId,
|
|
127
|
-
businessSlug: business.slug,
|
|
128
|
-
})
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const UpsellingLayout = () => {
|
|
132
|
-
return (
|
|
133
|
-
<Container>
|
|
134
|
-
<UpsellingContainer
|
|
135
|
-
horizontal
|
|
136
|
-
showsHorizontalScrollIndicator={false}
|
|
137
|
-
contentContainerStyle={{ paddingHorizontal: Platform.OS === 'ios' ? 40 : 0 }}
|
|
138
|
-
>
|
|
139
|
-
{
|
|
140
|
-
!upsellingProducts.loading && (
|
|
141
|
-
<>
|
|
142
|
-
{
|
|
143
|
-
!upsellingProducts.error ? productsList.map((product: any, i: number) => (
|
|
144
|
-
<Item key={`${product.id}_${i}`}>
|
|
145
|
-
<View style={{ flexBasis: '57%' }}>
|
|
146
|
-
<Details>
|
|
147
|
-
<OText size={12} lineHeight={18} numberOfLines={1} ellipsizeMode='tail'>{product.name}</OText>
|
|
148
|
-
<OText size={12} lineHeight={18} color={theme.colors.textNormal}>{parsePrice(product.price)}</OText>
|
|
149
|
-
</Details>
|
|
150
|
-
<AddButton onPress={() => handleFormProduct(product)}>
|
|
151
|
-
<OText size={10} color={theme.colors.primary}>{t('ADD', 'Add')}</OText>
|
|
152
|
-
</AddButton>
|
|
153
|
-
</View>
|
|
154
|
-
<View>
|
|
155
|
-
<OIcon url={product?.images || theme?.images?.dummies?.product} style={styles.imageStyle} />
|
|
156
|
-
</View>
|
|
157
|
-
</Item>
|
|
158
|
-
)) : (
|
|
159
|
-
<OText>
|
|
160
|
-
{upsellingProducts.message}
|
|
161
|
-
</OText>
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
</>
|
|
165
|
-
)
|
|
166
|
-
}
|
|
167
|
-
</UpsellingContainer>
|
|
168
|
-
</Container>
|
|
169
|
-
)
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const UpsellingContent = () => {
|
|
173
|
-
return (
|
|
174
|
-
<>
|
|
175
|
-
<View style={{ ...styles.headerItem, flex: 1, marginTop: Platform.OS == 'ios' ? 35 : 14 }}>
|
|
176
|
-
<TouchableOpacity onPress={() => onGoBack()} style={styles.btnBackArrow}>
|
|
177
|
-
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
178
|
-
</TouchableOpacity>
|
|
179
|
-
</View>
|
|
180
|
-
<ScrollView style={{ marginTop: 10, marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
|
|
181
|
-
{productsList.length > 0 &&
|
|
182
|
-
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
183
|
-
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
184
|
-
<UpsellingLayout />
|
|
185
|
-
</View>
|
|
186
|
-
}
|
|
187
|
-
<View style={{ paddingHorizontal: 40 }}>
|
|
188
|
-
<OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
|
|
189
|
-
<OrderSummary
|
|
190
|
-
cart={cart}
|
|
191
|
-
commentDelayTime={commentDelayTime}
|
|
192
|
-
isCartPending={cart?.status === 2}
|
|
193
|
-
onNavigationRedirect={onNavigationRedirect}
|
|
194
|
-
/>
|
|
195
|
-
</View>
|
|
196
|
-
{showCartList && cartList.map((cart: any, i: number) => (
|
|
197
|
-
<CartList key={i}>
|
|
198
|
-
<Cart
|
|
199
|
-
isFromUpselling
|
|
200
|
-
cart={cart}
|
|
201
|
-
cartuuid={cart.uuid}
|
|
202
|
-
hideUpselling
|
|
203
|
-
singleBusiness={props.singleBusiness}
|
|
204
|
-
isFranchiseApp={props.isFranchiseApp}
|
|
205
|
-
isCartsLoading={isCartsLoading}
|
|
206
|
-
setIsCartsLoading={setIsCartsLoading}
|
|
207
|
-
isMultiCheckout={isMultiCheckout}
|
|
208
|
-
onNavigationRedirect={props.onNavigationRedirect}
|
|
209
|
-
/>
|
|
210
|
-
<CartDivider />
|
|
211
|
-
</CartList>
|
|
212
|
-
))}
|
|
213
|
-
</ScrollView>
|
|
214
|
-
<View
|
|
215
|
-
style={{
|
|
216
|
-
alignItems: 'center',
|
|
217
|
-
bottom: props.isPage ? Platform.OS === 'ios' ? 0 : 20 : Platform.OS === 'ios' ? bottom + 59 : bottom + 125
|
|
218
|
-
}}
|
|
219
|
-
>
|
|
220
|
-
<OButton
|
|
221
|
-
imgRightSrc=''
|
|
222
|
-
text={t('CHECKOUT', 'Checkout')}
|
|
223
|
-
style={{ ...styles.closeUpsellingButton }}
|
|
224
|
-
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
225
|
-
onClick={() => handleUpsellingPage(cart)}
|
|
226
|
-
/>
|
|
227
|
-
</View>
|
|
228
|
-
</>
|
|
229
|
-
)
|
|
230
|
-
}
|
|
46
|
+
}, [upsellingProducts?.loading, upsellingProducts?.products?.length])
|
|
231
47
|
|
|
232
48
|
return (
|
|
233
49
|
<>
|
|
234
50
|
{isCustomMode ? (
|
|
235
|
-
<UpsellingLayout />
|
|
51
|
+
<UpsellingLayout {...props} productsList={productsList} />
|
|
236
52
|
) : (
|
|
237
53
|
<>
|
|
238
54
|
{props.isPage ? (
|
|
239
|
-
<UpsellingContent />
|
|
55
|
+
<UpsellingContent {...props} cart={cart} productsList={productsList} />
|
|
240
56
|
) : (
|
|
241
57
|
canOpenUpselling && (
|
|
242
58
|
<OBottomPopup
|
|
@@ -245,7 +61,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
245
61
|
onClose={() => handleUpsellingPage(cart)}
|
|
246
62
|
isStatusBar
|
|
247
63
|
>
|
|
248
|
-
<UpsellingContent />
|
|
64
|
+
<UpsellingContent {...props} productsList={productsList} />
|
|
249
65
|
</OBottomPopup>
|
|
250
66
|
)
|
|
251
67
|
)}
|
|
@@ -59,3 +59,22 @@ export const CartDivider = styled.View`
|
|
|
59
59
|
background-color: ${(props: any) => props.theme.colors.backgroundGray100};
|
|
60
60
|
margin: 20px -40px 0;
|
|
61
61
|
`
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export const TopActionsHeader = styled.TouchableOpacity`
|
|
65
|
+
height: 60px;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
min-width: 30px;
|
|
68
|
+
padding-right: 15px;
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
export const TopHeader = styled.View`
|
|
72
|
+
width: 100%;
|
|
73
|
+
flex-direction: row;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
height: 60px;
|
|
78
|
+
min-height: 60px;
|
|
79
|
+
`
|
|
80
|
+
|
|
@@ -13,6 +13,8 @@ import { OAlert } from '../../../../../src/components/shared'
|
|
|
13
13
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
14
14
|
import { sortInputFields } from '../../utils';
|
|
15
15
|
import { ListItem } from '../UserProfile/styles';
|
|
16
|
+
import moment from 'moment';
|
|
17
|
+
import { DatePickerUI } from '../DatePicker';
|
|
16
18
|
|
|
17
19
|
export const UserFormDetailsUI = (props: any) => {
|
|
18
20
|
const {
|
|
@@ -81,6 +83,8 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
81
83
|
const [isValid, setIsValid] = useState(false)
|
|
82
84
|
const [isChanged, setIsChanged] = useState(false)
|
|
83
85
|
const [isModalOpen, setIsModalOpen] = useState(false)
|
|
86
|
+
const [birthdate, setBirthdate] = useState(user?.birthdate ?? null)
|
|
87
|
+
const [showDatePicker, setShowDatePicker] = useState(false)
|
|
84
88
|
const [phoneInputData, setPhoneInputData] = useState({
|
|
85
89
|
error: '',
|
|
86
90
|
phone: {
|
|
@@ -92,6 +96,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
92
96
|
|
|
93
97
|
const isAdmin = user?.level === 0
|
|
94
98
|
const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
|
|
99
|
+
const showInputBirthday = validationFields?.fields?.checkout?.birthdate?.enabled ?? false
|
|
95
100
|
|
|
96
101
|
const handleSuccessSignup = (user: any) => {
|
|
97
102
|
login({
|
|
@@ -206,6 +211,13 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
206
211
|
handleChangeInput(countryCode, true);
|
|
207
212
|
}
|
|
208
213
|
|
|
214
|
+
const _handleChangeDate = (date: any) => {
|
|
215
|
+
setBirthdate(date)
|
|
216
|
+
const _birthdate = moment(date).format('YYYY-MM-DD')
|
|
217
|
+
handleChangeInput({ target: { name: 'birthdate', value: _birthdate } })
|
|
218
|
+
setShowDatePicker(false)
|
|
219
|
+
}
|
|
220
|
+
|
|
209
221
|
const onRemoveAccount = () => {
|
|
210
222
|
setConfirm({
|
|
211
223
|
open: true,
|
|
@@ -268,6 +280,14 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
268
280
|
}
|
|
269
281
|
}, [phoneInputData, configs?.verification_phone_required?.value, isChanged])
|
|
270
282
|
|
|
283
|
+
useEffect(() => {
|
|
284
|
+
if (!validationFields.loading && birthdate) {
|
|
285
|
+
setValue('birthdate', formState?.result?.result
|
|
286
|
+
? formState?.result?.result?.birthdate
|
|
287
|
+
: formState?.changes?.birthdate ?? (user && user?.birthdate) ?? '')
|
|
288
|
+
}
|
|
289
|
+
}, [validationFields, birthdate])
|
|
290
|
+
|
|
271
291
|
useEffect(() => {
|
|
272
292
|
if (!requiredFields || formState?.changes?.length === 0) return
|
|
273
293
|
const _isValid = requiredFields.every((key: any) => formState?.changes[key])
|
|
@@ -359,7 +379,21 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
359
379
|
</React.Fragment>
|
|
360
380
|
),
|
|
361
381
|
)}
|
|
362
|
-
|
|
382
|
+
{showInputBirthday && (
|
|
383
|
+
<WrapperPhone>
|
|
384
|
+
<OText size={14} lineHeight={21} color={theme.colors.textNormal} weight={'500'} style={{ textTransform: 'capitalize', alignSelf: 'flex-start' }}>
|
|
385
|
+
{t('BIRTHDATE', 'Birthdate')}
|
|
386
|
+
</OText>
|
|
387
|
+
<TouchableOpacity onPress={() => setShowDatePicker(!showDatePicker)}>
|
|
388
|
+
<OText size={14} lineHeight={21} color={theme.colors.textNormal} weight={'500'} style={{ alignSelf: 'flex-start' }}>
|
|
389
|
+
{birthdate ? moment(birthdate).format('YYYY-MM-DD') : ''}
|
|
390
|
+
</OText>
|
|
391
|
+
</TouchableOpacity>
|
|
392
|
+
{showDatePicker && (
|
|
393
|
+
<DatePickerUI birthdate={birthdate} handleChangeDate={_handleChangeDate} />
|
|
394
|
+
)}
|
|
395
|
+
</WrapperPhone>
|
|
396
|
+
)}
|
|
363
397
|
{!!showInputPhoneNumber && ((requiredFields && requiredFields.includes('cellphone')) || !requiredFields) && (
|
|
364
398
|
<WrapperPhone>
|
|
365
399
|
<OText size={14} lineHeight={21} weight={'500'} color={theme.colors.textNormal}>{t('PHONE', 'Phone')}</OText>
|
|
@@ -448,8 +482,8 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
448
482
|
? t('UPDATING', 'Updating...')
|
|
449
483
|
: t('UPDATE', 'Update')
|
|
450
484
|
}
|
|
451
|
-
bgColor={theme.colors.
|
|
452
|
-
textStyle={{ color: theme.colors.
|
|
485
|
+
bgColor={theme.colors.primary}
|
|
486
|
+
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
453
487
|
borderColor={theme.colors.primary}
|
|
454
488
|
isDisabled={formState.loading}
|
|
455
489
|
imgRightSrc={null}
|
|
@@ -468,12 +502,25 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
468
502
|
? t('SIGN_UP_AND_PLACE_ORDER', 'Sign up and place order')
|
|
469
503
|
: t('CONTINUE', 'Continue'))
|
|
470
504
|
}
|
|
471
|
-
bgColor={theme.colors.
|
|
472
|
-
textStyle={{
|
|
505
|
+
bgColor={theme.colors.primary}
|
|
506
|
+
textStyle={{
|
|
507
|
+
color: !user?.guest_id && (formState.loading || !isValid) ? theme.colors.primary : theme.colors.white,
|
|
508
|
+
fontSize: 14
|
|
509
|
+
}}
|
|
473
510
|
borderColor={theme.colors.primary}
|
|
474
511
|
isDisabled={!user?.guest_id && (formState.loading || !isValid)}
|
|
475
512
|
imgRightSrc={null}
|
|
476
|
-
style={{
|
|
513
|
+
style={{
|
|
514
|
+
borderRadius: 7.6,
|
|
515
|
+
shadowOpacity: 0,
|
|
516
|
+
width: '100%',
|
|
517
|
+
borderWidth: 1,
|
|
518
|
+
marginTop: 20,
|
|
519
|
+
marginBottom: 20,
|
|
520
|
+
backgroundColor: !user?.guest_id && (formState.loading || !isValid) ? theme.colors.lightGray : theme.colors.primary,
|
|
521
|
+
borderColor: !user?.guest_id && (formState.loading || !isValid) ? theme.colors.white : theme.colors.primary,
|
|
522
|
+
opacity: !user?.guest_id && (formState.loading || !isValid) ? 0.3 : 1,
|
|
523
|
+
}}
|
|
477
524
|
onClick={!user?.guest_id ? handleSubmit(onSubmit) : () => setIsModalOpen(true)}
|
|
478
525
|
/>
|
|
479
526
|
)}
|
|
@@ -507,4 +554,3 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
507
554
|
</>
|
|
508
555
|
);
|
|
509
556
|
};
|
|
510
|
-
|