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
package/src/utils/index.tsx
CHANGED
|
@@ -47,10 +47,10 @@ export const getTraduction = (key: string, t: any) => {
|
|
|
47
47
|
*/
|
|
48
48
|
export const convertHoursToMinutes = (time: any) => {
|
|
49
49
|
const [, t] = useLanguage()
|
|
50
|
-
if (!time) return '
|
|
50
|
+
if (!time) return `0 ${t('TIME_MIN', 'min')}`
|
|
51
51
|
const [hour, minute] = time.split(':')
|
|
52
52
|
const result = (parseInt(hour, 10) * 60) + parseInt(minute, 10)
|
|
53
|
-
return `${result}${t('
|
|
53
|
+
return `${result}${t('TIME_MIN', 'min')}`
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export const getIconCard = (brand: string, size: number) => {
|
|
@@ -154,6 +154,11 @@ export const transformCountryCode = (countryCode : number) => {
|
|
|
154
154
|
return code?.countryCode
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
export const verifyCountryCode = (countryCode : string) => {
|
|
158
|
+
const code = CODES.find((code : any) => code.countryCode === (countryCode || '').toUpperCase())
|
|
159
|
+
return code?.countryCode
|
|
160
|
+
}
|
|
161
|
+
|
|
157
162
|
/**
|
|
158
163
|
* Function to check if a number is decimal or not
|
|
159
164
|
* @param {*} value number to check if decimal or not
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//Components
|
|
2
2
|
import { AcceptOrRejectOrder } from './src/components/AcceptOrRejectOrder';
|
|
3
3
|
import { BusinessController } from './src/components/BusinessController';
|
|
4
|
+
import { BusinessProductList } from './src/components/BusinessProductList';
|
|
4
5
|
import { Chat } from './src/components/Chat';
|
|
5
6
|
import { FloatingButton } from './src/components/FloatingButton';
|
|
6
7
|
import { ForgotPasswordForm } from './src/components/ForgotPasswordForm';
|
|
@@ -70,6 +71,7 @@ export {
|
|
|
70
71
|
//Components
|
|
71
72
|
AcceptOrRejectOrder,
|
|
72
73
|
BusinessController,
|
|
74
|
+
BusinessProductList,
|
|
73
75
|
Chat,
|
|
74
76
|
DriverMap,
|
|
75
77
|
FloatingButton,
|
|
@@ -7,13 +7,14 @@ import {
|
|
|
7
7
|
View,
|
|
8
8
|
KeyboardAvoidingView,
|
|
9
9
|
TextInput,
|
|
10
|
-
StyleSheet
|
|
10
|
+
StyleSheet,
|
|
11
|
+
TouchableOpacity
|
|
11
12
|
} from 'react-native';
|
|
12
13
|
import { useTheme } from 'styled-components/native';
|
|
13
14
|
import SelectDropdown from 'react-native-select-dropdown'
|
|
14
15
|
import { useLanguage } from 'ordering-components/native';
|
|
15
16
|
import { Content, Timer, TimeField, Header, Comments, CommentsButtonGroup, TopActions } from './styles';
|
|
16
|
-
import { OText, OButton, OTextarea,
|
|
17
|
+
import { OText, OButton, OTextarea, OIcon } from '../shared';
|
|
17
18
|
import { AcceptOrRejectOrderParams } from '../../types';
|
|
18
19
|
|
|
19
20
|
import { orderCommentList } from '../../../../../src/utils'
|
|
@@ -95,7 +96,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
95
96
|
upper: {
|
|
96
97
|
flex: 1,
|
|
97
98
|
zIndex: 1001,
|
|
98
|
-
paddingTop: isPage ? 30 :
|
|
99
|
+
paddingTop: isPage ? 30 : 40,
|
|
99
100
|
marginBottom: 10,
|
|
100
101
|
backgroundColor: theme.colors.backgroundPage
|
|
101
102
|
},
|
|
@@ -109,7 +110,18 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
109
110
|
bottom: {
|
|
110
111
|
textAlignVertical: "center",
|
|
111
112
|
textAlign: "center",
|
|
112
|
-
}
|
|
113
|
+
},
|
|
114
|
+
btnBackArrow: {
|
|
115
|
+
borderWidth: 0,
|
|
116
|
+
width: 32,
|
|
117
|
+
height: 32,
|
|
118
|
+
tintColor: theme.colors.textGray,
|
|
119
|
+
backgroundColor: theme.colors.clear,
|
|
120
|
+
borderColor: theme.colors.clear,
|
|
121
|
+
shadowColor: theme.colors.clear,
|
|
122
|
+
paddingLeft: 0,
|
|
123
|
+
paddingRight: 0
|
|
124
|
+
},
|
|
113
125
|
})
|
|
114
126
|
|
|
115
127
|
const handleFocus = () => {
|
|
@@ -203,7 +215,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
203
215
|
status: 7,
|
|
204
216
|
},
|
|
205
217
|
rejectByBusiness: {
|
|
206
|
-
|
|
218
|
+
reasons: comments,
|
|
207
219
|
status: 5,
|
|
208
220
|
},
|
|
209
221
|
acceptByDriver: {
|
|
@@ -211,22 +223,22 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
211
223
|
status: 8,
|
|
212
224
|
},
|
|
213
225
|
rejectByDriver: {
|
|
214
|
-
|
|
226
|
+
reasons: comments,
|
|
215
227
|
status: 6,
|
|
216
228
|
reject_reason: rejectReason
|
|
217
229
|
},
|
|
218
230
|
pickupFailedByDriver: {
|
|
219
|
-
|
|
231
|
+
reasons: comments,
|
|
220
232
|
status: 10,
|
|
221
233
|
reject_reason: rejectReason
|
|
222
234
|
},
|
|
223
235
|
deliveryFailedByDriver: {
|
|
224
|
-
|
|
236
|
+
reasons: comments,
|
|
225
237
|
status: 12,
|
|
226
238
|
reject_reason: rejectReason
|
|
227
239
|
},
|
|
228
240
|
orderNotReady: {
|
|
229
|
-
|
|
241
|
+
reasons: comments,
|
|
230
242
|
status: 14,
|
|
231
243
|
reject_reason: rejectReason
|
|
232
244
|
},
|
|
@@ -295,22 +307,17 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
295
307
|
}, [])
|
|
296
308
|
|
|
297
309
|
return (
|
|
298
|
-
<KeyboardAvoidingView
|
|
310
|
+
<KeyboardAvoidingView
|
|
311
|
+
enabled
|
|
312
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
313
|
+
style={{ flex: 1 }}
|
|
314
|
+
>
|
|
299
315
|
<View style={styles.parent}>
|
|
300
316
|
<View style={styles.upper}>
|
|
301
317
|
<TopActions>
|
|
302
|
-
<
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
iconStyle={{ width: 20, height: 20 }}
|
|
306
|
-
style={{
|
|
307
|
-
maxWidth: 40,
|
|
308
|
-
height: 35,
|
|
309
|
-
justifyContent: 'flex-end',
|
|
310
|
-
marginBottom: 10,
|
|
311
|
-
}}
|
|
312
|
-
onClick={() => handleArrowBack()}
|
|
313
|
-
/>
|
|
318
|
+
<TouchableOpacity onPress={() => handleArrowBack()} style={styles.btnBackArrow}>
|
|
319
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
320
|
+
</TouchableOpacity>
|
|
314
321
|
<OText
|
|
315
322
|
size={20}
|
|
316
323
|
color={theme.colors.textGray}
|
|
@@ -339,7 +346,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
339
346
|
)}
|
|
340
347
|
</OText>
|
|
341
348
|
|
|
342
|
-
{numberToShow ? (
|
|
349
|
+
{!!numberToShow ? (
|
|
343
350
|
<OButton
|
|
344
351
|
bgColor="transparent"
|
|
345
352
|
borderColor={theme.colors.primary}
|
|
@@ -508,7 +515,10 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
508
515
|
<View
|
|
509
516
|
style={{
|
|
510
517
|
...styles.bottomParent,
|
|
511
|
-
marginBottom:
|
|
518
|
+
marginBottom: Platform.OS === 'ios'
|
|
519
|
+
? 30 : (keyboardState.height === 0)
|
|
520
|
+
? isPage ? 0 : 30
|
|
521
|
+
: keyboardState.height - (isPage ? 20 : -10)
|
|
512
522
|
}}
|
|
513
523
|
>
|
|
514
524
|
<OButton
|
|
@@ -518,8 +528,8 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
518
528
|
imgRightSrc={null}
|
|
519
529
|
style={{ borderRadius: 7, height: 45 }}
|
|
520
530
|
parentStyle={{ width: '100%' }}
|
|
521
|
-
textStyle={{color: '#FFF', fontSize: 18 }}
|
|
522
|
-
isDisabled={
|
|
531
|
+
textStyle={{ color: '#FFF', fontSize: 18 }}
|
|
532
|
+
isDisabled={showTextArea && !comments}
|
|
523
533
|
onClick={() => handleAcceptOrReject()}
|
|
524
534
|
/>
|
|
525
535
|
</View>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { StyleSheet, View, ActivityIndicator } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, ActivityIndicator, TouchableOpacity } from 'react-native';
|
|
3
3
|
import ToggleSwitch from 'toggle-switch-react-native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import {
|
|
@@ -14,7 +14,7 @@ import { OIcon, OText } from '../shared';
|
|
|
14
14
|
import { BusinessControllerParams } from '../../types';
|
|
15
15
|
|
|
16
16
|
export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
17
|
-
const { businessState, updateBusiness, isUpdateStore, setIsUpdateStore } =
|
|
17
|
+
const { businessState, updateBusiness, isUpdateStore, setIsUpdateStore, navigation } =
|
|
18
18
|
props;
|
|
19
19
|
|
|
20
20
|
const { loading, business, error } = businessState;
|
|
@@ -93,21 +93,18 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
93
93
|
<>
|
|
94
94
|
{business && (
|
|
95
95
|
<Card key={business?.id}>
|
|
96
|
-
<View style={{
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
flexDirection: 'row',
|
|
109
|
-
alignItems: 'flex-start',
|
|
110
|
-
}}>
|
|
96
|
+
<View style={{ flexDirection: 'row', flex: 1 }}>
|
|
97
|
+
<TouchableOpacity
|
|
98
|
+
style={{ flex: 1, flexDirection: 'row', alignItems: 'center' }}
|
|
99
|
+
onPress={() => navigation && business?.slug && navigation.navigate('BusinessProductListing', { slug: business?.slug })}
|
|
100
|
+
>
|
|
101
|
+
<Logo style={styles.logo}>
|
|
102
|
+
<OIcon
|
|
103
|
+
url={optimizeImage(business?.logo, 'h_300,c_limit')}
|
|
104
|
+
src={!business?.logo && theme?.images?.dummies?.businessLogo}
|
|
105
|
+
style={styles.icon}
|
|
106
|
+
/>
|
|
107
|
+
</Logo>
|
|
111
108
|
<Information>
|
|
112
109
|
<View style={styles.header}>
|
|
113
110
|
<OText style={styles.title} numberOfLines={1}>
|
|
@@ -123,7 +120,12 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
123
120
|
{business?.zipcode}
|
|
124
121
|
</OText>
|
|
125
122
|
</Information>
|
|
123
|
+
</TouchableOpacity>
|
|
126
124
|
|
|
125
|
+
<View
|
|
126
|
+
style={{
|
|
127
|
+
alignItems: 'flex-start',
|
|
128
|
+
}}>
|
|
127
129
|
{loading && isUpdateStore ? (
|
|
128
130
|
<ActivityIndicator size="small" color={theme.colors.primary} />
|
|
129
131
|
) : (
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { OText } from "../shared"
|
|
2
|
+
import React, { useState } from "react"
|
|
3
|
+
import { View } from "react-native"
|
|
4
|
+
import { TouchableOpacity } from "react-native-gesture-handler"
|
|
5
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
6
|
+
import ToggleSwitch from 'toggle-switch-react-native';
|
|
7
|
+
import { useTheme } from 'styled-components/native';
|
|
8
|
+
import { CategoryTab } from './styles'
|
|
9
|
+
|
|
10
|
+
export const AccordionDropdown = (props: any) => {
|
|
11
|
+
const { category, IterateCategories, handlerClickCategory, updateCategory } = props
|
|
12
|
+
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
15
|
+
|
|
16
|
+
const handleSwitch = (enabled: boolean, categoryId: any) => {
|
|
17
|
+
updateCategory && updateCategory(categoryId, { enabled })
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<View style={{ marginLeft: !!category?.parent_category_id ? 10 : 0 }}>
|
|
22
|
+
<CategoryTab>
|
|
23
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', flex: 1, marginRight: 5 }}>
|
|
24
|
+
<TouchableOpacity onPress={() => setIsOpen(prev => !prev)} style={{ marginRight: 10 }}>
|
|
25
|
+
<AntDesignIcon
|
|
26
|
+
name={isOpen ? 'caretdown' : 'caretright'}
|
|
27
|
+
size={14}
|
|
28
|
+
/>
|
|
29
|
+
</TouchableOpacity>
|
|
30
|
+
<TouchableOpacity onPress={() => handlerClickCategory(category)} style={{ flex: 1 }}>
|
|
31
|
+
<OText numberOfLines={1}>
|
|
32
|
+
{category.name}
|
|
33
|
+
</OText>
|
|
34
|
+
</TouchableOpacity>
|
|
35
|
+
</View>
|
|
36
|
+
<View>
|
|
37
|
+
<ToggleSwitch
|
|
38
|
+
isOn={category?.enabled}
|
|
39
|
+
onColor={theme.colors.primary}
|
|
40
|
+
offColor={theme.colors.offColor}
|
|
41
|
+
size="small"
|
|
42
|
+
onToggle={(value: boolean) => handleSwitch(value, category.id)}
|
|
43
|
+
// disabled={loading}
|
|
44
|
+
animationSpeed={200}
|
|
45
|
+
/>
|
|
46
|
+
</View>
|
|
47
|
+
</CategoryTab>
|
|
48
|
+
{
|
|
49
|
+
isOpen && (
|
|
50
|
+
<View>
|
|
51
|
+
<IterateCategories
|
|
52
|
+
list={category.subcategories}
|
|
53
|
+
isSub
|
|
54
|
+
currentCat={category}
|
|
55
|
+
handlerClickCategory={handlerClickCategory}
|
|
56
|
+
updateCategory={updateCategory}
|
|
57
|
+
/>
|
|
58
|
+
</View>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
</View>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { View, TouchableOpacity } from "react-native"
|
|
3
|
+
import { OText } from "../shared"
|
|
4
|
+
import ToggleSwitch from 'toggle-switch-react-native';
|
|
5
|
+
import { AccordionDropdown } from './AccordionDropdown'
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import { CategoryTab } from './styles'
|
|
8
|
+
|
|
9
|
+
export const IterateCategories = (props: any) => {
|
|
10
|
+
const { list, currentCat, isSub, handlerClickCategory, updateCategory } = props
|
|
11
|
+
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
|
|
14
|
+
const handleSwitch = (enabled: boolean, categoryId: any) => {
|
|
15
|
+
updateCategory && updateCategory(categoryId, { enabled })
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
{list?.length > 0 && list.map((category: any, i: number) => (
|
|
21
|
+
<View key={`${category?.id}_${i}`}>
|
|
22
|
+
{(category?.subcategories?.length > 0 || isSub) ? (
|
|
23
|
+
<>
|
|
24
|
+
{category?.subcategories?.length > 0 && (
|
|
25
|
+
<>
|
|
26
|
+
<View>
|
|
27
|
+
<AccordionDropdown
|
|
28
|
+
category={category}
|
|
29
|
+
IterateCategories={IterateCategories}
|
|
30
|
+
handlerClickCategory={handlerClickCategory}
|
|
31
|
+
updateCategory={updateCategory}
|
|
32
|
+
/>
|
|
33
|
+
</View>
|
|
34
|
+
</>
|
|
35
|
+
)}
|
|
36
|
+
{isSub && !category?.subcategories?.length && (
|
|
37
|
+
<CategoryTab isSpace={!!category?.parent_category_id}>
|
|
38
|
+
<TouchableOpacity
|
|
39
|
+
style={{ flex: 1, marginRight: 5 }}
|
|
40
|
+
onPress={() => handlerClickCategory(category)}
|
|
41
|
+
>
|
|
42
|
+
<OText numberOfLines={1}>
|
|
43
|
+
{category.name}
|
|
44
|
+
</OText>
|
|
45
|
+
</TouchableOpacity>
|
|
46
|
+
<View>
|
|
47
|
+
<ToggleSwitch
|
|
48
|
+
isOn={category?.enabled}
|
|
49
|
+
onColor={theme.colors.primary}
|
|
50
|
+
offColor={theme.colors.offColor}
|
|
51
|
+
size="small"
|
|
52
|
+
onToggle={(value: boolean) => handleSwitch(value, category.id)}
|
|
53
|
+
// disabled={loading}
|
|
54
|
+
animationSpeed={200}
|
|
55
|
+
/>
|
|
56
|
+
</View>
|
|
57
|
+
</CategoryTab>
|
|
58
|
+
)}
|
|
59
|
+
</>
|
|
60
|
+
) : (
|
|
61
|
+
<CategoryTab
|
|
62
|
+
isSpace={!!category?.parent_category_id}
|
|
63
|
+
>
|
|
64
|
+
<TouchableOpacity onPress={() => handlerClickCategory(category)} style={{ flex: 1, marginRight: 5 }}>
|
|
65
|
+
<OText numberOfLines={1}>
|
|
66
|
+
{category.name}
|
|
67
|
+
</OText>
|
|
68
|
+
</TouchableOpacity>
|
|
69
|
+
<View>
|
|
70
|
+
<ToggleSwitch
|
|
71
|
+
isOn={category?.enabled}
|
|
72
|
+
onColor={theme.colors.primary}
|
|
73
|
+
offColor={theme.colors.offColor}
|
|
74
|
+
size="small"
|
|
75
|
+
onToggle={(value: boolean) => handleSwitch(value, category.id)}
|
|
76
|
+
// disabled={loading}
|
|
77
|
+
animationSpeed={200}
|
|
78
|
+
/>
|
|
79
|
+
</View>
|
|
80
|
+
</CategoryTab>
|
|
81
|
+
)}
|
|
82
|
+
</View>
|
|
83
|
+
))}
|
|
84
|
+
{list && list?.length === 0 && isSub && (
|
|
85
|
+
<CategoryTab
|
|
86
|
+
isSpace={!!currentCat?.parent_category_id}
|
|
87
|
+
>
|
|
88
|
+
<TouchableOpacity onPress={() => handlerClickCategory(currentCat)} style={{ flex: 1, marginRight: 5 }}>
|
|
89
|
+
<OText numberOfLines={1}>
|
|
90
|
+
{currentCat.name}
|
|
91
|
+
</OText>
|
|
92
|
+
</TouchableOpacity>
|
|
93
|
+
<View>
|
|
94
|
+
<ToggleSwitch
|
|
95
|
+
isOn={currentCat?.enabled}
|
|
96
|
+
onColor={theme.colors.primary}
|
|
97
|
+
offColor={theme.colors.offColor}
|
|
98
|
+
size="small"
|
|
99
|
+
onToggle={(value: boolean) => handleSwitch(value, currentCat.id)}
|
|
100
|
+
// disabled={loading}
|
|
101
|
+
animationSpeed={200}
|
|
102
|
+
/>
|
|
103
|
+
</View>
|
|
104
|
+
</CategoryTab>
|
|
105
|
+
)}
|
|
106
|
+
</>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React, { useCallback } from 'react'
|
|
2
|
+
import { StyleSheet, View, TouchableOpacity } from 'react-native'
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import { OIcon, OText } from '../shared';
|
|
5
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
6
|
+
import ToggleSwitch from 'toggle-switch-react-native';
|
|
7
|
+
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
8
|
+
import { SearchBar } from '../SearchBar';
|
|
9
|
+
import { IOScrollView } from 'react-native-intersection-observer';
|
|
10
|
+
import {
|
|
11
|
+
useLanguage,
|
|
12
|
+
useUtils,
|
|
13
|
+
ToastType,
|
|
14
|
+
useToast,
|
|
15
|
+
} from 'ordering-components/native'
|
|
16
|
+
|
|
17
|
+
const PIXELS_TO_SCROLL = 2000
|
|
18
|
+
|
|
19
|
+
export const ProductList = (props: any) => {
|
|
20
|
+
const { productsList, onClose, updateProduct, searchValue, handleChangeSearch, getCategoryProducts } = props
|
|
21
|
+
|
|
22
|
+
const { loading, products, error } = productsList
|
|
23
|
+
|
|
24
|
+
const theme = useTheme()
|
|
25
|
+
const [{ optimizeImage }] = useUtils();
|
|
26
|
+
const [, { showToast }] = useToast()
|
|
27
|
+
const [, t] = useLanguage()
|
|
28
|
+
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
container: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
marginBottom: 0
|
|
33
|
+
},
|
|
34
|
+
header: {
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
justifyContent: 'space-between',
|
|
37
|
+
marginBottom: 10,
|
|
38
|
+
},
|
|
39
|
+
btnBackArrow: {
|
|
40
|
+
borderWidth: 0,
|
|
41
|
+
width: 32,
|
|
42
|
+
height: 32,
|
|
43
|
+
tintColor: theme.colors.textGray,
|
|
44
|
+
backgroundColor: theme.colors.clear,
|
|
45
|
+
borderColor: theme.colors.clear,
|
|
46
|
+
shadowColor: theme.colors.clear,
|
|
47
|
+
paddingLeft: 0,
|
|
48
|
+
paddingRight: 0
|
|
49
|
+
},
|
|
50
|
+
sectionTitle: {
|
|
51
|
+
fontStyle: 'normal',
|
|
52
|
+
fontWeight: '600',
|
|
53
|
+
fontSize: 20,
|
|
54
|
+
color: theme.colors.textGray,
|
|
55
|
+
},
|
|
56
|
+
logo: {
|
|
57
|
+
padding: 2,
|
|
58
|
+
borderRadius: 18,
|
|
59
|
+
shadowColor: '#000',
|
|
60
|
+
shadowOffset: {
|
|
61
|
+
width: 0,
|
|
62
|
+
height: 1.5,
|
|
63
|
+
},
|
|
64
|
+
shadowOpacity: 0.21,
|
|
65
|
+
shadowRadius: 3,
|
|
66
|
+
elevation: 7,
|
|
67
|
+
},
|
|
68
|
+
icon: {
|
|
69
|
+
borderRadius: 7.6,
|
|
70
|
+
width: 35,
|
|
71
|
+
height: 35,
|
|
72
|
+
marginRight: 5
|
|
73
|
+
},
|
|
74
|
+
borderStyle: {
|
|
75
|
+
borderColor: theme.colors.red,
|
|
76
|
+
borderWidth: 0,
|
|
77
|
+
borderRadius: 10,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const handleSwitch = (enabled: boolean, categoryId: any, productId: any) => {
|
|
82
|
+
updateProduct && updateProduct(categoryId, productId, { enabled })
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const handleScroll = ({ nativeEvent }: any) => {
|
|
86
|
+
const y = nativeEvent.contentOffset.y;
|
|
87
|
+
const height = nativeEvent.contentSize.height;
|
|
88
|
+
const hasMore = !(
|
|
89
|
+
productsList.pagination.totalPages === productsList.pagination.currentPage
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
if (y + PIXELS_TO_SCROLL > height && !productsList.loading && hasMore && productsList?.products?.length > 0) {
|
|
93
|
+
getCategoryProducts(false)
|
|
94
|
+
showToast(ToastType.Info, t('LOADING_MORE_PRODUCTS', 'Loading more products'))
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<View style={{ flex: 1, paddingHorizontal: 20, paddingVertical: 20 }}>
|
|
100
|
+
<View style={styles.header}>
|
|
101
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
102
|
+
<TouchableOpacity
|
|
103
|
+
onPress={onClose}
|
|
104
|
+
style={styles.btnBackArrow}
|
|
105
|
+
>
|
|
106
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
107
|
+
</TouchableOpacity>
|
|
108
|
+
<OText style={styles.sectionTitle}>{t('PRODUCTS', 'Products')}</OText>
|
|
109
|
+
</View>
|
|
110
|
+
<View style={{ flexDirection: 'row', justifyContent: 'flex-end' }}>
|
|
111
|
+
<SearchBar
|
|
112
|
+
borderStyle={styles.borderStyle}
|
|
113
|
+
onSearch={handleChangeSearch}
|
|
114
|
+
searchValue={searchValue}
|
|
115
|
+
lazyLoad
|
|
116
|
+
isCancelXButtonShow={!!searchValue}
|
|
117
|
+
onCancel={() => handleChangeSearch('')}
|
|
118
|
+
placeholder={t('SEARCH', 'Search')}
|
|
119
|
+
containerStyle={{ width: 180 }}
|
|
120
|
+
/>
|
|
121
|
+
</View>
|
|
122
|
+
</View>
|
|
123
|
+
<IOScrollView
|
|
124
|
+
style={styles.container}
|
|
125
|
+
onScroll={handleScroll}
|
|
126
|
+
scrollEventThrottle={16}
|
|
127
|
+
bounces={false}
|
|
128
|
+
>
|
|
129
|
+
{!loading && products?.length === 0 && (
|
|
130
|
+
<NotFoundSource
|
|
131
|
+
content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
|
|
132
|
+
image={theme.images.general.notFound}
|
|
133
|
+
conditioned={false}
|
|
134
|
+
/>
|
|
135
|
+
)}
|
|
136
|
+
{!loading && products?.length > 0 && (
|
|
137
|
+
<View style={{ borderTopColor: theme.colors.borderTops, borderTopWidth: 1 }}>
|
|
138
|
+
{products.map((product: any, i: number) => (
|
|
139
|
+
<View
|
|
140
|
+
key={i}
|
|
141
|
+
style={{
|
|
142
|
+
flexDirection: 'row',
|
|
143
|
+
justifyContent: 'space-between',
|
|
144
|
+
borderBottomColor: theme.colors.borderTops,
|
|
145
|
+
borderBottomWidth: 1,
|
|
146
|
+
paddingVertical: 15
|
|
147
|
+
}}
|
|
148
|
+
>
|
|
149
|
+
<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center', marginRight: 36 }}>
|
|
150
|
+
<OIcon
|
|
151
|
+
url={optimizeImage(product?.images, 'h_300,c_limit')}
|
|
152
|
+
src={!product?.images && theme?.images?.dummies?.businessLogo}
|
|
153
|
+
style={styles.icon}
|
|
154
|
+
/>
|
|
155
|
+
<OText numberOfLines={2} size={12} ellipsizeMode='tail'>{product?.name}</OText>
|
|
156
|
+
</View>
|
|
157
|
+
<ToggleSwitch
|
|
158
|
+
isOn={product?.enabled}
|
|
159
|
+
onColor={theme.colors.primary}
|
|
160
|
+
offColor={theme.colors.offColor}
|
|
161
|
+
size="small"
|
|
162
|
+
onToggle={(value: boolean) => handleSwitch(value, product?.category_id, product.id)}
|
|
163
|
+
disabled={loading}
|
|
164
|
+
animationSpeed={200}
|
|
165
|
+
/>
|
|
166
|
+
</View>
|
|
167
|
+
))}
|
|
168
|
+
</View>
|
|
169
|
+
)}
|
|
170
|
+
{loading && (
|
|
171
|
+
<View style={{ borderTopColor: theme.colors.borderTops, borderTopWidth: 1 }}>
|
|
172
|
+
{[...Array(6)].map((item, i) => (
|
|
173
|
+
<Placeholder key={i} Animation={Fade}>
|
|
174
|
+
<View
|
|
175
|
+
style={{
|
|
176
|
+
flex: 1,
|
|
177
|
+
flexDirection: 'row',
|
|
178
|
+
justifyContent: 'space-between',
|
|
179
|
+
alignItems: 'center',
|
|
180
|
+
marginBottom: 10,
|
|
181
|
+
borderBottomColor: theme.colors.borderTops,
|
|
182
|
+
borderBottomWidth: 1,
|
|
183
|
+
paddingVertical: 10
|
|
184
|
+
}}
|
|
185
|
+
>
|
|
186
|
+
<PlaceholderLine width={50} />
|
|
187
|
+
<PlaceholderLine width={20} />
|
|
188
|
+
</View>
|
|
189
|
+
</Placeholder>
|
|
190
|
+
))}
|
|
191
|
+
</View>
|
|
192
|
+
)}
|
|
193
|
+
</IOScrollView>
|
|
194
|
+
</View>
|
|
195
|
+
)
|
|
196
|
+
}
|