ordering-ui-react-native 0.21.19 → 0.21.20-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 +7 -6
- 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 +4 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +2 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +4 -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 -3
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +4 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- 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 +163 -113
- package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +60 -53
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +240 -76
- 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 +125 -48
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- 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 +41 -38
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +194 -220
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +17 -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 +98 -43
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +21 -1
- 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/LoginForm/index.tsx +7 -4
- 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 +9 -4
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +10 -6
- 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/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +20 -12
- 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 +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 +2 -3
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +51 -20
- 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 +24 -404
- 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 +32 -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 +190 -66
- 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 +33 -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/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- 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/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 +6 -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 +2 -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 +4 -16
- 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 -3
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
- 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 +24 -29
- 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 +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +716 -668
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +28 -6
- 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 +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 +3 -5
- 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/PaymentOptionCard/index.tsx +4 -2
- 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 +72 -6
- 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 +74 -165
- package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
- 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 +5 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
- package/themes/original/src/components/StripeElementsForm/index.tsx +72 -59
- package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
- 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 +54 -8
- 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 +30 -36
- 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/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 +1 -0
- 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
|
@@ -169,7 +169,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
return (
|
|
172
|
-
<
|
|
172
|
+
<View style={{ minHeight: hideAddButton ? 125 : 190, marginLeft: logoPosition === 'left' ? 12.5 : 0 }}>
|
|
173
173
|
{isIntersectionObserver ? (
|
|
174
174
|
<CardAnimation
|
|
175
175
|
onClick={() => handleClickproduct()}
|
|
@@ -340,7 +340,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
340
340
|
</Placeholder>
|
|
341
341
|
</View>
|
|
342
342
|
)}
|
|
343
|
-
</
|
|
343
|
+
</View>
|
|
344
344
|
);
|
|
345
345
|
}, SingleProductCardPropsAreEqual);
|
|
346
346
|
|
|
@@ -49,15 +49,12 @@ export const RibbonBox = styled.View`
|
|
|
49
49
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
50
50
|
padding: 1px 8px;
|
|
51
51
|
max-width: 60px;
|
|
52
|
-
|
|
53
52
|
${(props: any) => props.bgColor && css`
|
|
54
53
|
background-color: ${props.bgColor};
|
|
55
54
|
`}
|
|
56
|
-
|
|
57
55
|
${(props: any) => props.isRoundRect && css`
|
|
58
56
|
border-radius: 7.6px;
|
|
59
57
|
`}
|
|
60
|
-
|
|
61
58
|
${(props: any) => props.isCapsule && css`
|
|
62
59
|
border-radius: 50px;
|
|
63
60
|
`}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
PaymentOptionStripe,
|
|
5
5
|
useSession,
|
|
6
6
|
useLanguage,
|
|
7
|
+
useValidationFields
|
|
7
8
|
} from 'ordering-components/native';
|
|
8
9
|
import { PlaceholderLine } from 'rn-placeholder';
|
|
9
10
|
import { useTheme } from 'styled-components/native';
|
|
@@ -28,29 +29,29 @@ export const StripeCardsListUI = (props: any) => {
|
|
|
28
29
|
cardSelected,
|
|
29
30
|
cardsList,
|
|
30
31
|
handleCardClick,
|
|
31
|
-
|
|
32
|
+
onOpen,
|
|
32
33
|
gateway,
|
|
33
|
-
|
|
34
|
-
addCardOpen,
|
|
35
|
-
isOpenMethod,
|
|
36
|
-
handlePaymethodDataChange
|
|
34
|
+
paySelected
|
|
37
35
|
} = props;
|
|
38
36
|
|
|
39
37
|
const theme = useTheme();
|
|
40
38
|
|
|
41
39
|
const [{ token }] = useSession();
|
|
42
40
|
const [, t] = useLanguage();
|
|
43
|
-
|
|
41
|
+
const [validationFields] = useValidationFields()
|
|
42
|
+
const validateZipcodeCard =
|
|
43
|
+
validationFields?.fields?.card?.zipcode?.enabled && validationFields?.fields?.card?.zipcode?.required
|
|
44
44
|
const paymethodsWithoutSaveCards = ['credomatic']
|
|
45
45
|
|
|
46
46
|
const handleCardSelected = (card: any) => {
|
|
47
|
+
if (!card?.zipcode && validateZipcodeCard) return
|
|
47
48
|
handleCardClick(card);
|
|
48
49
|
onSelectCard(card);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
useEffect(() => {
|
|
52
53
|
if (!cardsList?.loading && cardsList?.cards?.length === 0 && !paymethodsWithoutSaveCards.includes(gateway)) {
|
|
53
|
-
|
|
54
|
+
onOpen && onOpen();
|
|
54
55
|
}
|
|
55
56
|
}, [cardsList?.loading])
|
|
56
57
|
|
|
@@ -92,10 +93,10 @@ export const StripeCardsListUI = (props: any) => {
|
|
|
92
93
|
style={styles.cardsList}
|
|
93
94
|
>
|
|
94
95
|
{cardsList.cards.map((card: any) => (
|
|
95
|
-
<OSItem key={card.id} isUnique={cardsList.cards.length}>
|
|
96
|
+
<OSItem key={card.id} isUnique={cardsList.cards.length} isInvalid={!card?.zipcode && validateZipcodeCard}>
|
|
96
97
|
<OSItemContent onPress={() => handleCardSelected(card)}>
|
|
97
98
|
<View style={styles.viewStyle}>
|
|
98
|
-
{card.id === cardSelected?.id ? (
|
|
99
|
+
{(card.id === cardSelected?.id || card.id === paySelected?.data?.id) ? (
|
|
99
100
|
<OIcon
|
|
100
101
|
src={theme.images.general.radio_act}
|
|
101
102
|
width={16}
|
|
@@ -117,6 +118,13 @@ export const StripeCardsListUI = (props: any) => {
|
|
|
117
118
|
XXXX-XXXX-XXXX-{card.last4}
|
|
118
119
|
</OText>
|
|
119
120
|
</View>
|
|
121
|
+
{!card?.zipcode && validateZipcodeCard && (
|
|
122
|
+
<View style={styles.viewStyle}>
|
|
123
|
+
<OText size={10} color={theme?.colors?.danger5}>
|
|
124
|
+
({t('MISSING_ZIPCODE', 'Missing zipcode')})
|
|
125
|
+
</OText>
|
|
126
|
+
</View>
|
|
127
|
+
)}
|
|
120
128
|
</OSItemContent>
|
|
121
129
|
<OSItemActions>
|
|
122
130
|
<OAlert
|
|
@@ -135,33 +143,6 @@ export const StripeCardsListUI = (props: any) => {
|
|
|
135
143
|
))}
|
|
136
144
|
</ScrollView>
|
|
137
145
|
)}
|
|
138
|
-
<OModal
|
|
139
|
-
entireModal
|
|
140
|
-
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
141
|
-
open={addCardOpen.stripe}
|
|
142
|
-
onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
143
|
-
style={{ backgroundColor: 'red' }}
|
|
144
|
-
>
|
|
145
|
-
<KeyboardAvoidingView
|
|
146
|
-
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
|
|
147
|
-
keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
|
|
148
|
-
enabled={Platform.OS === 'ios' ? true : false}
|
|
149
|
-
>
|
|
150
|
-
<StripeElementsForm
|
|
151
|
-
openCarts={props.openCarts}
|
|
152
|
-
toSave
|
|
153
|
-
businessId={props.businessId}
|
|
154
|
-
businessIds={props.businessIds}
|
|
155
|
-
publicKey={props.publicKey || isOpenMethod?.paymethod?.credentials?.publishable}
|
|
156
|
-
setCardsList={setCardsList}
|
|
157
|
-
cardsList={cardsList}
|
|
158
|
-
requirements={props.clientSecret}
|
|
159
|
-
handleCardClick={handleCardClick}
|
|
160
|
-
onSelectCard={handlePaymethodDataChange}
|
|
161
|
-
onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
162
|
-
/>
|
|
163
|
-
</KeyboardAvoidingView>
|
|
164
|
-
</OModal>
|
|
165
146
|
</>
|
|
166
147
|
)
|
|
167
148
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@stripe/stripe-react-native';
|
|
10
10
|
import { useTheme } from 'styled-components/native';
|
|
11
11
|
import { ErrorMessage } from './styles';
|
|
12
|
-
|
|
12
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
13
13
|
import { StripeElementsForm as StripeFormController } from './naked';
|
|
14
14
|
import { OButton, OText } from '../shared';
|
|
15
15
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
@@ -17,7 +17,7 @@ import { StripeMethodForm } from '../../../../../src/components/StripeMethodForm
|
|
|
17
17
|
|
|
18
18
|
const StripeElementsFormUI = (props: any) => {
|
|
19
19
|
const {
|
|
20
|
-
|
|
20
|
+
publicKeyState,
|
|
21
21
|
handleSource,
|
|
22
22
|
values,
|
|
23
23
|
businessId,
|
|
@@ -33,7 +33,10 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
33
33
|
placeByMethodPay,
|
|
34
34
|
methodPaySupported,
|
|
35
35
|
setPlaceByMethodPay,
|
|
36
|
-
cartTotal
|
|
36
|
+
cartTotal,
|
|
37
|
+
publicKeyAddCard,
|
|
38
|
+
urlScheme,
|
|
39
|
+
androidAppId
|
|
37
40
|
} = props;
|
|
38
41
|
|
|
39
42
|
const theme = useTheme();
|
|
@@ -52,10 +55,11 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
52
55
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
53
56
|
const zipCodeEnabled = validationFields?.fields?.card?.zipcode?.enabled
|
|
54
57
|
const zipCodeRequired = validationFields?.fields?.card?.zipcode?.required
|
|
58
|
+
const isToSave = methodsPay?.includes(paymethod) ? publicKeyState?.key : (publicKeyAddCard || publicKeyState?.key)
|
|
55
59
|
const styles = StyleSheet.create({
|
|
56
60
|
container: {
|
|
57
61
|
width: '100%',
|
|
58
|
-
paddingHorizontal:
|
|
62
|
+
paddingHorizontal: 20,
|
|
59
63
|
justifyContent: 'space-between',
|
|
60
64
|
paddingBottom: 12
|
|
61
65
|
},
|
|
@@ -197,69 +201,78 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
197
201
|
|
|
198
202
|
return (
|
|
199
203
|
<View style={{ ...styles.container, height: methodsPay?.includes(paymethod) ? 'auto' : height - top - bottom - 60 - (isKeyboardShow ? 250 : 0) }}>
|
|
200
|
-
{
|
|
201
|
-
<
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
{
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
204
|
+
{publicKeyState.loading ? (
|
|
205
|
+
<Placeholder Animation={Fade}>
|
|
206
|
+
<PlaceholderLine height={50} style={{ marginTop: 20 }} />
|
|
207
|
+
</Placeholder>
|
|
208
|
+
) : (
|
|
209
|
+
<>
|
|
210
|
+
{publicKeyState?.key ? (
|
|
211
|
+
<View style={{ flex: 1 }}>
|
|
212
|
+
<StripeProvider
|
|
213
|
+
publishableKey={isToSave}
|
|
214
|
+
merchantIdentifier={merchantId}
|
|
215
|
+
urlScheme={`${urlScheme}://checkout/${cart?.uuid}`}
|
|
216
|
+
>
|
|
217
|
+
{methodsPay?.includes(paymethod) ? (
|
|
218
|
+
<StripeMethodForm
|
|
219
|
+
handleSource={handleSource}
|
|
220
|
+
onCancel={onCancel}
|
|
221
|
+
cart={cart}
|
|
222
|
+
cartTotal={cartTotal}
|
|
223
|
+
setErrors={setErrors}
|
|
224
|
+
paymethod={paymethod}
|
|
225
|
+
devMode={publicKeyState?.key?.includes('test')}
|
|
226
|
+
setMethodPaySupported={setMethodPaySupported}
|
|
227
|
+
placeByMethodPay={placeByMethodPay}
|
|
228
|
+
methodPaySupported={methodPaySupported}
|
|
229
|
+
setPlaceByMethodPay={setPlaceByMethodPay}
|
|
230
|
+
androidAppId={androidAppId}
|
|
231
|
+
/>
|
|
232
|
+
) : (
|
|
233
|
+
<CardField
|
|
234
|
+
postalCodeEnabled={zipCodeEnabled}
|
|
235
|
+
cardStyle={{
|
|
236
|
+
backgroundColor: '#FFFFFF',
|
|
237
|
+
textColor: '#000000',
|
|
238
|
+
borderWidth: 1,
|
|
239
|
+
borderRadius: 8,
|
|
240
|
+
borderColor: theme.colors.border
|
|
241
|
+
}}
|
|
242
|
+
style={{
|
|
243
|
+
width: '100%',
|
|
244
|
+
height: 50,
|
|
245
|
+
marginVertical: 30,
|
|
246
|
+
zIndex: 9999,
|
|
247
|
+
}}
|
|
248
|
+
onCardChange={(cardDetails: any) => setCard(cardDetails)}
|
|
249
|
+
/>
|
|
250
|
+
)}
|
|
251
|
+
</StripeProvider>
|
|
252
|
+
{!!errors && (
|
|
253
|
+
<ErrorMessage>
|
|
254
|
+
<OText
|
|
255
|
+
size={20}
|
|
256
|
+
color={theme.colors.error}
|
|
257
|
+
style={{ marginTop: 20, textAlign: 'center' }}
|
|
258
|
+
>
|
|
259
|
+
{errors}
|
|
260
|
+
</OText>
|
|
261
|
+
</ErrorMessage>
|
|
262
|
+
)}
|
|
263
|
+
</View>
|
|
264
|
+
) : (
|
|
242
265
|
<ErrorMessage>
|
|
243
266
|
<OText
|
|
244
267
|
size={20}
|
|
245
268
|
color={theme.colors.error}
|
|
246
|
-
style={{ marginTop: 20
|
|
269
|
+
style={{ marginTop: 20 }}
|
|
247
270
|
>
|
|
248
|
-
{
|
|
271
|
+
{t('SOMETHING_WRONG', 'Something is wrong!')}
|
|
249
272
|
</OText>
|
|
250
273
|
</ErrorMessage>
|
|
251
274
|
)}
|
|
252
|
-
|
|
253
|
-
) : (
|
|
254
|
-
<ErrorMessage>
|
|
255
|
-
<OText
|
|
256
|
-
size={20}
|
|
257
|
-
color={theme.colors.error}
|
|
258
|
-
style={{ marginTop: 20 }}
|
|
259
|
-
>
|
|
260
|
-
{t('SOMETHING_WRONG', 'Something is wrong!')}
|
|
261
|
-
</OText>
|
|
262
|
-
</ErrorMessage>
|
|
275
|
+
</>
|
|
263
276
|
)}
|
|
264
277
|
{!methodsPay?.includes(paymethod) && (
|
|
265
278
|
<OButton
|
|
@@ -13,6 +13,7 @@ export const StripeElementsForm = (props: any) => {
|
|
|
13
13
|
const [ordering] = useApi();
|
|
14
14
|
const [{ token }] = useSession();
|
|
15
15
|
const [state, setState] = useState({ loading: false, loadingAdd: false, error: null, requirements: null });
|
|
16
|
+
const [publicKeyState, setPublicKeyState] = useState({ key: props.publicKey, loading: true, error: null })
|
|
16
17
|
|
|
17
18
|
const getRequirements = async () => {
|
|
18
19
|
try {
|
|
@@ -85,6 +86,51 @@ export const StripeElementsForm = (props: any) => {
|
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Method to get stripe credentials from API
|
|
91
|
+
*/
|
|
92
|
+
const getCredentials = async () => {
|
|
93
|
+
try {
|
|
94
|
+
setPublicKeyState({
|
|
95
|
+
...publicKeyState,
|
|
96
|
+
loading: true
|
|
97
|
+
})
|
|
98
|
+
const { content: { result, error } } = await ordering.setAccessToken(token).paymentCards().getCredentials()
|
|
99
|
+
if (!error) {
|
|
100
|
+
setPublicKeyState({
|
|
101
|
+
loading: false,
|
|
102
|
+
key: result.publishable,
|
|
103
|
+
error: null
|
|
104
|
+
})
|
|
105
|
+
} else {
|
|
106
|
+
setPublicKeyState({
|
|
107
|
+
...publicKeyState,
|
|
108
|
+
loading: false,
|
|
109
|
+
error: result
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
} catch (error) {
|
|
113
|
+
setPublicKeyState({
|
|
114
|
+
...publicKeyState,
|
|
115
|
+
loading: false,
|
|
116
|
+
error: error.message
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (!token) return
|
|
123
|
+
if (props.publicKey) {
|
|
124
|
+
setPublicKeyState({
|
|
125
|
+
loading: false,
|
|
126
|
+
key: props.publicKey,
|
|
127
|
+
error: null
|
|
128
|
+
})
|
|
129
|
+
} else {
|
|
130
|
+
getCredentials()
|
|
131
|
+
}
|
|
132
|
+
}, [token, props.publicKey])
|
|
133
|
+
|
|
88
134
|
useEffect(() => {
|
|
89
135
|
if (!token || state.requirements) return
|
|
90
136
|
toSave && getRequirements()
|
|
@@ -96,6 +142,7 @@ export const StripeElementsForm = (props: any) => {
|
|
|
96
142
|
values={state}
|
|
97
143
|
requirements={state.requirements}
|
|
98
144
|
stripeTokenHandler={stripeTokenHandler}
|
|
145
|
+
publicKeyState={publicKeyState}
|
|
99
146
|
/>
|
|
100
147
|
)
|
|
101
148
|
}
|
|
@@ -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
|
+
}
|