ordering-ui-react-native 0.21.78 → 0.21.79-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 -7
- 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 +9 -6
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
- package/themes/business/src/components/Chat/index.tsx +3 -1
- package/themes/business/src/components/DriverMap/index.tsx +44 -27
- 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 +2 -3
- 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 +36 -17
- package/themes/business/src/components/NewOrderNotification/index.tsx +74 -24
- package/themes/business/src/components/OrderDetails/Business.tsx +65 -7
- package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -20
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +110 -40
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -35
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderSummary/index.tsx +222 -72
- package/themes/business/src/components/OrdersListManager/index.tsx +9 -1
- package/themes/business/src/components/OrdersOption/index.tsx +247 -159
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +25 -15
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
- 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/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +84 -47
- 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 +19 -1
- 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 +13 -1
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- 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 +6 -9
- package/themes/original/src/components/BusinessController/index.tsx +12 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
- 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 +18 -6
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- 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 +38 -11
- package/themes/original/src/components/CartContent/index.tsx +21 -8
- package/themes/original/src/components/Checkout/index.tsx +108 -60
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- 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 +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- 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 +82 -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 +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +2 -10
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +4 -7
- package/themes/original/src/components/MessageListing/index.tsx +1 -0
- package/themes/original/src/components/Messages/index.tsx +8 -7
- package/themes/original/src/components/MomentOption/index.tsx +13 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +139 -87
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -1
- package/themes/original/src/components/MyOrders/index.tsx +21 -26
- package/themes/original/src/components/NavBar/index.tsx +4 -2
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +1 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
- package/themes/original/src/components/OrderDetails/index.tsx +27 -10
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +22 -3
- package/themes/original/src/components/OrderSummary/index.tsx +28 -9
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +2 -4
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +17 -9
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +8 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +86 -78
- package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +77 -60
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserDetails/index.tsx +3 -2
- package/themes/original/src/components/UserFormDetails/index.tsx +155 -131
- package/themes/original/src/components/UserProfile/index.tsx +11 -2
- package/themes/original/src/components/Wallets/index.tsx +6 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -4
- package/themes/original/src/components/shared/OInput.tsx +4 -8
- package/themes/original/src/types/index.tsx +5 -1
- package/themes/original/src/utils/index.tsx +12 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -64,7 +64,7 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
64
64
|
handleReCaptcha(null)
|
|
65
65
|
if (reCaptchaValue) return
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
if (!recaptchaConfig?.siteKey) {
|
|
68
68
|
showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
|
|
69
69
|
return
|
|
70
70
|
}
|
|
@@ -73,7 +73,7 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
73
73
|
return
|
|
74
74
|
}
|
|
75
75
|
recaptchaRef.current.open()
|
|
76
|
-
|
|
76
|
+
}
|
|
77
77
|
|
|
78
78
|
const onRecaptchaVerify = (token: any) => {
|
|
79
79
|
setRecaptchaVerified(true)
|
|
@@ -92,8 +92,8 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
92
92
|
formState.result?.result && showToast(
|
|
93
93
|
ToastType.Error,
|
|
94
94
|
typeof formState.result?.result === 'string'
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
? formState.result?.result
|
|
96
|
+
: formState.result?.result[0]
|
|
97
97
|
)
|
|
98
98
|
return
|
|
99
99
|
}
|
|
@@ -208,9 +208,7 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
208
208
|
|
|
209
209
|
<OButton
|
|
210
210
|
text={emailSent && !formState.result?.error ? t('LINK_SEND_FORGOT_PASSWORD', 'Link Sent') : t('FRONT_RECOVER_PASSWORD', 'Recover Password')}
|
|
211
|
-
|
|
212
|
-
bgColor={emailSent && !formState.result?.error ? theme.colors.disabled : theme.colors.primary}
|
|
213
|
-
borderColor={emailSent && !formState.result?.error ? theme.colors.disabled : theme.colors.primary}
|
|
211
|
+
isDisabled={formState.loading || emailSent && !formState.result?.error}
|
|
214
212
|
isLoading={formState.loading}
|
|
215
213
|
imgRightSrc={null}
|
|
216
214
|
onClick={emailSent && !formState.result?.error ? () => { } : handleSubmit(onSubmit)}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useLanguage } from 'ordering-components/native';
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { OText } from '../../shared'
|
|
6
|
+
import { VerticalGiftCardOrdersLayout } from '../VerticalGiftCardOrdersLayout'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Container,
|
|
10
|
+
NoOrdersWrapper
|
|
11
|
+
} from './styles'
|
|
12
|
+
|
|
13
|
+
export const GiftCardOrdersList = (props: any) => {
|
|
14
|
+
const {
|
|
15
|
+
onNavigationRedirect
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const [, t] = useLanguage();
|
|
20
|
+
const [isEmptyPending, setIsEmptyPending] = useState(false);
|
|
21
|
+
const [isEmptySent, setIsEmptySent] = useState(false);
|
|
22
|
+
const [isEmptyRedeemed, setIsEmptyRedeemed] = useState(false);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Container>
|
|
26
|
+
<VerticalGiftCardOrdersLayout
|
|
27
|
+
title={t('PENDING', 'Pending')}
|
|
28
|
+
defaultStatus='pending'
|
|
29
|
+
setIsEmpty={setIsEmptyPending}
|
|
30
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
{!isEmptyPending && (
|
|
34
|
+
<View
|
|
35
|
+
style={{
|
|
36
|
+
height: 8,
|
|
37
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
38
|
+
marginHorizontal: -40,
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
<VerticalGiftCardOrdersLayout
|
|
44
|
+
title={t('SENT', 'Sent')}
|
|
45
|
+
defaultStatus='sent'
|
|
46
|
+
setIsEmpty={setIsEmptySent}
|
|
47
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
<VerticalGiftCardOrdersLayout
|
|
51
|
+
title={t('REDEEMED', 'Redeemed')}
|
|
52
|
+
defaultStatus='activated'
|
|
53
|
+
setIsEmpty={setIsEmptyRedeemed}
|
|
54
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
{isEmptyPending && isEmptySent && isEmptyRedeemed && (
|
|
58
|
+
<NoOrdersWrapper>
|
|
59
|
+
<OText size={16} color={theme.colors.textNormal}>{t('YOU_DONT_HAVE_CARDS', 'You don\'t have cards')}</OText>
|
|
60
|
+
</NoOrdersWrapper>
|
|
61
|
+
)}
|
|
62
|
+
</Container>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Container
|
|
13
13
|
} from './styles'
|
|
14
14
|
|
|
15
|
-
export const GiftCardUI =
|
|
15
|
+
export const GiftCardUI = React.memo((props: any) => {
|
|
16
16
|
const {
|
|
17
17
|
navigation
|
|
18
18
|
} = props
|
|
@@ -57,9 +57,7 @@ export const GiftCardUI = React.memo((props: any) => {
|
|
|
57
57
|
<OButton
|
|
58
58
|
onClick={() => setOpenModal('purchase')}
|
|
59
59
|
text={t('PURCHASE', 'Purchase')}
|
|
60
|
-
|
|
61
|
-
borderColor={theme.colors.primary}
|
|
62
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
60
|
+
textStyle={{ fontSize: 13 }}
|
|
63
61
|
imgRightSrc={null}
|
|
64
62
|
style={{ ...style.btnStyle, marginRight: 14 }}
|
|
65
63
|
/>
|
|
@@ -76,26 +74,26 @@ export const GiftCardUI = React.memo((props: any) => {
|
|
|
76
74
|
</View>
|
|
77
75
|
|
|
78
76
|
<OModal
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
open={openModal === 'purchase'}
|
|
78
|
+
onClose={() => setOpenModal(null)}
|
|
79
|
+
entireModal
|
|
82
80
|
customClose
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
>
|
|
82
|
+
<PurchaseGiftCard
|
|
85
83
|
handleCustomGoToCheckout={handleCustomGoToCheckout}
|
|
86
84
|
onClose={() => setOpenModal(null)}
|
|
87
85
|
/>
|
|
88
|
-
|
|
86
|
+
</OModal>
|
|
89
87
|
<OModal
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
open={openModal === 'redeem'}
|
|
89
|
+
onClose={() => setOpenModal(null)}
|
|
90
|
+
entireModal
|
|
93
91
|
customClose
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
>
|
|
93
|
+
<RedeemGiftCard
|
|
96
94
|
onClose={() => setOpenModal(null)}
|
|
97
95
|
/>
|
|
98
|
-
|
|
96
|
+
</OModal>
|
|
99
97
|
</Container>
|
|
100
98
|
)
|
|
101
|
-
})
|
|
99
|
+
})
|
|
@@ -58,12 +58,10 @@ const PurchaseGiftCardUI = (props: any) => {
|
|
|
58
58
|
borderWidth: 0,
|
|
59
59
|
width: 26,
|
|
60
60
|
height: 26,
|
|
61
|
-
backgroundColor: '#FFF',
|
|
62
|
-
borderColor: '#FFF',
|
|
63
|
-
shadowColor: '#FFF',
|
|
64
61
|
paddingLeft: 0,
|
|
65
62
|
paddingRight: 0,
|
|
66
63
|
}}
|
|
64
|
+
useArrow
|
|
67
65
|
onClick={onClose}
|
|
68
66
|
icon={AntDesignIcon}
|
|
69
67
|
iconProps={{
|
|
@@ -113,9 +111,7 @@ const PurchaseGiftCardUI = (props: any) => {
|
|
|
113
111
|
<OButton
|
|
114
112
|
onClick={() => handleAccept()}
|
|
115
113
|
text={t('ACCEPT', 'Accept')}
|
|
116
|
-
|
|
117
|
-
borderColor={theme.colors.primary}
|
|
118
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
114
|
+
textStyle={{ fontSize: 13 }}
|
|
119
115
|
imgRightSrc={null}
|
|
120
116
|
style={style.btnStyle}
|
|
121
117
|
isDisabled={!selectedProduct}
|
|
@@ -130,4 +126,4 @@ export const PurchaseGiftCard = (props: any) => {
|
|
|
130
126
|
UIComponent: PurchaseGiftCardUI
|
|
131
127
|
}
|
|
132
128
|
return <PurchaseGiftCardController {...purchaseGiftCardProps} />
|
|
133
|
-
}
|
|
129
|
+
}
|
|
@@ -36,10 +36,10 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
36
36
|
marginTop: 20
|
|
37
37
|
},
|
|
38
38
|
inputStyle: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
borderColor: theme.colors.border,
|
|
41
|
+
borderRadius: 7.6,
|
|
42
|
+
},
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
const onSubmit = (values) => {
|
|
@@ -65,7 +65,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
65
65
|
t('ERROR', 'Error'),
|
|
66
66
|
stringError,
|
|
67
67
|
[
|
|
68
|
-
{ text: t('OK', 'oK'), onPress: () => {} }
|
|
68
|
+
{ text: t('OK', 'oK'), onPress: () => { } }
|
|
69
69
|
]
|
|
70
70
|
)
|
|
71
71
|
}
|
|
@@ -85,7 +85,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
85
85
|
t('ERROR', 'Error'),
|
|
86
86
|
stringError,
|
|
87
87
|
[
|
|
88
|
-
{ text: t('OK', 'oK'), onPress: () => {} }
|
|
88
|
+
{ text: t('OK', 'oK'), onPress: () => { } }
|
|
89
89
|
]
|
|
90
90
|
)
|
|
91
91
|
}, [actionState.error])
|
|
@@ -108,12 +108,10 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
108
108
|
borderWidth: 0,
|
|
109
109
|
width: 26,
|
|
110
110
|
height: 26,
|
|
111
|
-
backgroundColor: '#FFF',
|
|
112
|
-
borderColor: '#FFF',
|
|
113
|
-
shadowColor: '#FFF',
|
|
114
111
|
paddingLeft: 0,
|
|
115
112
|
paddingRight: 0,
|
|
116
113
|
}}
|
|
114
|
+
useArrow
|
|
117
115
|
onClick={onClose}
|
|
118
116
|
icon={AntDesignIcon}
|
|
119
117
|
iconProps={{
|
|
@@ -124,25 +122,25 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
124
122
|
}
|
|
125
123
|
}}
|
|
126
124
|
/>
|
|
127
|
-
|
|
125
|
+
<OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
|
|
128
126
|
</View>
|
|
129
127
|
<FormController>
|
|
130
128
|
<OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('GIFT_CARD_CODE', 'Gift card code')}</OText>
|
|
131
129
|
<Controller
|
|
132
130
|
control={control}
|
|
133
131
|
render={({ onChange, value }: any) => (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
132
|
+
<OInput
|
|
133
|
+
placeholder='XXXX-XXXX-XXXX-XXXX'
|
|
134
|
+
value={codeValue}
|
|
135
|
+
onChange={(val: any) => {
|
|
136
|
+
onChange(val)
|
|
137
|
+
handleChangeCode(val)
|
|
138
|
+
}}
|
|
139
|
+
autoCapitalize='characters'
|
|
140
|
+
autoCorrect={false}
|
|
141
|
+
blurOnSubmit={false}
|
|
142
|
+
style={style.inputStyle}
|
|
143
|
+
/>
|
|
146
144
|
)}
|
|
147
145
|
name='code'
|
|
148
146
|
rules={{
|
|
@@ -178,9 +176,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
178
176
|
<OButton
|
|
179
177
|
onClick={handleSubmit(onSubmit)}
|
|
180
178
|
text={actionState?.loading ? t('LOADING', 'Loading') : t('APPLY_TO_YOUR_BALANCE', 'Apply to your balance')}
|
|
181
|
-
|
|
182
|
-
borderColor={theme.colors.primary}
|
|
183
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
179
|
+
textStyle={{ fontSize: 13 }}
|
|
184
180
|
imgRightSrc={null}
|
|
185
181
|
style={style.btnStyle}
|
|
186
182
|
isDisabled={actionState.loading}
|
|
@@ -202,12 +198,10 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
202
198
|
borderWidth: 0,
|
|
203
199
|
width: 26,
|
|
204
200
|
height: 26,
|
|
205
|
-
backgroundColor: '#FFF',
|
|
206
|
-
borderColor: '#FFF',
|
|
207
|
-
shadowColor: '#FFF',
|
|
208
201
|
paddingLeft: 0,
|
|
209
202
|
paddingRight: 0,
|
|
210
203
|
}}
|
|
204
|
+
useArrow
|
|
211
205
|
onClick={onClose}
|
|
212
206
|
icon={AntDesignIcon}
|
|
213
207
|
iconProps={{
|
|
@@ -218,7 +212,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
218
212
|
}
|
|
219
213
|
}}
|
|
220
214
|
/>
|
|
221
|
-
|
|
215
|
+
<OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('GIFT_CARD', 'Gift card')}</OText>
|
|
222
216
|
</View>
|
|
223
217
|
<View>
|
|
224
218
|
<OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</OText>
|
|
@@ -232,9 +226,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
232
226
|
onClose()
|
|
233
227
|
}}
|
|
234
228
|
text={t('OK', 'Ok')}
|
|
235
|
-
|
|
236
|
-
borderColor={theme.colors.primary}
|
|
237
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
229
|
+
textStyle={{ fontSize: 13 }}
|
|
238
230
|
imgRightSrc={null}
|
|
239
231
|
style={style.btnStyle}
|
|
240
232
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { StyleSheet, Platform, Alert } from 'react-native';
|
|
3
|
-
import { useLanguage, SendGiftCard as SendGiftCardController
|
|
3
|
+
import { useLanguage, SendGiftCard as SendGiftCardController } from 'ordering-components/native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { OText, OButton, OInput } from '../../shared';
|
|
6
6
|
import { useForm, Controller } from 'react-hook-form'
|
|
@@ -29,10 +29,10 @@ const SendGiftCardUI = (props: any) => {
|
|
|
29
29
|
marginTop: 20
|
|
30
30
|
},
|
|
31
31
|
inputStyle: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
borderColor: theme.colors.border,
|
|
34
|
+
borderRadius: 7.6,
|
|
35
|
+
},
|
|
36
36
|
})
|
|
37
37
|
|
|
38
38
|
const onSubmit = (values) => {
|
|
@@ -50,7 +50,7 @@ const SendGiftCardUI = (props: any) => {
|
|
|
50
50
|
t('ERROR', 'Error'),
|
|
51
51
|
stringError,
|
|
52
52
|
[
|
|
53
|
-
{ text: t('OK', 'oK'), onPress: () => {} }
|
|
53
|
+
{ text: t('OK', 'oK'), onPress: () => { } }
|
|
54
54
|
]
|
|
55
55
|
)
|
|
56
56
|
}
|
|
@@ -144,9 +144,7 @@ const SendGiftCardUI = (props: any) => {
|
|
|
144
144
|
<OButton
|
|
145
145
|
onClick={handleSubmit(onSubmit)}
|
|
146
146
|
text={actionState?.loading ? t('LOADING', 'Loading') : t('SEND_GIFT_CARD', 'Send gift card')}
|
|
147
|
-
|
|
148
|
-
borderColor={theme.colors.primary}
|
|
149
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
147
|
+
textStyle={{ fontSize: 13 }}
|
|
150
148
|
imgRightSrc={null}
|
|
151
149
|
style={style.btnStyle}
|
|
152
150
|
isDisabled={actionState.loading}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useLanguage, useUtils, useEvent } from 'ordering-components/native';
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import { View, StyleSheet } from 'react-native';
|
|
5
|
+
import {
|
|
6
|
+
Placeholder,
|
|
7
|
+
PlaceholderLine,
|
|
8
|
+
Fade
|
|
9
|
+
} from 'rn-placeholder';
|
|
10
|
+
import FastImage from 'react-native-fast-image';
|
|
11
|
+
import { OText } from '../../shared'
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
CardContainer
|
|
15
|
+
} from './styles'
|
|
16
|
+
|
|
17
|
+
export const SingleGiftCard = (props: any) => {
|
|
18
|
+
const {
|
|
19
|
+
card,
|
|
20
|
+
isSkeleton,
|
|
21
|
+
onNavigationRedirect
|
|
22
|
+
} = props
|
|
23
|
+
|
|
24
|
+
const theme = useTheme()
|
|
25
|
+
const [, t] = useLanguage()
|
|
26
|
+
const [events] = useEvent()
|
|
27
|
+
const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
|
|
28
|
+
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
logo: {
|
|
31
|
+
borderRadius: 8,
|
|
32
|
+
width: 64,
|
|
33
|
+
height: 64
|
|
34
|
+
},
|
|
35
|
+
innerContainer: {
|
|
36
|
+
flexDirection: 'row',
|
|
37
|
+
marginBottom: 24
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const getGiftCardStatus = (status: string) => {
|
|
42
|
+
switch (status) {
|
|
43
|
+
case 'pending':
|
|
44
|
+
return t('PENDING', 'Pending')
|
|
45
|
+
case 'activated':
|
|
46
|
+
return t('REDEEMED', 'Redeemed')
|
|
47
|
+
default:
|
|
48
|
+
return status
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const handleClickGiftCardOrder = (card: any) => {
|
|
53
|
+
onNavigationRedirect?.('OrderDetails', { orderId: card.order_product?.order_id });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<CardContainer
|
|
58
|
+
activeOpacity={0.8}
|
|
59
|
+
onPress={() => handleClickGiftCardOrder(card)}
|
|
60
|
+
>
|
|
61
|
+
{isSkeleton ? (
|
|
62
|
+
<Placeholder style={{ marginBottom: 10 }} Animation={Fade}>
|
|
63
|
+
<View style={{ flexDirection: 'row' }}>
|
|
64
|
+
<View style={{ width: 64, marginRight: 14 }}>
|
|
65
|
+
<PlaceholderLine
|
|
66
|
+
width={100}
|
|
67
|
+
height={64}
|
|
68
|
+
style={{ marginRight: 10, marginBottom: 10 }}
|
|
69
|
+
/>
|
|
70
|
+
</View>
|
|
71
|
+
<Placeholder style={{ paddingTop: 5 }}>
|
|
72
|
+
<PlaceholderLine width={60} style={{ marginBottom: 6}} />
|
|
73
|
+
<PlaceholderLine width={40} style={{ marginBottom: 6 }} />
|
|
74
|
+
<PlaceholderLine width={20} style={{ marginBottom: 0 }} />
|
|
75
|
+
</Placeholder>
|
|
76
|
+
</View>
|
|
77
|
+
</Placeholder>
|
|
78
|
+
) : (
|
|
79
|
+
<View style={styles.innerContainer}>
|
|
80
|
+
<View>
|
|
81
|
+
<FastImage
|
|
82
|
+
style={styles.logo}
|
|
83
|
+
source={card?.order_product?.images ? {
|
|
84
|
+
uri: optimizeImage(card?.order_product?.images, 'h_86,c_limit')
|
|
85
|
+
} : theme?.images?.dummies?.businessLogo}
|
|
86
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
87
|
+
/>
|
|
88
|
+
</View>
|
|
89
|
+
<View style={{ flex: 1, marginLeft: 14 }}>
|
|
90
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
91
|
+
<OText size={12} lineHeight={18}>{card?.order_product?.name}</OText>
|
|
92
|
+
<OText size={12} lineHeight={18}>{parsePrice(card?.order_product?.price)}</OText>
|
|
93
|
+
</View>
|
|
94
|
+
<OText size={10} color={theme.colors.textSecondary} lineHeight={15}>{parseDate(card?.created_at)}</OText>
|
|
95
|
+
<OText size={10} color={theme.colors.primary}>{getGiftCardStatus(card?.status)}</OText>
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
98
|
+
)}
|
|
99
|
+
</CardContainer>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useLanguage, GiftCardOrdersList as GiftCardOrdersListController } from 'ordering-components/native';
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import {
|
|
5
|
+
Placeholder,
|
|
6
|
+
PlaceholderLine,
|
|
7
|
+
Fade
|
|
8
|
+
} from 'rn-placeholder';
|
|
9
|
+
import { SingleGiftCard } from '../SingleGiftCard';
|
|
10
|
+
import { OButton, OText } from '../../shared';
|
|
11
|
+
import {
|
|
12
|
+
ProductsListContainer,
|
|
13
|
+
SingleGiftCardWrapper,
|
|
14
|
+
WrappButton
|
|
15
|
+
} from './styles'
|
|
16
|
+
|
|
17
|
+
const VerticalGiftCardOrdersLayoutUI = (props: any) => {
|
|
18
|
+
const {
|
|
19
|
+
giftCards,
|
|
20
|
+
paginationProps,
|
|
21
|
+
loadMoreOrders,
|
|
22
|
+
title,
|
|
23
|
+
setIsEmpty,
|
|
24
|
+
onNavigationRedirect
|
|
25
|
+
} = props
|
|
26
|
+
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
const [, t] = useLanguage()
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (giftCards.loading) return
|
|
32
|
+
if (giftCards.list?.length === 0) setIsEmpty(true)
|
|
33
|
+
}, [giftCards])
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<ProductsListContainer>
|
|
37
|
+
{
|
|
38
|
+
giftCards.loading ? (
|
|
39
|
+
<Placeholder Animation={Fade} style={{ marginVertical: 16 }}>
|
|
40
|
+
<PlaceholderLine width={30} height={16} />
|
|
41
|
+
</Placeholder>
|
|
42
|
+
) : giftCards.list?.length > 0 && (
|
|
43
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={24} style={{ marginTop: 24 }}>{title}</OText>
|
|
44
|
+
)}
|
|
45
|
+
{giftCards.list.map(card => (
|
|
46
|
+
<SingleGiftCardWrapper key={card.id}>
|
|
47
|
+
<SingleGiftCard
|
|
48
|
+
card={card}
|
|
49
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
50
|
+
/>
|
|
51
|
+
</SingleGiftCardWrapper>
|
|
52
|
+
))}
|
|
53
|
+
{giftCards.loading && (
|
|
54
|
+
[...Array(10).keys()].map(i => (
|
|
55
|
+
<SingleGiftCardWrapper key={i}>
|
|
56
|
+
<SingleGiftCard
|
|
57
|
+
isSkeleton
|
|
58
|
+
/>
|
|
59
|
+
</SingleGiftCardWrapper>
|
|
60
|
+
))
|
|
61
|
+
)}
|
|
62
|
+
{paginationProps.totalPages && paginationProps.currentPage < paginationProps.totalPages && (
|
|
63
|
+
<WrappButton>
|
|
64
|
+
<OButton
|
|
65
|
+
onClick={loadMoreOrders}
|
|
66
|
+
text={t('LOAD_MORE_ORDERS', 'Load more orders')}
|
|
67
|
+
imgRightSrc={null}
|
|
68
|
+
style={{ borderRadius: 7.6, shadowOpacity: 0 }}
|
|
69
|
+
/>
|
|
70
|
+
</WrappButton>
|
|
71
|
+
)}
|
|
72
|
+
</ProductsListContainer>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const VerticalGiftCardOrdersLayout = (props: any) => {
|
|
77
|
+
const giftCardsProps = {
|
|
78
|
+
...props,
|
|
79
|
+
UIComponent: VerticalGiftCardOrdersLayoutUI
|
|
80
|
+
}
|
|
81
|
+
return <GiftCardOrdersListController {...giftCardsProps} />
|
|
82
|
+
}
|