ordering-ui-react-native 0.18.2 → 0.18.3-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +0 -20
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -2
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
- 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 +163 -123
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/index.tsx +5 -2
- package/themes/business/src/components/MapView/index.tsx +14 -10
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +205 -12
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +67 -39
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +47 -23
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +9 -4
- package/themes/business/src/components/OrderMessage/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- 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 +43 -32
- 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 +21 -29
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +193 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +3 -1
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/StoresList/index.tsx +6 -5
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- 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/OModal.tsx +16 -9
- package/themes/business/src/types/index.tsx +8 -0
- package/themes/business/src/utils/index.tsx +4 -4
- 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/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
- 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/PhoneInputNumber/index.tsx +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +7 -3
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +33 -15
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +5 -8
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +74 -38
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +11 -13
- package/themes/original/src/components/BusinessController/index.tsx +35 -44
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +25 -26
- 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 +133 -438
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -19
- package/themes/original/src/components/BusinessPreorder/index.tsx +105 -22
- package/themes/original/src/components/BusinessPreorder/styles.tsx +14 -0
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +162 -39
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -5
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -2
- 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 +37 -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 +49 -47
- package/themes/original/src/components/CartContent/index.tsx +99 -38
- package/themes/original/src/components/CartContent/styles.tsx +6 -6
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +324 -43
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/DriverTips/index.tsx +6 -3
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- 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 +7 -5
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +3 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +63 -7
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +14 -5
- 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 +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +9 -2
- package/themes/original/src/components/Messages/index.tsx +15 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +9 -10
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +348 -70
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -2
- package/themes/original/src/components/MyOrders/index.tsx +16 -5
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- 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/NotFoundSource/index.tsx +14 -10
- 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/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +22 -6
- package/themes/original/src/components/OrderDetails/index.tsx +721 -670
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +34 -25
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +62 -57
- 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/index.tsx +13 -13
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +44 -21
- package/themes/original/src/components/OrdersOption/styles.tsx +2 -2
- package/themes/original/src/components/PageBanner/index.tsx +65 -29
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- 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 +106 -170
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +13 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +6 -6
- package/themes/original/src/components/Promotions/styles.tsx +3 -3
- 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/index.tsx +16 -7
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- 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/SignupForm/index.tsx +27 -16
- package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
- package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +16 -205
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +100 -22
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -26
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +48 -60
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +3 -3
- package/themes/original/src/components/shared/OInput.tsx +4 -5
- package/themes/original/src/components/shared/OModal.tsx +15 -17
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +28 -6
- package/themes/original/src/utils/index.tsx +180 -13
- 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
|
@@ -10,6 +10,7 @@ import { PreviousProductsOrdered } from './PreviousProductsOrdered'
|
|
|
10
10
|
import { OptionTitle, NoOrdersWrapper } from './styles'
|
|
11
11
|
import { OrdersOptionParams } from '../../types'
|
|
12
12
|
import { _setStoreData } from '../../providers/StoreUtil';
|
|
13
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
13
14
|
import {
|
|
14
15
|
Placeholder,
|
|
15
16
|
PlaceholderLine,
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
} from "rn-placeholder";
|
|
18
19
|
|
|
19
20
|
import { View, ScrollView } from 'react-native'
|
|
20
|
-
import { getOrderStatus } from '../../utils'
|
|
21
|
+
import { getOrderStatus, flatArray } from '../../utils'
|
|
21
22
|
|
|
22
23
|
const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
23
24
|
const {
|
|
@@ -50,7 +51,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
50
51
|
businesses,
|
|
51
52
|
businessPaginationProps,
|
|
52
53
|
handleUpdateProducts,
|
|
53
|
-
handleUpdateBusinesses
|
|
54
|
+
handleUpdateBusinesses,
|
|
55
|
+
businessId
|
|
54
56
|
} = props
|
|
55
57
|
|
|
56
58
|
const theme = useTheme();
|
|
@@ -98,7 +100,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
98
100
|
return false
|
|
99
101
|
})
|
|
100
102
|
setOrders(orders)
|
|
101
|
-
}, [_orders
|
|
103
|
+
}, [JSON.stringify(_orders)])
|
|
102
104
|
|
|
103
105
|
const onProductClick = (product: any) => {
|
|
104
106
|
if (product?.product_id && product?.category_id && product?.businessId &&
|
|
@@ -120,6 +122,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
useEffect(() => {
|
|
125
|
+
if (reorderState?.loading) return
|
|
123
126
|
const _businessId = 'businessId:' + reorderState?.result?.business_id
|
|
124
127
|
if (reorderState?.error) {
|
|
125
128
|
if (reorderState?.result?.business_id) {
|
|
@@ -127,21 +130,39 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
127
130
|
navigation.navigate('Business', { store: reorderState?.result?.business?.slug })
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
|
-
if (!reorderState?.error && reorderState.loading
|
|
133
|
+
if (!reorderState?.error && !reorderState.loading && reorderState?.result?.business_id) {
|
|
131
134
|
const cartProducts = carts?.[_businessId]?.products
|
|
132
|
-
const available = cartProducts.every((product: any) => product.valid === true)
|
|
133
|
-
const orderProducts = orders.find((order: any) => order?.id === reorderState?.result?.orderId)?.products
|
|
134
135
|
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
const available = cartProducts.every((product: any) => product.valid)
|
|
137
|
+
const orderProducts = orders.find(
|
|
138
|
+
(order: any) => Array.isArray(order?.id)
|
|
139
|
+
? order?.id?.includes(reorderState?.result?.orderId)
|
|
140
|
+
: order?.id === reorderState?.result?.orderId
|
|
141
|
+
)?.products
|
|
142
|
+
|
|
143
|
+
const productsFlatten = orderProducts?.length && flatArray(orderProducts)?.filter(product => product?.order_id === reorderState?.result?.orderId)
|
|
144
|
+
|
|
145
|
+
if (available && reorderState?.result?.uuid && (cartProducts?.length === productsFlatten?.length)) {
|
|
146
|
+
const multiOrders = flatArray(orderProducts)?.map(product => product.order_id)
|
|
147
|
+
const params = multiOrders?.length > 1
|
|
148
|
+
? { screen: 'MultiCheckout', checkCarts: true }
|
|
149
|
+
: { cartUuid: reorderState?.result.uuid }
|
|
150
|
+
|
|
151
|
+
onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', params)
|
|
137
152
|
} else {
|
|
138
153
|
_setStoreData('adjust-cart-products', JSON.stringify(_businessId))
|
|
139
|
-
cartProducts?.length !==
|
|
154
|
+
cartProducts?.length !== productsFlatten?.length && _setStoreData('already-removed', JSON.stringify('removed'))
|
|
140
155
|
navigation.navigate('Business', { store: reorderState?.result?.business?.slug })
|
|
141
156
|
}
|
|
142
157
|
}
|
|
143
158
|
}, [reorderState])
|
|
144
159
|
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (reorderState?.error) {
|
|
162
|
+
showToast(ToastType.Error, reorderState?.result)
|
|
163
|
+
}
|
|
164
|
+
}, [reorderState])
|
|
165
|
+
|
|
145
166
|
useFocusEffect(
|
|
146
167
|
React.useCallback(() => {
|
|
147
168
|
if (!businessesSearchList) {
|
|
@@ -166,6 +187,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
166
187
|
setOrdersLength && setOrdersLength({ ...ordersLength, activeOrdersLength: updateOrders?.length })
|
|
167
188
|
} else if (!preOrders) {
|
|
168
189
|
setOrdersLength && setOrdersLength({ ...ordersLength, previousOrdersLength: updateOrders?.length })
|
|
190
|
+
} else {
|
|
191
|
+
setOrdersLength && setOrdersLength({ ...ordersLength, preordersLength: updateOrders?.length })
|
|
169
192
|
}
|
|
170
193
|
}, [_orders, activeOrders, preOrders])
|
|
171
194
|
|
|
@@ -178,21 +201,21 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
178
201
|
|
|
179
202
|
return (
|
|
180
203
|
<>
|
|
181
|
-
{!loading && ordersLength.activeOrdersLength === 0 && ordersLength.previousOrdersLength === 0 && !activeOrders && (
|
|
204
|
+
{!loading && ordersLength.activeOrdersLength === 0 && ordersLength.previousOrdersLength === 0 && ordersLength?.preordersLength === 0 && !activeOrders && !preOrders && (
|
|
182
205
|
<NoOrdersWrapper>
|
|
183
|
-
<
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
textStyle={{ color: 'white', fontSize: 14 }}
|
|
190
|
-
style={{ borderRadius: 7.6, marginBottom: 10, marginTop: 10, height: 44, paddingLeft: 10, paddingRight: 10 }}
|
|
206
|
+
<NotFoundSource
|
|
207
|
+
hideImage
|
|
208
|
+
btnStyle={{ borderRadius: 8 }}
|
|
209
|
+
content={t('YOU_DONT_HAVE_ORDERS', 'You don\'t have any orders')}
|
|
210
|
+
btnTitle={t('ORDER_NOW', 'Order now')}
|
|
211
|
+
onClickButton={() => onNavigationRedirect && (businessId ? onNavigationRedirect('Business') : onNavigationRedirect('BusinessList'))}
|
|
191
212
|
/>
|
|
192
|
-
|
|
193
213
|
</NoOrdersWrapper>
|
|
194
214
|
)}
|
|
195
|
-
{((ordersLength?.activeOrdersLength > 0 && activeOrders) ||
|
|
215
|
+
{((ordersLength?.activeOrdersLength > 0 && activeOrders) ||
|
|
216
|
+
(ordersLength?.previousOrdersLength > 0 && !activeOrders && !preOrders) ||
|
|
217
|
+
(ordersLength?.preordersLength > 0 && preOrders)
|
|
218
|
+
) && (
|
|
196
219
|
<>
|
|
197
220
|
{((titleContent && ((isBusiness && businessOrderIds?.length > 0) || isProducts)) || !titleContent) && (
|
|
198
221
|
<OptionTitle titleContent={!!titleContent} isBusinessesSearchList={!!businessesSearchList}>
|
|
@@ -286,7 +309,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
286
309
|
/>
|
|
287
310
|
)
|
|
288
311
|
)}
|
|
289
|
-
{loading && !hideOrders && (
|
|
312
|
+
{loading && !hideOrders && !preOrders && (
|
|
290
313
|
<>
|
|
291
314
|
{!activeOrders ? (
|
|
292
315
|
<Placeholder style={{ marginTop: 30 }} Animation={Fade}>
|
|
@@ -3,12 +3,12 @@ import styled, { css } from 'styled-components/native'
|
|
|
3
3
|
export const OptionTitle = styled.View`
|
|
4
4
|
margin-top: 24px;
|
|
5
5
|
${(props : any) => props.titleContent && css`
|
|
6
|
-
margin-left: ${() => props.isBusinessesSearchList ? '0' : '
|
|
6
|
+
margin-left: ${() => props.isBusinessesSearchList ? '0' : '20px'};
|
|
7
7
|
`}
|
|
8
8
|
`
|
|
9
9
|
|
|
10
10
|
export const NoOrdersWrapper = styled.View`
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
align-items: center;
|
|
13
|
-
margin-top:
|
|
13
|
+
margin-top: 60px;
|
|
14
14
|
`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useRef } from 'react'
|
|
2
|
-
import { useUtils, PageBanner as PageBannerController } from 'ordering-components/native'
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react'
|
|
2
|
+
import { useUtils, useEvent, PageBanner as PageBannerController } from 'ordering-components/native'
|
|
3
3
|
import { View, StyleSheet, Dimensions, TouchableOpacity } from 'react-native'
|
|
4
4
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
5
5
|
import Carousel from 'react-native-snap-carousel'
|
|
@@ -16,7 +16,10 @@ const PageBannerUI = (props: any) => {
|
|
|
16
16
|
|
|
17
17
|
const theme = useTheme();
|
|
18
18
|
const [{ optimizeImage }] = useUtils();
|
|
19
|
-
const
|
|
19
|
+
const [events] = useEvent()
|
|
20
|
+
const carouselRef = useRef<any>(null)
|
|
21
|
+
const [currentIndex, setCurrentIndex] = useState(0)
|
|
22
|
+
const [viewedBanner, setViewedBanner] = useState<any>(null)
|
|
20
23
|
|
|
21
24
|
const windowWidth = Dimensions.get('window').width;
|
|
22
25
|
|
|
@@ -41,10 +44,11 @@ const PageBannerUI = (props: any) => {
|
|
|
41
44
|
})
|
|
42
45
|
|
|
43
46
|
const onRedirect = (route: string, params?: any) => {
|
|
44
|
-
navigation.
|
|
47
|
+
navigation.push(route, params)
|
|
45
48
|
}
|
|
46
49
|
|
|
47
|
-
const handleGoToPage = (
|
|
50
|
+
const handleGoToPage = (item: any) => {
|
|
51
|
+
const action = item.action
|
|
48
52
|
if (!action?.url) return
|
|
49
53
|
let slug
|
|
50
54
|
if (action.type === 'business') {
|
|
@@ -59,15 +63,22 @@ const PageBannerUI = (props: any) => {
|
|
|
59
63
|
businessSlug: slug,
|
|
60
64
|
businessId: action.business_id,
|
|
61
65
|
categoryId: action.category_id,
|
|
62
|
-
productId: action.product_id
|
|
66
|
+
productId: action.product_id,
|
|
67
|
+
isRedirect: 'business',
|
|
68
|
+
business: {
|
|
69
|
+
store: slug
|
|
70
|
+
}
|
|
63
71
|
})
|
|
64
72
|
}
|
|
73
|
+
const clickedBanner = pageBannerState.result.find(banner => banner.id === item?.banner_id)
|
|
74
|
+
events.emit('promotion_clicked', clickedBanner)
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
const renderItem = ({ item, index }) => {
|
|
68
78
|
return (
|
|
69
79
|
<TouchableOpacity
|
|
70
|
-
|
|
80
|
+
activeOpacity={1}
|
|
81
|
+
onPress={() => handleGoToPage(item)}
|
|
71
82
|
>
|
|
72
83
|
<View style={styles.sliderWrapper}>
|
|
73
84
|
<FastImage
|
|
@@ -80,6 +91,24 @@ const PageBannerUI = (props: any) => {
|
|
|
80
91
|
)
|
|
81
92
|
}
|
|
82
93
|
|
|
94
|
+
const updateIndex = () => {
|
|
95
|
+
setCurrentIndex(carouselRef?.current?.currentIndex)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (pageBannerState.loading) return
|
|
100
|
+
if (pageBannerState.banner?.items && pageBannerState.banner?.items.length > 0) {
|
|
101
|
+
const bannerId = pageBannerState.banner.items[currentIndex]?.banner_id
|
|
102
|
+
if (pageBannerState.result && bannerId) {
|
|
103
|
+
const _viewedBanner = pageBannerState.result.find(banner => banner.id === bannerId)
|
|
104
|
+
if (_viewedBanner?.id !== viewedBanner?.id) {
|
|
105
|
+
setViewedBanner(_viewedBanner)
|
|
106
|
+
events.emit('promotion_viewed', _viewedBanner)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, [pageBannerState.loading, currentIndex, viewedBanner])
|
|
111
|
+
|
|
83
112
|
return (
|
|
84
113
|
<>
|
|
85
114
|
{pageBannerState.loading ? (
|
|
@@ -97,37 +126,44 @@ const PageBannerUI = (props: any) => {
|
|
|
97
126
|
<>
|
|
98
127
|
{pageBannerState.banner?.items && pageBannerState.banner?.items.length > 0 && (
|
|
99
128
|
<PageBannerWrapper>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
129
|
+
{pageBannerState.banner?.items.length > 1 && (
|
|
130
|
+
<>
|
|
131
|
+
<TouchableOpacity
|
|
132
|
+
activeOpacity={1}
|
|
133
|
+
style={[styles.swiperButton, { left: 25 }]}
|
|
134
|
+
onPress={() => carouselRef.current.snapToPrev()}
|
|
135
|
+
>
|
|
136
|
+
<IconAntDesign
|
|
137
|
+
name="caretleft"
|
|
138
|
+
color={theme.colors.white}
|
|
139
|
+
size={13}
|
|
140
|
+
/>
|
|
141
|
+
</TouchableOpacity>
|
|
142
|
+
<TouchableOpacity
|
|
143
|
+
activeOpacity={1}
|
|
144
|
+
style={[styles.swiperButton, { right: 25 }]}
|
|
145
|
+
onPress={() => carouselRef.current.snapToNext()}
|
|
146
|
+
>
|
|
147
|
+
<IconAntDesign
|
|
148
|
+
name="caretright"
|
|
149
|
+
color={theme.colors.white}
|
|
150
|
+
size={13}
|
|
151
|
+
/>
|
|
152
|
+
</TouchableOpacity>
|
|
153
|
+
</>
|
|
154
|
+
)}
|
|
120
155
|
<Carousel
|
|
121
156
|
ref={carouselRef}
|
|
122
157
|
loop={pageBannerState.banner?.items.length > 1}
|
|
123
158
|
data={pageBannerState.banner?.items}
|
|
124
159
|
renderItem={renderItem}
|
|
125
|
-
sliderWidth={windowWidth
|
|
126
|
-
itemWidth={windowWidth
|
|
160
|
+
sliderWidth={windowWidth}
|
|
161
|
+
itemWidth={windowWidth}
|
|
127
162
|
inactiveSlideScale={1}
|
|
128
163
|
pagingEnabled
|
|
129
164
|
removeClippedSubviews={false}
|
|
130
165
|
inactiveSlideOpacity={1}
|
|
166
|
+
onSnapToItem={updateIndex}
|
|
131
167
|
/>
|
|
132
168
|
</PageBannerWrapper>
|
|
133
169
|
)}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { View, Modal, TouchableOpacity, StyleSheet, SafeAreaView, KeyboardAvoidingView, Platform, ScrollView } from 'react-native'
|
|
3
|
+
import { OButton, OIcon, OInput, OModal, OText } from '../shared'
|
|
4
|
+
import { PaymentOptionStripe, useLanguage, useSession } from 'ordering-components/native'
|
|
5
|
+
import { StripeCardsListUI } from '../StripeCardsList'
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import { CreditCardInput } from "react-native-credit-card-input-plus";
|
|
8
|
+
import Alert from '../../providers/AlertProvider'
|
|
9
|
+
|
|
10
|
+
const PaymentOptionCardUI = (props: any) => {
|
|
11
|
+
const {
|
|
12
|
+
cardSelected,
|
|
13
|
+
deleteCard,
|
|
14
|
+
onSelectCard,
|
|
15
|
+
handleCardClick,
|
|
16
|
+
cardsList,
|
|
17
|
+
addCardOpen,
|
|
18
|
+
setAddCardOpen,
|
|
19
|
+
gateway,
|
|
20
|
+
handleNewCard,
|
|
21
|
+
paymethodsWithoutSaveCards
|
|
22
|
+
} = props
|
|
23
|
+
const [, t] = useLanguage()
|
|
24
|
+
const theme = useTheme()
|
|
25
|
+
const [{ token }] = useSession()
|
|
26
|
+
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<string> }>({ open: false, content: [] })
|
|
27
|
+
const [newCard, setNewCard] = useState<any>(null)
|
|
28
|
+
|
|
29
|
+
const onChangeCardForm = (values : any) => {
|
|
30
|
+
if (values?.valid) {
|
|
31
|
+
const expiry = values?.values?.expiry?.split('/')
|
|
32
|
+
const expiryMonth = expiry[0]
|
|
33
|
+
const expiryYear = expiry[1]
|
|
34
|
+
const expiryString = expiryMonth + expiryYear
|
|
35
|
+
let lastFourDigits = values?.values?.number?.substr(-4);
|
|
36
|
+
setNewCard({
|
|
37
|
+
name: values?.values.name,
|
|
38
|
+
number: values?.values.number.replace(/\s/g, ''),
|
|
39
|
+
cvc: values?.values.cvc,
|
|
40
|
+
expiryMonth: expiryMonth,
|
|
41
|
+
expiryYear: expiryYear,
|
|
42
|
+
expiry: expiry,
|
|
43
|
+
brand: values?.values?.type,
|
|
44
|
+
last4: lastFourDigits,
|
|
45
|
+
expiryString: expiryString
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const handleAddNewCard = () => {
|
|
51
|
+
handleNewCard(newCard)
|
|
52
|
+
setAddCardOpen({ ...addCardOpen, card: false })
|
|
53
|
+
setNewCard(null)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (cardsList.error && !cardsList.loading) {
|
|
58
|
+
setAlertState({
|
|
59
|
+
open: true,
|
|
60
|
+
content: cardsList.error
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
}, [JSON.stringify(cardsList)])
|
|
64
|
+
|
|
65
|
+
const style = StyleSheet.create({
|
|
66
|
+
wrapperIcon: {
|
|
67
|
+
marginLeft: 25,
|
|
68
|
+
marginTop: Platform.OS === 'ios' ? 40 : 12,
|
|
69
|
+
marginBottom: 20,
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
},
|
|
73
|
+
buttonStyle: {
|
|
74
|
+
marginVertical: 20,
|
|
75
|
+
borderRadius: 7.6,
|
|
76
|
+
shadowOpacity: 0,
|
|
77
|
+
height: 44,
|
|
78
|
+
borderWidth: 1
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<View>
|
|
84
|
+
<>
|
|
85
|
+
{token && (!cardSelected || !paymethodsWithoutSaveCards.includes(gateway)) && (
|
|
86
|
+
<OButton
|
|
87
|
+
text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
|
|
88
|
+
bgColor={theme.colors.white}
|
|
89
|
+
borderColor={theme.colors.primary}
|
|
90
|
+
style={{
|
|
91
|
+
marginVertical: 20,
|
|
92
|
+
borderRadius: 7.6,
|
|
93
|
+
shadowOpacity: 0,
|
|
94
|
+
height: 44,
|
|
95
|
+
borderWidth: 1
|
|
96
|
+
}}
|
|
97
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
98
|
+
imgRightSrc={null}
|
|
99
|
+
onClick={() => setAddCardOpen({ ...addCardOpen, card: true })}
|
|
100
|
+
/>
|
|
101
|
+
)}
|
|
102
|
+
<StripeCardsListUI
|
|
103
|
+
cardSelected={cardSelected}
|
|
104
|
+
deleteCard={deleteCard}
|
|
105
|
+
onSelectCard={onSelectCard}
|
|
106
|
+
handleCardClick={handleCardClick}
|
|
107
|
+
cardsList={cardsList}
|
|
108
|
+
noShowErrors
|
|
109
|
+
gateway={gateway}
|
|
110
|
+
/>
|
|
111
|
+
</>
|
|
112
|
+
<Modal
|
|
113
|
+
animationType="slide"
|
|
114
|
+
visible={addCardOpen?.card}
|
|
115
|
+
onDismiss={() => setAddCardOpen({ ...addCardOpen, card: false })}
|
|
116
|
+
>
|
|
117
|
+
<KeyboardAvoidingView
|
|
118
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
119
|
+
style={{
|
|
120
|
+
flex: 1,
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
<ScrollView>
|
|
124
|
+
<TouchableOpacity onPress={() => setAddCardOpen({ ...addCardOpen, card: false })}>
|
|
125
|
+
<OIcon
|
|
126
|
+
src={theme.images.general.close}
|
|
127
|
+
width={16}
|
|
128
|
+
style={style.wrapperIcon}
|
|
129
|
+
/>
|
|
130
|
+
</TouchableOpacity>
|
|
131
|
+
<>
|
|
132
|
+
<CreditCardInput
|
|
133
|
+
onChange={onChangeCardForm}
|
|
134
|
+
requiresName
|
|
135
|
+
/>
|
|
136
|
+
{alertState?.content?.[0] && !cardsList?.loading && (
|
|
137
|
+
<OText
|
|
138
|
+
color={theme?.colors?.error}
|
|
139
|
+
style={{
|
|
140
|
+
alignSelf: 'center'
|
|
141
|
+
}}
|
|
142
|
+
size={20}
|
|
143
|
+
>
|
|
144
|
+
{alertState.content[0]}
|
|
145
|
+
</OText>
|
|
146
|
+
)}
|
|
147
|
+
<OButton
|
|
148
|
+
text={t('ADD_CARD', 'Add card')}
|
|
149
|
+
isDisabled={!newCard || cardsList?.loading}
|
|
150
|
+
isLoading={cardsList?.loading}
|
|
151
|
+
onClick={() => handleAddNewCard()}
|
|
152
|
+
style={{
|
|
153
|
+
margin: 20,
|
|
154
|
+
...style.buttonStyle
|
|
155
|
+
}}
|
|
156
|
+
/>
|
|
157
|
+
</>
|
|
158
|
+
</ScrollView>
|
|
159
|
+
</KeyboardAvoidingView>
|
|
160
|
+
</Modal>
|
|
161
|
+
<Alert
|
|
162
|
+
open={alertState?.open || false}
|
|
163
|
+
title=''
|
|
164
|
+
content={alertState.content}
|
|
165
|
+
onClose={() => setAlertState({ open: false, content: [] })}
|
|
166
|
+
onAccept={() => setAlertState({ open: false, content: [] })}
|
|
167
|
+
/>
|
|
168
|
+
</View>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export const PaymentOptionCard = (props : any) => {
|
|
173
|
+
const paymentOptions = {
|
|
174
|
+
...props,
|
|
175
|
+
UIComponent: PaymentOptionCardUI
|
|
176
|
+
}
|
|
177
|
+
return (
|
|
178
|
+
<PaymentOptionStripe {...paymentOptions} />
|
|
179
|
+
)
|
|
180
|
+
}
|
|
@@ -45,7 +45,7 @@ const PaymentOptionWalletUI = (props: any) => {
|
|
|
45
45
|
new Array(walletsState.result?.length).fill(false)
|
|
46
46
|
);
|
|
47
47
|
|
|
48
|
-
const creditBalance: any = (wallet: any) => ` = ${parsePrice(wallet.balance / wallet.redemption_rate
|
|
48
|
+
const creditBalance: any = (wallet: any) => ` = ${parsePrice(wallet.balance / wallet.redemption_rate)}`
|
|
49
49
|
|
|
50
50
|
const walletName: any = {
|
|
51
51
|
cash: {
|
|
@@ -87,65 +87,65 @@ const PaymentOptionWalletUI = (props: any) => {
|
|
|
87
87
|
{!walletsState.loading &&
|
|
88
88
|
!walletsState.error &&
|
|
89
89
|
walletsState.result?.length > 0 &&
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</View>
|
|
90
|
+
(
|
|
91
|
+
<>
|
|
92
|
+
{walletsState.result?.map((wallet: any, idx: any) => wallet.valid && wallet.balance >= 0 && walletName[wallet.type]?.isActive && (
|
|
93
|
+
<Container
|
|
94
|
+
key={wallet.id}
|
|
95
|
+
isBottomBorder={idx === walletsState.result?.filter((wallet: any) => wallet.valid)?.length - 1}
|
|
96
|
+
onPress={() => handleOnChange(idx, wallet)}
|
|
97
|
+
disabled={(cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0}
|
|
98
|
+
>
|
|
99
|
+
<SectionLeft>
|
|
100
|
+
{checkedState[idx] ? (
|
|
101
|
+
<MaterialCommunityIcons
|
|
102
|
+
name="checkbox-marked"
|
|
103
|
+
size={25}
|
|
104
|
+
color={theme.colors.primary}
|
|
105
|
+
/>
|
|
106
|
+
) : (
|
|
107
|
+
<MaterialCommunityIcons
|
|
108
|
+
name="checkbox-blank-outline"
|
|
109
|
+
size={25}
|
|
110
|
+
color={theme.colors.disabled}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
<View style={{ alignItems: 'baseline', marginLeft: 5 }}>
|
|
114
|
+
<View>
|
|
115
|
+
<OText
|
|
116
|
+
style={((cart?.balance === 0 && !checkedState[idx]) || wallet.balance === 0) ?{
|
|
117
|
+
color: theme.colors.disabled
|
|
118
|
+
} : {}}
|
|
119
|
+
>
|
|
120
|
+
{walletName[wallet.type]?.name}
|
|
121
|
+
</OText>
|
|
123
122
|
</View>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
</View>
|
|
124
|
+
</SectionLeft>
|
|
125
|
+
|
|
126
|
+
<View style={{maxWidth: '35%', alignItems: 'flex-end' }}>
|
|
127
|
+
{wallet.type === 'cash' && (
|
|
128
|
+
<OText>
|
|
129
|
+
{parsePrice(wallet?.balance)}
|
|
130
|
+
</OText>
|
|
131
|
+
)}
|
|
132
|
+
{wallet.type === 'credit_point' && (
|
|
133
|
+
<OText>
|
|
134
|
+
<OText color={theme.colors.primary} weight='bold'>
|
|
135
|
+
{`${wallet?.balance} ${t('POINTS', 'Points')}`}
|
|
130
136
|
</OText>
|
|
131
|
-
)}
|
|
132
|
-
{wallet.type === 'credit_point' && (
|
|
133
137
|
<OText>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<OText>
|
|
138
|
-
{wallet?.balance > 0
|
|
139
|
-
? creditBalance(wallet)
|
|
140
|
-
: null}
|
|
141
|
-
</OText>
|
|
138
|
+
{wallet?.balance > 0
|
|
139
|
+
? creditBalance(wallet)
|
|
140
|
+
: null}
|
|
142
141
|
</OText>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
</
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
</OText>
|
|
143
|
+
)}
|
|
144
|
+
</View>
|
|
145
|
+
</Container>
|
|
146
|
+
))}
|
|
147
|
+
</>
|
|
148
|
+
)}
|
|
149
149
|
|
|
150
150
|
{walletsState?.loading && (
|
|
151
151
|
<View>
|