ordering-ui-react-native 0.15.10 → 0.15.13
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
CHANGED
|
@@ -272,9 +272,10 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
272
272
|
launchImageLibrary(
|
|
273
273
|
{
|
|
274
274
|
mediaType: 'photo',
|
|
275
|
-
maxHeight:
|
|
276
|
-
maxWidth:
|
|
275
|
+
maxHeight: 2048,
|
|
276
|
+
maxWidth: 2048,
|
|
277
277
|
includeBase64: true,
|
|
278
|
+
quality: 1
|
|
278
279
|
},
|
|
279
280
|
(response: any) => {
|
|
280
281
|
if (response.didCancel) {
|
|
@@ -39,7 +39,8 @@ import {
|
|
|
39
39
|
ChCart,
|
|
40
40
|
DeliveryOptionsContainer,
|
|
41
41
|
DeliveryOptionItem,
|
|
42
|
-
WalletPaymentOptionContainer
|
|
42
|
+
WalletPaymentOptionContainer,
|
|
43
|
+
CartHeader
|
|
43
44
|
} from './styles';
|
|
44
45
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
45
46
|
|
|
@@ -570,9 +571,28 @@ const CheckoutUI = (props: any) => {
|
|
|
570
571
|
/>
|
|
571
572
|
) : (
|
|
572
573
|
<>
|
|
573
|
-
<
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
<CartHeader>
|
|
575
|
+
<OText
|
|
576
|
+
size={16}
|
|
577
|
+
lineHeight={24}
|
|
578
|
+
color={theme.colors.textNormal}
|
|
579
|
+
style={{ fontWeight: '500' }}
|
|
580
|
+
>
|
|
581
|
+
{t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}
|
|
582
|
+
</OText>
|
|
583
|
+
<TouchableOpacity
|
|
584
|
+
onPress={() => onNavigationRedirect('Business', { store: cart?.business?.slug })}
|
|
585
|
+
>
|
|
586
|
+
<OText
|
|
587
|
+
size={10}
|
|
588
|
+
lineHeight={15}
|
|
589
|
+
color={theme.colors.primary}
|
|
590
|
+
style={{ textDecorationLine: 'underline' }}
|
|
591
|
+
>
|
|
592
|
+
{t('ADD_PRODUCTS', 'Add products')}
|
|
593
|
+
</OText>
|
|
594
|
+
</TouchableOpacity>
|
|
595
|
+
</CartHeader>
|
|
576
596
|
{props.isFranchiseApp && (
|
|
577
597
|
<TouchableOpacity
|
|
578
598
|
onPress={() => setOpenChangeStore(true)}
|
|
@@ -105,3 +105,10 @@ export const DeliveryOptionItem = styled.View`
|
|
|
105
105
|
flex-direction: row;
|
|
106
106
|
background-color: ${(props : any) => props?.backgroundColor ?? '#fff'};
|
|
107
107
|
`;
|
|
108
|
+
|
|
109
|
+
export const CartHeader = styled.View`
|
|
110
|
+
align-items: center;
|
|
111
|
+
flex-direction: row;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
margin-bottom: 10px;
|
|
114
|
+
`
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
PaymentOptions as PaymentOptionsController,
|
|
11
11
|
useLanguage,
|
|
12
|
+
ToastType,
|
|
13
|
+
useToast,
|
|
12
14
|
} from 'ordering-components/native';
|
|
13
15
|
import { useTheme } from 'styled-components/native';
|
|
14
16
|
import { PaymentOptionCash } from '../PaymentOptionCash';
|
|
@@ -59,7 +61,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
59
61
|
} = props
|
|
60
62
|
|
|
61
63
|
const theme = useTheme();
|
|
62
|
-
|
|
64
|
+
const [, { showToast }] = useToast();
|
|
63
65
|
|
|
64
66
|
const getPayIcon = (method: string) => {
|
|
65
67
|
switch (method) {
|
|
@@ -95,11 +97,18 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
95
97
|
// ]
|
|
96
98
|
|
|
97
99
|
const handlePaymentMethodClick = (paymethod: any) => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
if (cart?.balance > 0) {
|
|
101
|
+
const isPopupMethod = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect', 'paypal'].includes(paymethod?.gateway)
|
|
102
|
+
if (webViewPaymentGateway.includes(paymethod?.gateway)) {
|
|
103
|
+
handlePaymentMethodClickCustom(paymethod)
|
|
104
|
+
}
|
|
105
|
+
handlePaymethodClick(paymethod, isPopupMethod)
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
showToast(
|
|
109
|
+
ToastType.Error,
|
|
110
|
+
t('CART_BALANCE_ZERO', 'Sorry, the amount to pay is equal to zero and it is not necessary to select a payment method'))
|
|
111
|
+
;
|
|
103
112
|
}
|
|
104
113
|
|
|
105
114
|
useEffect(() => {
|