ordering-ui-react-native 0.16.52 → 0.16.53-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/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/index.tsx +2 -0
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +40 -32
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +40 -30
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +76 -77
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +24 -12
- package/themes/business/src/components/shared/OText.tsx +3 -2
- package/themes/business/src/types/index.tsx +25 -11
- package/themes/business/src/utils/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/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -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/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +8 -6
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +157 -140
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +218 -147
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessController/index.tsx +192 -91
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +85 -137
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +59 -61
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -83
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +19 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +28 -29
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +299 -148
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -11
- package/themes/original/src/components/BusinessesListing/index.tsx +51 -71
- package/themes/original/src/components/Cart/index.tsx +82 -15
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +27 -17
- package/themes/original/src/components/CartContent/styles.tsx +1 -1
- package/themes/original/src/components/Checkout/index.tsx +114 -118
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/FavoriteList/index.tsx +69 -45
- package/themes/original/src/components/FloatingButton/index.tsx +13 -11
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +35 -20
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCart/index.tsx +63 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
- package/themes/original/src/components/MyOrders/index.tsx +88 -24
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/index.tsx +162 -50
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -35
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +91 -53
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +365 -384
- package/themes/original/src/components/ProductForm/styles.tsx +7 -12
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +120 -108
- package/themes/original/src/components/ReviewOrder/styles.tsx +5 -7
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +136 -0
- package/themes/original/src/components/{Reviews/ReviewOrder → ReviewTrigger}/styles.tsx +10 -22
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +330 -266
- package/themes/original/src/components/SignupForm/index.tsx +134 -89
- package/themes/original/src/components/SingleOrderCard/index.tsx +219 -129
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +180 -104
- package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +36 -22
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +65 -13
- package/themes/original/src/utils/index.tsx +103 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/original/src/components/Reviews/ReviewDriver/index.tsx +0 -301
- package/themes/original/src/components/Reviews/ReviewDriver/styles.tsx +0 -39
- package/themes/original/src/components/Reviews/ReviewOrder/index.tsx +0 -326
- package/themes/original/src/components/Reviews/ReviewProducts/index.tsx +0 -101
- package/themes/original/src/components/Reviews/ReviewProducts/styles.tsx +0 -17
- package/themes/original/src/components/Reviews/index.tsx +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { Pressable, StyleSheet, View } from 'react-native';
|
|
2
|
+
import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useTheme } from 'styled-components/native'
|
|
4
4
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
5
5
|
import FastImage from 'react-native-fast-image'
|
|
@@ -9,23 +9,24 @@ import {
|
|
|
9
9
|
useUtils,
|
|
10
10
|
useConfig
|
|
11
11
|
} from 'ordering-components/native'
|
|
12
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
15
|
Container,
|
|
16
|
+
Header,
|
|
15
17
|
BalanceElement,
|
|
16
|
-
TransactionsWrapper,
|
|
17
18
|
OTabs,
|
|
18
19
|
OTab,
|
|
19
20
|
SectionContent,
|
|
20
21
|
LoyaltyContent,
|
|
21
22
|
LoyaltyWrapp,
|
|
22
|
-
LoyaltyImg
|
|
23
|
+
LoyaltyImg,
|
|
24
|
+
WalletTransactionsWrapper
|
|
23
25
|
} from './styles'
|
|
24
26
|
|
|
25
|
-
import
|
|
26
|
-
import { OText } from '../shared';
|
|
27
|
+
import { OButton, OIcon, OText, OModal } from '../shared';
|
|
27
28
|
import { NotFoundSource } from '../NotFoundSource';
|
|
28
|
-
import {
|
|
29
|
+
import { WalletTransactions } from '../WalletTransactions'
|
|
29
30
|
|
|
30
31
|
const WalletsUI = (props: any) => {
|
|
31
32
|
const {
|
|
@@ -60,6 +61,8 @@ const WalletsUI = (props: any) => {
|
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
64
|
+
const [openHistory, setOpenHistory] = useState(false)
|
|
65
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
63
66
|
|
|
64
67
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
65
68
|
|
|
@@ -74,7 +77,7 @@ const WalletsUI = (props: any) => {
|
|
|
74
77
|
isActive: isWalletCashEnabled
|
|
75
78
|
},
|
|
76
79
|
credit_point: {
|
|
77
|
-
name: t('
|
|
80
|
+
name: t('POINTS_WALLET', 'Points Wallet'),
|
|
78
81
|
value: 1,
|
|
79
82
|
isActive: isWalletPointsEnabled
|
|
80
83
|
}
|
|
@@ -98,180 +101,189 @@ const WalletsUI = (props: any) => {
|
|
|
98
101
|
}, [configs])
|
|
99
102
|
|
|
100
103
|
useEffect(() => {
|
|
101
|
-
if(refreshWallets){
|
|
104
|
+
if (refreshWallets) {
|
|
102
105
|
getWallets()
|
|
103
106
|
setRefreshWallets && setRefreshWallets(false)
|
|
104
107
|
}
|
|
105
108
|
}, [refreshWallets])
|
|
106
109
|
|
|
107
110
|
return (
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
<>
|
|
112
|
+
<Container>
|
|
113
|
+
<Header>
|
|
114
|
+
<OText size={24} style={{ marginTop: 30 }}>{t('WALLETS', 'Wallets')}</OText>
|
|
115
|
+
{isChewLayout && (
|
|
116
|
+
<OButton
|
|
117
|
+
text={t('WALLET_HISTORY', 'Wallet history')}
|
|
118
|
+
bgColor={theme.colors.white}
|
|
119
|
+
borderColor={theme.colors.lightGray}
|
|
120
|
+
imgRightSrc={null}
|
|
121
|
+
textStyle={{ fontSize: 12, color: theme.colors.disabled }}
|
|
122
|
+
onClick={() => setOpenHistory(true)}
|
|
123
|
+
style={{ borderRadius: 8, height: 40 }}
|
|
124
|
+
/>
|
|
125
|
+
)}
|
|
126
|
+
</Header>
|
|
117
127
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
>
|
|
128
|
-
{walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
|
|
129
|
-
<Pressable
|
|
130
|
-
key={wallet.id}
|
|
131
|
-
onPress={() => handleChangeTab(wallet)}
|
|
128
|
+
{!walletList.loading &&
|
|
129
|
+
!userLoyaltyLevel.loading &&
|
|
130
|
+
!walletList.error &&
|
|
131
|
+
walletList.wallets?.length > 0 &&
|
|
132
|
+
(
|
|
133
|
+
<>
|
|
134
|
+
<OTabs
|
|
135
|
+
horizontal
|
|
136
|
+
showsHorizontalScrollIndicator={false}
|
|
132
137
|
>
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
{walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
|
|
139
|
+
<TouchableOpacity
|
|
140
|
+
key={wallet.id}
|
|
141
|
+
onPress={() => handleChangeTab(wallet)}
|
|
142
|
+
>
|
|
143
|
+
<OTab
|
|
144
|
+
isSelected={tabSelected === wallet.type}
|
|
145
|
+
style={{
|
|
146
|
+
borderBottomWidth: 1,
|
|
147
|
+
borderBottomColor:
|
|
148
|
+
tabSelected === wallet.type
|
|
149
|
+
? theme.colors.textNormal
|
|
150
|
+
: theme.colors.border
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
<OText>
|
|
154
|
+
{walletName[wallet.type]?.name}
|
|
155
|
+
</OText>
|
|
156
|
+
</OTab>
|
|
157
|
+
</TouchableOpacity>
|
|
158
|
+
))}
|
|
159
|
+
</OTabs>
|
|
141
160
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
161
|
+
<SectionContent>
|
|
162
|
+
{!!loyaltyLevel && tabSelected === 'credit_point' && (
|
|
163
|
+
<LoyaltyContent>
|
|
164
|
+
<LoyaltyWrapp>
|
|
165
|
+
<OText size={20}>
|
|
166
|
+
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
|
|
167
|
+
</OText>
|
|
168
|
+
{/* {loyaltyLevel.image ? (
|
|
169
|
+
<FastImage
|
|
170
|
+
style={styles.logoStyle}
|
|
171
|
+
source={{
|
|
172
|
+
uri: loyaltyLevel.image,
|
|
173
|
+
priority: FastImage.priority.high,
|
|
174
|
+
cache: FastImage.cacheControl.web
|
|
175
|
+
}}
|
|
176
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
177
|
+
/>
|
|
178
|
+
) : (
|
|
179
|
+
<LoyaltyImg
|
|
180
|
+
source={theme.images.dummies.loyaltyLevel}
|
|
181
|
+
resizeMode='contain'
|
|
182
|
+
/>
|
|
183
|
+
)} */}
|
|
184
|
+
<OText
|
|
185
|
+
size={22}
|
|
186
|
+
weight='bold'
|
|
187
|
+
style={{ textTransform: 'uppercase' }}
|
|
188
|
+
color={theme.colors.primary}
|
|
189
|
+
>
|
|
190
|
+
{loyaltyLevel.name}
|
|
191
|
+
</OText>
|
|
192
|
+
</LoyaltyWrapp>
|
|
193
|
+
</LoyaltyContent>
|
|
194
|
+
)}
|
|
195
|
+
<BalanceElement>
|
|
196
|
+
<OText size={20} style={{ fontWeight: '600' }}>
|
|
197
|
+
{currentWalletSelected?.type === 'cash'
|
|
198
|
+
? parsePrice(currentWalletSelected?.balance)
|
|
199
|
+
: currentWalletSelected?.balance
|
|
200
|
+
}
|
|
148
201
|
</OText>
|
|
149
|
-
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
uri: loyaltyLevel.image,
|
|
154
|
-
priority: FastImage.priority.high,
|
|
155
|
-
cache:FastImage.cacheControl.web
|
|
156
|
-
}}
|
|
157
|
-
resizeMode={FastImage.resizeMode.contain}
|
|
158
|
-
/>
|
|
159
|
-
) : (
|
|
160
|
-
<LoyaltyImg
|
|
161
|
-
source={theme.images.dummies.loyaltyLevel}
|
|
162
|
-
resizeMode='contain'
|
|
163
|
-
/>
|
|
164
|
-
)}
|
|
165
|
-
<OText
|
|
166
|
-
size={22}
|
|
167
|
-
weight='bold'
|
|
168
|
-
style={{ textTransform: 'uppercase' }}
|
|
169
|
-
color={theme.colors.primary}
|
|
170
|
-
>
|
|
171
|
-
{loyaltyLevel.name}
|
|
202
|
+
<OText style={{ paddingLeft: 5 }}>
|
|
203
|
+
{currentWalletSelected?.type === 'cash'
|
|
204
|
+
? configs?.stripe_currency?.value
|
|
205
|
+
: t('POINTS', 'Points')}
|
|
172
206
|
</OText>
|
|
173
|
-
</
|
|
174
|
-
</LoyaltyContent>
|
|
175
|
-
)}
|
|
176
|
-
<BalanceElement>
|
|
177
|
-
<OText size={20} style={{fontWeight: '600'}}>
|
|
178
|
-
{currentWalletSelected?.type === 'cash'
|
|
179
|
-
? parsePrice(currentWalletSelected?.balance)
|
|
180
|
-
: currentWalletSelected?.balance
|
|
181
|
-
}
|
|
182
|
-
</OText>
|
|
183
|
-
<OText style={{ paddingLeft: 5 }}>
|
|
184
|
-
{currentWalletSelected?.type === 'cash'
|
|
185
|
-
? configs?.stripe_currency?.value
|
|
186
|
-
: t('POINTS', 'Points')}
|
|
187
|
-
</OText>
|
|
188
|
-
</BalanceElement>
|
|
207
|
+
</BalanceElement>
|
|
189
208
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
<TransactionsWrapper>
|
|
200
|
-
{transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.map((transaction: any, i: number) =>(
|
|
201
|
-
<WalletTransactionItem
|
|
202
|
-
idx={i}
|
|
203
|
-
type={currentWalletSelected?.type}
|
|
204
|
-
key={transaction.id}
|
|
205
|
-
item={transaction}
|
|
206
|
-
withFormatPrice={currentWalletSelected?.type === 'cash'}
|
|
207
|
-
/>
|
|
208
|
-
))}
|
|
209
|
-
</TransactionsWrapper>
|
|
210
|
-
</>
|
|
211
|
-
)}
|
|
209
|
+
{!isChewLayout && (
|
|
210
|
+
<WalletTransactions
|
|
211
|
+
transactionsList={transactionsList}
|
|
212
|
+
currentWalletSelected={currentWalletSelected}
|
|
213
|
+
/>
|
|
214
|
+
)}
|
|
215
|
+
</SectionContent>
|
|
216
|
+
</>
|
|
217
|
+
)}
|
|
212
218
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
{(walletList?.loading || userLoyaltyLevel.loading) && (
|
|
220
|
+
<>
|
|
221
|
+
<View>
|
|
222
|
+
<Placeholder Animation={Fade}>
|
|
223
|
+
<PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
|
|
224
|
+
</Placeholder>
|
|
225
|
+
</View>
|
|
226
|
+
<View style={{ marginTop: 10, marginBottom: 20 }}>
|
|
227
|
+
<Placeholder Animation={Fade}>
|
|
228
|
+
<PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
|
|
229
|
+
</Placeholder>
|
|
230
|
+
</View>
|
|
231
|
+
<View>
|
|
232
|
+
{[...Array(4).keys()].map(i => (
|
|
233
|
+
<View style={{ marginBottom: 10 }} key={i}>
|
|
234
|
+
<Placeholder Animation={Fade}>
|
|
235
|
+
<PlaceholderLine width={100} height={60} style={{ marginBottom: 0 }} />
|
|
236
|
+
</Placeholder>
|
|
222
237
|
</View>
|
|
223
|
-
)}
|
|
224
|
-
|
|
225
|
-
{!transactionsList?.loading &&
|
|
226
|
-
!(transactionsList?.loading && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) &&
|
|
227
|
-
(transactionsList?.error ||
|
|
228
|
-
!transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
|
|
229
|
-
(
|
|
230
|
-
<NotFoundSource
|
|
231
|
-
content={transactionsList?.error
|
|
232
|
-
? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
|
|
233
|
-
: t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
|
|
234
|
-
}
|
|
235
|
-
/>
|
|
236
|
-
)}
|
|
238
|
+
))}
|
|
237
239
|
</View>
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
)}
|
|
240
|
+
</>
|
|
241
|
+
)}
|
|
241
242
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
<PlaceholderLine width={100} height={40} style={{ marginBottom: 0 }} />
|
|
252
|
-
</Placeholder>
|
|
253
|
-
</View>
|
|
254
|
-
<View>
|
|
255
|
-
{[...Array(4).keys()].map(i => (
|
|
256
|
-
<View style={{ marginBottom: 10 }} key={i}>
|
|
257
|
-
<Placeholder Animation={Fade}>
|
|
258
|
-
<PlaceholderLine width={100} height={60} style={{ marginBottom: 0 }} />
|
|
259
|
-
</Placeholder>
|
|
260
|
-
</View>
|
|
261
|
-
))}
|
|
262
|
-
</View>
|
|
263
|
-
</>
|
|
264
|
-
)}
|
|
243
|
+
{!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
|
|
244
|
+
<NotFoundSource
|
|
245
|
+
content={walletList?.error
|
|
246
|
+
? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
|
|
247
|
+
: t('NOT_FOUND_WALLETS', 'No wallets to show at this time.')
|
|
248
|
+
}
|
|
249
|
+
/>
|
|
250
|
+
)}
|
|
251
|
+
</Container>
|
|
265
252
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
253
|
+
<OModal
|
|
254
|
+
open={openHistory}
|
|
255
|
+
onClose={() => setOpenHistory(false)}
|
|
256
|
+
entireModal
|
|
257
|
+
customClose
|
|
258
|
+
>
|
|
259
|
+
<ScrollView>
|
|
260
|
+
<WalletTransactionsWrapper>
|
|
261
|
+
<OButton
|
|
262
|
+
imgRightSrc={null}
|
|
263
|
+
style={{
|
|
264
|
+
borderWidth: 0,
|
|
265
|
+
backgroundColor: theme.colors.white,
|
|
266
|
+
padding: 0,
|
|
267
|
+
paddingHorizontal: 0,
|
|
268
|
+
width: 30,
|
|
269
|
+
paddingLeft: 0,
|
|
270
|
+
paddingRight: 0
|
|
271
|
+
}}
|
|
272
|
+
onClick={() => setOpenHistory(false)}
|
|
273
|
+
icon={AntDesignIcon}
|
|
274
|
+
iconProps={{
|
|
275
|
+
name: 'arrowleft',
|
|
276
|
+
size: 26
|
|
277
|
+
}}
|
|
278
|
+
/>
|
|
279
|
+
<WalletTransactions
|
|
280
|
+
transactionsList={transactionsList}
|
|
281
|
+
currentWalletSelected={currentWalletSelected}
|
|
282
|
+
/>
|
|
283
|
+
</WalletTransactionsWrapper>
|
|
284
|
+
</ScrollView>
|
|
285
|
+
</OModal>
|
|
286
|
+
</>
|
|
275
287
|
)
|
|
276
288
|
}
|
|
277
289
|
|
|
@@ -4,7 +4,11 @@ export const Container = styled.View`
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
`
|
|
7
|
-
|
|
7
|
+
export const Header = styled.View`
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
`
|
|
8
12
|
export const SectionContent = styled.View`
|
|
9
13
|
width: 100%;
|
|
10
14
|
display: flex;
|
|
@@ -14,13 +18,6 @@ export const SectionContent = styled.View`
|
|
|
14
18
|
margin-top: 20px;
|
|
15
19
|
`
|
|
16
20
|
|
|
17
|
-
export const TransactionsWrapper = styled.View`
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
border-left-width: 2px;
|
|
21
|
-
border-left-color: ${(props: any) => props.theme.colors.disabled};
|
|
22
|
-
`
|
|
23
|
-
|
|
24
21
|
export const BalanceElement = styled.View`
|
|
25
22
|
width: 100%;
|
|
26
23
|
padding: 10px 0;
|
|
@@ -30,16 +27,19 @@ export const BalanceElement = styled.View`
|
|
|
30
27
|
align-items: center;
|
|
31
28
|
background-color: ${(props: any) => props.theme.colors.backgroundGray100};
|
|
32
29
|
border-radius: 8px;
|
|
30
|
+
margin-bottom: 20px;
|
|
33
31
|
`
|
|
34
32
|
|
|
35
33
|
export const OTabs = styled.View`
|
|
36
34
|
flex-direction: row;
|
|
37
35
|
width: 100%;
|
|
38
36
|
flex-wrap: wrap;
|
|
37
|
+
padding-vertical: 5px;
|
|
39
38
|
`;
|
|
40
39
|
|
|
41
40
|
export const OTab = styled.View`
|
|
42
41
|
padding-horizontal: 10px;
|
|
42
|
+
padding-vertical: 10px;
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
export const LoyaltyContent = styled.View`
|
|
@@ -62,3 +62,7 @@ export const LoyaltyImg = styled.ImageBackground`
|
|
|
62
62
|
justify-content: center;
|
|
63
63
|
align-items: center;
|
|
64
64
|
`
|
|
65
|
+
export const WalletTransactionsWrapper = styled.View`
|
|
66
|
+
padding-horizontal: 40px;
|
|
67
|
+
padding-top: 20px;
|
|
68
|
+
`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { StyleSheet, ViewStyle } from 'react-native'
|
|
3
|
+
import styled from 'styled-components/native'
|
|
4
|
+
|
|
5
|
+
const CardContainerTouchable = styled.TouchableOpacity``
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
children: React.ReactChildren | Element,
|
|
9
|
+
style?: Array<ViewStyle> | any,
|
|
10
|
+
onClick: any
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const CardAnimation = (props: Props) => {
|
|
14
|
+
const {
|
|
15
|
+
children,
|
|
16
|
+
onClick,
|
|
17
|
+
style
|
|
18
|
+
} = props
|
|
19
|
+
const [isPressed, setIsPressed] = useState(false)
|
|
20
|
+
const styles = StyleSheet.create({
|
|
21
|
+
cardAnimation: {
|
|
22
|
+
elevation: isPressed ? 2 : 0,
|
|
23
|
+
shadowColor: '#888',
|
|
24
|
+
shadowOffset: { width: 0, height: 0 },
|
|
25
|
+
shadowRadius: 0,
|
|
26
|
+
shadowOpacity: isPressed ? 0.8 : 0,
|
|
27
|
+
borderRadius: 12,
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const styleProvided = style || []
|
|
32
|
+
return (
|
|
33
|
+
<CardContainerTouchable
|
|
34
|
+
onPress={onClick}
|
|
35
|
+
activeOpacity={0.8}
|
|
36
|
+
delayPressIn={20}
|
|
37
|
+
onPressIn={() => setIsPressed(true)}
|
|
38
|
+
onPressOut={() => setIsPressed(false)}
|
|
39
|
+
style={[
|
|
40
|
+
...styleProvided,
|
|
41
|
+
styles.cardAnimation
|
|
42
|
+
]}
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</CardContainerTouchable>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import OText from './OText';
|
|
4
|
+
import { useTheme } from 'styled-components/native'
|
|
4
5
|
|
|
5
6
|
const HeaderTitle = (props: any) => {
|
|
6
7
|
const { text, style } = props
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
|
|
7
10
|
return (
|
|
8
11
|
<OText
|
|
9
|
-
size={
|
|
12
|
+
size={20}
|
|
13
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
10
14
|
style={style ?? {
|
|
11
15
|
marginTop: Platform.OS === 'android' ? 50 : 30,
|
|
12
|
-
paddingHorizontal: 40,
|
|
13
|
-
textTransform: 'capitalize'
|
|
16
|
+
paddingHorizontal: props.ph ?? 40,
|
|
17
|
+
textTransform: 'capitalize',
|
|
18
|
+
color: props.titleColor || theme.colors.textNormal,
|
|
14
19
|
}}
|
|
15
20
|
>
|
|
16
21
|
{text}
|
|
@@ -6,6 +6,7 @@ const deviceHeight = Dimensions.get('window').height
|
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
open: boolean;
|
|
9
|
+
transparent?: boolean;
|
|
9
10
|
title?: string;
|
|
10
11
|
children?: any;
|
|
11
12
|
onClose?: any;
|
|
@@ -13,26 +14,30 @@ interface Props {
|
|
|
13
14
|
bottomContainerStyle?: any;
|
|
14
15
|
titleStyle?: any;
|
|
15
16
|
closeIcon?: any;
|
|
17
|
+
presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen" | undefined
|
|
16
18
|
}
|
|
17
19
|
const OBottomPopup = (props: Props) => {
|
|
18
20
|
const {
|
|
19
21
|
open,
|
|
22
|
+
transparent,
|
|
20
23
|
title,
|
|
21
24
|
onClose,
|
|
22
25
|
children,
|
|
23
26
|
isStatusBar,
|
|
24
27
|
titleStyle,
|
|
25
28
|
bottomContainerStyle,
|
|
26
|
-
closeIcon
|
|
29
|
+
closeIcon,
|
|
30
|
+
presentationStyle
|
|
27
31
|
} = props
|
|
28
32
|
const { top, bottom } = useSafeAreaInsets();
|
|
33
|
+
|
|
29
34
|
return (
|
|
30
35
|
<Modal
|
|
31
|
-
animationType='
|
|
32
|
-
transparent={
|
|
36
|
+
animationType='fade'
|
|
37
|
+
transparent={transparent}
|
|
33
38
|
visible={open}
|
|
34
39
|
onRequestClose={() => onClose()}
|
|
35
|
-
presentationStyle={'fullScreen'}
|
|
40
|
+
presentationStyle={presentationStyle || 'fullScreen'}
|
|
36
41
|
>
|
|
37
42
|
{isStatusBar && <StatusBar translucent={false} />}
|
|
38
43
|
<View style={styles.container}>
|
|
@@ -44,19 +49,22 @@ const OBottomPopup = (props: Props) => {
|
|
|
44
49
|
</TouchableWithoutFeedback>
|
|
45
50
|
<View style={{ ...styles.bottomContainer, ...bottomContainerStyle }}>
|
|
46
51
|
<View style={{ paddingTop: top, paddingBottom: bottom }}>
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
<View style={styles.modalTitleStyle}>
|
|
53
|
+
{closeIcon && (
|
|
54
|
+
<TouchableOpacity onPress={() => onClose()} style={styles.closeIconStyle}>
|
|
55
|
+
<OIcon
|
|
56
|
+
src={closeIcon}
|
|
57
|
+
width={20}
|
|
58
|
+
height={20}
|
|
59
|
+
/>
|
|
60
|
+
</TouchableOpacity>
|
|
61
|
+
)}
|
|
62
|
+
{!!title && (
|
|
63
|
+
<Text style={{ ...styles.titleStyle, ...titleStyle }}>
|
|
64
|
+
{title}
|
|
65
|
+
</Text>
|
|
66
|
+
)}
|
|
67
|
+
</View>
|
|
60
68
|
{children}
|
|
61
69
|
</View>
|
|
62
70
|
</View>
|
|
@@ -69,7 +77,7 @@ const styles = StyleSheet.create({
|
|
|
69
77
|
container: {
|
|
70
78
|
flex: 1,
|
|
71
79
|
backgroundColor: '#000000AA',
|
|
72
|
-
justifyContent: 'flex-end'
|
|
80
|
+
justifyContent: 'flex-end'
|
|
73
81
|
},
|
|
74
82
|
touchableOutsideStyle: {
|
|
75
83
|
flex: 1,
|
|
@@ -83,12 +91,18 @@ const styles = StyleSheet.create({
|
|
|
83
91
|
},
|
|
84
92
|
titleStyle: {
|
|
85
93
|
fontSize: 20,
|
|
86
|
-
fontWeight: 'bold'
|
|
87
|
-
marginVertical: 10
|
|
94
|
+
fontWeight: 'bold'
|
|
88
95
|
},
|
|
89
96
|
closeIconStyle: {
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
left: 25,
|
|
99
|
+
top: 25,
|
|
100
|
+
zIndex: 100
|
|
101
|
+
},
|
|
102
|
+
modalTitleStyle: {
|
|
103
|
+
position: 'relative',
|
|
104
|
+
paddingHorizontal: 10,
|
|
105
|
+
paddingVertical: 20
|
|
92
106
|
}
|
|
93
107
|
})
|
|
94
108
|
|
|
@@ -78,6 +78,9 @@ interface Props {
|
|
|
78
78
|
borderColor?: string;
|
|
79
79
|
loadingStyle?: ViewStyle;
|
|
80
80
|
showNextIcon?: boolean;
|
|
81
|
+
isDisabledWithSameStyles?: boolean;
|
|
82
|
+
icon?: any;
|
|
83
|
+
iconProps?: any
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
const OButton = (props: Props): React.ReactElement => {
|
|
@@ -110,8 +113,12 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
110
113
|
activeOpacity={props.activeOpacity}
|
|
111
114
|
onPress={props.onClick}
|
|
112
115
|
style={{ width: props.isCircle ? 52 : props.style?.width, ...props.parentStyle }}
|
|
116
|
+
disabled={props.isDisabledWithSameStyles}
|
|
113
117
|
>
|
|
114
118
|
<StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
|
|
119
|
+
{props.icon ? (
|
|
120
|
+
<props.icon {...props.iconProps} />
|
|
121
|
+
) : null}
|
|
115
122
|
{props.imgLeftSrc ? (
|
|
116
123
|
<OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} />
|
|
117
124
|
) : null}
|
|
@@ -120,9 +127,9 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
120
127
|
) : null}
|
|
121
128
|
{props.imgRightSrc ? (
|
|
122
129
|
<EndImage style={props.imgRightStyle} source={props.imgRightSrc} />
|
|
123
|
-
) : props.showNextIcon ?
|
|
124
|
-
<EndImage source={theme.images.general.arrow_left}
|
|
125
|
-
|
|
130
|
+
) : props.showNextIcon ?
|
|
131
|
+
<EndImage source={theme.images.general.arrow_left}
|
|
132
|
+
style={{ width: 16, tintColor: 'white', transform: [{ rotate: I18nManager.isRTL ? '0deg' : '180deg' }] }} /> : null}
|
|
126
133
|
</StyledButton>
|
|
127
134
|
</TouchableOpacity>
|
|
128
135
|
);
|