ordering-ui-react-native 0.17.98 → 0.17.99-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 +0 -1
- 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 +209 -15
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +87 -66
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +19 -18
- 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 +60 -47
- 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 +198 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- 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 +24 -10
- package/themes/business/src/utils/index.tsx +29 -2
- 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/AddressList/index.tsx +5 -8
- 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 +72 -36
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- 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/BusinessItemAccordion/index.tsx +21 -23
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +346 -340
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- 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 +1 -2
- 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 +137 -32
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- 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/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/Checkout/index.tsx +323 -42
- package/themes/original/src/components/CitiesControl/index.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 +12 -4
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- 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 +2 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- 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/Home/index.tsx +13 -4
- 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/MomentOption/index.tsx +44 -39
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +346 -68
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +12 -1
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +50 -38
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- 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/OrderSummary/index.tsx +62 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
- package/themes/original/src/components/OrdersOption/index.tsx +43 -20
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- 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/index.tsx +65 -34
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -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/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +40 -20
- 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/index.tsx +3 -8
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +84 -19
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +7 -25
- 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/Wallets/index.tsx +51 -61
- package/themes/original/src/components/Wallets/styles.tsx +2 -4
- 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 +3 -3
- package/themes/original/src/types/index.tsx +30 -7
- 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
|
@@ -3,6 +3,7 @@ import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity, Platform } f
|
|
|
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'
|
|
6
|
+
import NavBar from '../NavBar'
|
|
6
7
|
import {
|
|
7
8
|
WalletList,
|
|
8
9
|
useLanguage,
|
|
@@ -72,7 +73,7 @@ const WalletsUI = (props: any) => {
|
|
|
72
73
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
73
74
|
const [openHistory, setOpenHistory] = useState(false)
|
|
74
75
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
75
|
-
const hideWalletsTheme = theme?.bar_menu?.components?.
|
|
76
|
+
const hideWalletsTheme = theme?.bar_menu?.components?.wallet?.hidden === true
|
|
76
77
|
|
|
77
78
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
78
79
|
|
|
@@ -119,60 +120,42 @@ const WalletsUI = (props: any) => {
|
|
|
119
120
|
|
|
120
121
|
return (
|
|
121
122
|
<>
|
|
122
|
-
<Container
|
|
123
|
+
<Container
|
|
124
|
+
pdng={Platform.OS === 'ios' ? '10px' : '0'}
|
|
125
|
+
>
|
|
123
126
|
<Header>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
<View style={{
|
|
128
|
+
...{
|
|
129
|
+
width: '100%',
|
|
130
|
+
display: 'flex',
|
|
131
|
+
flexDirection: !hideWalletsTheme ? 'column' : 'row',
|
|
132
|
+
justifyContent: !hideWalletsTheme ? 'flex-start' : 'space-between',
|
|
133
|
+
alignItems: !hideWalletsTheme ? 'flex-start' : 'center',
|
|
134
|
+
marginTop: !hideWalletsTheme ? 0 : 10,
|
|
135
|
+
},
|
|
136
|
+
}}>
|
|
137
|
+
<NavBar
|
|
138
|
+
title={t('WALLETS', 'Wallets')}
|
|
139
|
+
titleAlign={'center'}
|
|
140
|
+
onActionLeft={goToBack}
|
|
141
|
+
showCall={false}
|
|
142
|
+
paddingTop={10}
|
|
143
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
144
|
+
isVertical={!hideWalletsTheme}
|
|
145
|
+
hideArrowLeft={!hideWalletsTheme}
|
|
146
|
+
/>
|
|
147
|
+
{isChewLayout && !openHistory && (
|
|
133
148
|
<OButton
|
|
134
|
-
|
|
149
|
+
text={t('WALLET_HISTORY', 'Wallet history')}
|
|
150
|
+
bgColor={theme.colors.white}
|
|
151
|
+
borderColor={theme.colors.lightGray}
|
|
135
152
|
imgRightSrc={null}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
height: 26,
|
|
140
|
-
backgroundColor: '#FFF',
|
|
141
|
-
borderColor: '#FFF',
|
|
142
|
-
shadowColor: '#FFF',
|
|
143
|
-
paddingLeft: 0,
|
|
144
|
-
paddingRight: 0,
|
|
145
|
-
marginTop: 30,
|
|
146
|
-
}}
|
|
147
|
-
onClick={goToBack}
|
|
148
|
-
icon={AntDesignIcon}
|
|
149
|
-
iconProps={{
|
|
150
|
-
name: 'arrowleft',
|
|
151
|
-
size: 26
|
|
152
|
-
}}
|
|
153
|
+
textStyle={{ fontSize: 12, color: theme.colors.disabled }}
|
|
154
|
+
onClick={() => setOpenHistory(true)}
|
|
155
|
+
style={{ borderRadius: 8, height: 40, width: !hideWalletsTheme ? '100%' : 150, marginTop: !hideWalletsTheme ? 10 : 0 }}
|
|
153
156
|
/>
|
|
154
157
|
)}
|
|
155
|
-
|
|
156
|
-
size={20}
|
|
157
|
-
style={{
|
|
158
|
-
marginTop: 30,
|
|
159
|
-
marginLeft: (!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout ? 10 : 0,
|
|
160
|
-
color: theme.colors.textNormal,
|
|
161
|
-
}}
|
|
162
|
-
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
163
|
-
>{t('WALLETS', 'Wallets')}</OText>
|
|
164
|
-
</View>
|
|
165
|
-
{isChewLayout && (
|
|
166
|
-
<OButton
|
|
167
|
-
text={t('WALLET_HISTORY', 'Wallet history')}
|
|
168
|
-
bgColor={theme.colors.white}
|
|
169
|
-
borderColor={theme.colors.lightGray}
|
|
170
|
-
imgRightSrc={null}
|
|
171
|
-
textStyle={{ fontSize: 12, color: theme.colors.disabled }}
|
|
172
|
-
onClick={() => setOpenHistory(true)}
|
|
173
|
-
style={{ borderRadius: 8, height: 40 }}
|
|
174
|
-
/>
|
|
175
|
-
)}
|
|
158
|
+
</View>
|
|
176
159
|
</Header>
|
|
177
160
|
|
|
178
161
|
{!walletList.loading &&
|
|
@@ -213,9 +196,9 @@ const WalletsUI = (props: any) => {
|
|
|
213
196
|
<LoyaltyContent>
|
|
214
197
|
<LoyaltyWrapp>
|
|
215
198
|
<OText size={20}>
|
|
216
|
-
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}
|
|
199
|
+
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}`}
|
|
217
200
|
</OText>
|
|
218
|
-
{
|
|
201
|
+
{loyaltyLevel.image ? (
|
|
219
202
|
<FastImage
|
|
220
203
|
style={styles.logoStyle}
|
|
221
204
|
source={{
|
|
@@ -230,7 +213,7 @@ const WalletsUI = (props: any) => {
|
|
|
230
213
|
source={theme.images.dummies.loyaltyLevel}
|
|
231
214
|
resizeMode='contain'
|
|
232
215
|
/>
|
|
233
|
-
)}
|
|
216
|
+
)}
|
|
234
217
|
<OText
|
|
235
218
|
size={22}
|
|
236
219
|
weight='bold'
|
|
@@ -256,9 +239,13 @@ const WalletsUI = (props: any) => {
|
|
|
256
239
|
</OText>
|
|
257
240
|
</BalanceElement>
|
|
258
241
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
242
|
+
{currentWalletSelected?.type === 'cash' && (
|
|
243
|
+
<>
|
|
244
|
+
<View style={styles.dividerStyle} />
|
|
245
|
+
<GiftCardUI navigation={navigation} />
|
|
246
|
+
<View style={styles.dividerStyle} />
|
|
247
|
+
</>
|
|
248
|
+
)}
|
|
262
249
|
|
|
263
250
|
{!isChewLayout && (
|
|
264
251
|
<WalletTransactions
|
|
@@ -313,15 +300,18 @@ const WalletsUI = (props: any) => {
|
|
|
313
300
|
<ScrollView>
|
|
314
301
|
<WalletTransactionsWrapper>
|
|
315
302
|
<OButton
|
|
303
|
+
imgLeftStyle={{ width: 18 }}
|
|
316
304
|
imgRightSrc={null}
|
|
317
305
|
style={{
|
|
318
306
|
borderWidth: 0,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
307
|
+
width: 26,
|
|
308
|
+
height: 26,
|
|
309
|
+
backgroundColor: '#FFF',
|
|
310
|
+
borderColor: '#FFF',
|
|
311
|
+
shadowColor: '#FFF',
|
|
323
312
|
paddingLeft: 0,
|
|
324
|
-
paddingRight: 0
|
|
313
|
+
paddingRight: 0,
|
|
314
|
+
marginBottom: 10
|
|
325
315
|
}}
|
|
326
316
|
onClick={() => setOpenHistory(false)}
|
|
327
317
|
icon={AntDesignIcon}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
3
|
export const Container = styled.View`
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
padding-bottom: 20px;
|
|
5
|
+
padding-top: ${(props: any) => props.pdng};
|
|
6
6
|
`
|
|
7
7
|
export const Header = styled.View`
|
|
8
8
|
flex-direction: row;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: space-between;
|
|
11
9
|
`
|
|
12
10
|
export const SectionContent = styled.View`
|
|
13
11
|
width: 100%;
|
|
@@ -27,8 +27,8 @@ const StyledButton = styled.View<Props>`
|
|
|
27
27
|
padding-left: 20px;
|
|
28
28
|
padding-right: 20px;
|
|
29
29
|
position: relative;
|
|
30
|
-
${(props
|
|
31
|
-
border-radius: ${props?.theme?.general?.components?.buttons?.borderRadius};
|
|
30
|
+
${(props: any) => props?.theme?.general?.components?.buttons?.borderRadius && css`
|
|
31
|
+
border-radius: ${props?.theme?.general?.components?.buttons?.borderRadius}px;
|
|
32
32
|
`}
|
|
33
33
|
`
|
|
34
34
|
const StyledButtonDisabled = styled(StyledButton)`
|
|
@@ -119,7 +119,7 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
119
119
|
style={{ width: props.isCircle ? 52 : props.style?.width, ...props.parentStyle }}
|
|
120
120
|
disabled={props.isDisabledWithSameStyles}
|
|
121
121
|
>
|
|
122
|
-
<StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
|
|
122
|
+
<StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius } : { ...props.style, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius }}>
|
|
123
123
|
{props.icon ? (
|
|
124
124
|
<props.icon {...props.iconProps} />
|
|
125
125
|
) : null}
|
|
@@ -3,7 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
|
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
4
|
import OIcon from './OIcon';
|
|
5
5
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
6
|
-
import { useTheme
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
7
7
|
|
|
8
8
|
const Input = styled.TextInput`
|
|
9
9
|
flex-grow: 1;
|
|
@@ -53,9 +53,6 @@ const Wrapper = styled.Pressable`
|
|
|
53
53
|
align-items: center;
|
|
54
54
|
justify-content: center;
|
|
55
55
|
width: 100%;
|
|
56
|
-
${(props: any) => props.theme?.general?.components?.inputs?.borderRadius && css`
|
|
57
|
-
border-radius: ${props?.theme?.general?.components?.inputs?.borderRadius};
|
|
58
|
-
`}
|
|
59
56
|
`;
|
|
60
57
|
|
|
61
58
|
const OInput = (props: Props): React.ReactElement => {
|
|
@@ -104,7 +101,9 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
104
101
|
props.forwardRef && (props.forwardRef.current = e)
|
|
105
102
|
}}
|
|
106
103
|
style={{
|
|
107
|
-
|
|
104
|
+
...(theme?.general?.components?.inputs?.color && {
|
|
105
|
+
color: theme?.general?.components?.inputs?.color
|
|
106
|
+
}),
|
|
108
107
|
...props?.inputStyle
|
|
109
108
|
}}
|
|
110
109
|
onFocus={() => setInputFocused(true)}
|
|
@@ -52,7 +52,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
52
52
|
|
|
53
53
|
const theme = useTheme();
|
|
54
54
|
|
|
55
|
-
const
|
|
55
|
+
const renderSafeAreaView = () => (
|
|
56
56
|
<SafeAreaView style={styles.container}>
|
|
57
57
|
{!entireModal ? (
|
|
58
58
|
<View style={styles.centeredView}>
|
|
@@ -101,10 +101,10 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
101
101
|
enabled
|
|
102
102
|
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
103
103
|
>
|
|
104
|
-
|
|
104
|
+
{renderSafeAreaView()}
|
|
105
105
|
</KeyboardView>
|
|
106
106
|
) : (
|
|
107
|
-
|
|
107
|
+
renderSafeAreaView()
|
|
108
108
|
)}
|
|
109
109
|
</Modal>
|
|
110
110
|
);
|
|
@@ -19,6 +19,7 @@ export interface LoginParams {
|
|
|
19
19
|
notificationState?: any;
|
|
20
20
|
handleReCaptcha?: any;
|
|
21
21
|
enableReCaptcha?: any;
|
|
22
|
+
isGuest?: any;
|
|
22
23
|
otpType?: string,
|
|
23
24
|
setOtpType: (type: string) => void,
|
|
24
25
|
generateOtpCode: (values?: any) => void,
|
|
@@ -91,7 +92,8 @@ export interface AddressFormParams {
|
|
|
91
92
|
hasAddressDefault?: any,
|
|
92
93
|
isFromCheckout?: boolean
|
|
93
94
|
afterSignup?: boolean
|
|
94
|
-
isGuestFromStore?: boolean
|
|
95
|
+
isGuestFromStore?: boolean,
|
|
96
|
+
businessSlug?: number | string
|
|
95
97
|
}
|
|
96
98
|
export interface SignupParams {
|
|
97
99
|
navigation?: any;
|
|
@@ -145,6 +147,7 @@ export interface PhoneInputParams {
|
|
|
145
147
|
isDisabled?: any;
|
|
146
148
|
isStartValidation?: any;
|
|
147
149
|
changeCountry?: any;
|
|
150
|
+
updateStateWithSubmit?: boolean
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
export interface LanguageSelectorParams {
|
|
@@ -253,6 +256,8 @@ export interface BusinessProductsListingParams {
|
|
|
253
256
|
handleUpdateProfessionals?: any;
|
|
254
257
|
onBusinessClick?: any;
|
|
255
258
|
onNavigationRedirect?: any;
|
|
259
|
+
businessSingleId?: number | string
|
|
260
|
+
fromMulti?: boolean
|
|
256
261
|
}
|
|
257
262
|
export interface BusinessBasicInformationParams {
|
|
258
263
|
navigation?: any;
|
|
@@ -304,6 +309,7 @@ export interface BusinessProductsListParams {
|
|
|
304
309
|
handleUpdateProducts?: any,
|
|
305
310
|
navigation?: any;
|
|
306
311
|
previouslyProducts?: any;
|
|
312
|
+
businessSingleId?: number | string
|
|
307
313
|
}
|
|
308
314
|
export interface SingleProductCardParams {
|
|
309
315
|
businessId: any;
|
|
@@ -320,6 +326,7 @@ export interface SingleProductCardParams {
|
|
|
320
326
|
isPreviously?: any;
|
|
321
327
|
isProductId?: any;
|
|
322
328
|
viewString?: string;
|
|
329
|
+
businessSingleId?: number
|
|
323
330
|
}
|
|
324
331
|
export interface BusinessInformationParams {
|
|
325
332
|
navigation?: any,
|
|
@@ -348,6 +355,8 @@ export interface NotFoundSourceParams {
|
|
|
348
355
|
conditioned?: boolean,
|
|
349
356
|
onClickButton?: any,
|
|
350
357
|
children?: any
|
|
358
|
+
hideImage?: any
|
|
359
|
+
btnStyle?: any
|
|
351
360
|
}
|
|
352
361
|
export interface OrdersOptionParams {
|
|
353
362
|
orderList?: any,
|
|
@@ -366,8 +375,8 @@ export interface OrdersOptionParams {
|
|
|
366
375
|
preOrders?: boolean,
|
|
367
376
|
reorderState?: any,
|
|
368
377
|
handleReorder?: (orderId: number) => {},
|
|
369
|
-
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
|
|
370
|
-
ordersLength: { activeOrdersLength: number, previousOrdersLength: number },
|
|
378
|
+
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength, preordersLength }: { activeOrdersLength: number, previousOrdersLength: number, preordersLength: number }) => void,
|
|
379
|
+
ordersLength: { activeOrdersLength: number, previousOrdersLength: number, preordersLength: number },
|
|
371
380
|
setSelectedOrderId?: any,
|
|
372
381
|
setOpenMessges?: any,
|
|
373
382
|
loadMoreStatus?: boolean,
|
|
@@ -385,6 +394,7 @@ export interface OrdersOptionParams {
|
|
|
385
394
|
BusinessControllerSkeletons?: any,
|
|
386
395
|
businessPaginationProps?: any,
|
|
387
396
|
businesses?: any
|
|
397
|
+
businessId?: any;
|
|
388
398
|
}
|
|
389
399
|
export interface ActiveOrdersParams {
|
|
390
400
|
orders?: any,
|
|
@@ -428,6 +438,7 @@ export interface OrderDetailsParams {
|
|
|
428
438
|
onNavigationRedirect?: any,
|
|
429
439
|
reorderState?: any,
|
|
430
440
|
handleReorder?: any,
|
|
441
|
+
hideViaText?: boolean,
|
|
431
442
|
}
|
|
432
443
|
export interface ProductItemAccordionParams {
|
|
433
444
|
key?: any;
|
|
@@ -570,6 +581,9 @@ export interface BusinessPreorderParams {
|
|
|
570
581
|
goToBack: any;
|
|
571
582
|
business: any;
|
|
572
583
|
handleBusinessClick: (value: any) => {};
|
|
584
|
+
getActualSchedule?: any;
|
|
585
|
+
cateringPreorder?: boolean;
|
|
586
|
+
preorderLeadTime?: number
|
|
573
587
|
}
|
|
574
588
|
export interface BusinessMenuListParams {
|
|
575
589
|
menu: any;
|
|
@@ -619,7 +633,10 @@ export interface GoogleMapsParams {
|
|
|
619
633
|
isSetInputs?: boolean,
|
|
620
634
|
locations?: Array<any>,
|
|
621
635
|
setSaveLocation?: (val: boolean) => void,
|
|
622
|
-
handleToggleMap?: () => void
|
|
636
|
+
handleToggleMap?: () => void,
|
|
637
|
+
isIntGeoCoder: boolean,
|
|
638
|
+
businessZones?: any
|
|
639
|
+
delta?: number
|
|
623
640
|
}
|
|
624
641
|
|
|
625
642
|
export interface HelpParams {
|
|
@@ -715,6 +732,10 @@ export interface otpParams {
|
|
|
715
732
|
handleLoginOtp: (code: string) => void,
|
|
716
733
|
setAlertState: any;
|
|
717
734
|
pinCount: number;
|
|
735
|
+
otpError: any,
|
|
736
|
+
setOtpError: any
|
|
737
|
+
isCheckingCode: boolean
|
|
738
|
+
setCheckingCode: (value: boolean) => void
|
|
718
739
|
}
|
|
719
740
|
|
|
720
741
|
export interface FavoriteParams {
|
|
@@ -741,7 +762,7 @@ export interface SingleOrderCardParams {
|
|
|
741
762
|
pastOrders: any,
|
|
742
763
|
isMessageView?: any,
|
|
743
764
|
handleClickOrder: (value: any) => {},
|
|
744
|
-
handleRemoveCart: () => {},
|
|
765
|
+
handleRemoveCart: (value: any) => {},
|
|
745
766
|
cartState: any
|
|
746
767
|
}
|
|
747
768
|
|
|
@@ -778,7 +799,8 @@ export interface ServiceFormParams {
|
|
|
778
799
|
export interface ProfessionalFilterParams {
|
|
779
800
|
professionals?: any,
|
|
780
801
|
professionalSelected?: any,
|
|
781
|
-
handleChangeProfessionalSelected: any
|
|
802
|
+
handleChangeProfessionalSelected: any,
|
|
803
|
+
handleUpdateProfessionals?: any
|
|
782
804
|
}
|
|
783
805
|
|
|
784
806
|
export interface ProfessionalProfileParams {
|
|
@@ -795,7 +817,8 @@ export interface OrderItAgainParams {
|
|
|
795
817
|
currentCart: any,
|
|
796
818
|
handleUpdateProducts: any,
|
|
797
819
|
navigation: any,
|
|
798
|
-
searchValue?: string
|
|
820
|
+
searchValue?: string,
|
|
821
|
+
businessSingleId?: number | string
|
|
799
822
|
}
|
|
800
823
|
|
|
801
824
|
export interface PreviousProductsOrderedParams {
|
|
@@ -4,6 +4,7 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
|
4
4
|
import { CODES } from 'ordering-components/native'
|
|
5
5
|
import { ORDER_TYPES } from '../config/constants';
|
|
6
6
|
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
7
8
|
|
|
8
9
|
const [languageState, t] = useLanguage();
|
|
9
10
|
const theme = useTheme()
|
|
@@ -271,6 +272,11 @@ export const transformCountryCode = (countryCode: number) => {
|
|
|
271
272
|
return code?.countryCode
|
|
272
273
|
}
|
|
273
274
|
|
|
275
|
+
export const findExitingCode = (countryCode: string) => {
|
|
276
|
+
const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
|
|
277
|
+
return code?.countryCode
|
|
278
|
+
}
|
|
279
|
+
|
|
274
280
|
/**
|
|
275
281
|
* Function to check if a number is decimal or not
|
|
276
282
|
* @param {*} value number to check if decimal or not
|
|
@@ -378,7 +384,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
378
384
|
key: 0,
|
|
379
385
|
value: t('PENDING', 'Pending'),
|
|
380
386
|
slug: 'PENDING',
|
|
381
|
-
percentage: 0.
|
|
387
|
+
percentage: 0.1,
|
|
382
388
|
image: theme.images.order.status0,
|
|
383
389
|
},
|
|
384
390
|
{
|
|
@@ -406,7 +412,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
406
412
|
key: 4,
|
|
407
413
|
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
408
414
|
slug: 'PREPARATION_COMPLETED',
|
|
409
|
-
percentage: 0.
|
|
415
|
+
percentage: 0.2,
|
|
410
416
|
image: theme.images.order.status4,
|
|
411
417
|
},
|
|
412
418
|
{
|
|
@@ -427,21 +433,21 @@ export const getOrderStatus = (s: string) => {
|
|
|
427
433
|
key: 7,
|
|
428
434
|
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
429
435
|
slug: 'ACCEPTED_BY_BUSINESS',
|
|
430
|
-
percentage: 0.
|
|
436
|
+
percentage: 0.15,
|
|
431
437
|
image: theme.images.order.status7,
|
|
432
438
|
},
|
|
433
439
|
{
|
|
434
440
|
key: 8,
|
|
435
441
|
value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
|
|
436
442
|
slug: 'ACCEPTED_BY_DRIVER',
|
|
437
|
-
percentage: 0.
|
|
443
|
+
percentage: 0.4,
|
|
438
444
|
image: theme.images.order.status8,
|
|
439
445
|
},
|
|
440
446
|
{
|
|
441
447
|
key: 9,
|
|
442
448
|
value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
|
|
443
449
|
slug: 'PICK_UP_COMPLETED_BY_DRIVER',
|
|
444
|
-
percentage: 0.
|
|
450
|
+
percentage: 0.7,
|
|
445
451
|
image: theme.images.order.status9,
|
|
446
452
|
},
|
|
447
453
|
{
|
|
@@ -479,7 +485,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
479
485
|
key: 14,
|
|
480
486
|
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
481
487
|
slug: 'ORDER_NOT_READY',
|
|
482
|
-
percentage: 0,
|
|
488
|
+
percentage: 0.15,
|
|
483
489
|
image: theme.images.order.status13,
|
|
484
490
|
},
|
|
485
491
|
{
|
|
@@ -489,7 +495,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
489
495
|
'Order picked up completed by customer',
|
|
490
496
|
),
|
|
491
497
|
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
492
|
-
percentage:
|
|
498
|
+
percentage: 1,
|
|
493
499
|
image: theme.images.order.status1,
|
|
494
500
|
},
|
|
495
501
|
{
|
|
@@ -516,7 +522,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
516
522
|
'Driver almost arrived to business',
|
|
517
523
|
),
|
|
518
524
|
slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
519
|
-
percentage: 0.
|
|
525
|
+
percentage: 0.5,
|
|
520
526
|
image: theme.images.order.status3,
|
|
521
527
|
},
|
|
522
528
|
{
|
|
@@ -536,7 +542,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
536
542
|
'Customer almost arrived to business',
|
|
537
543
|
),
|
|
538
544
|
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
539
|
-
percentage:
|
|
545
|
+
percentage: 0.9,
|
|
540
546
|
image: theme.images.order.status7,
|
|
541
547
|
},
|
|
542
548
|
{
|
|
@@ -546,26 +552,187 @@ export const getOrderStatus = (s: string) => {
|
|
|
546
552
|
'Customer arrived to business',
|
|
547
553
|
),
|
|
548
554
|
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
549
|
-
percentage:
|
|
555
|
+
percentage: 0.9,
|
|
550
556
|
image: theme.images.order.status7,
|
|
551
557
|
},
|
|
552
558
|
{
|
|
553
559
|
key: 22,
|
|
554
560
|
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
555
561
|
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
556
|
-
percentage:
|
|
562
|
+
percentage: 0.3,
|
|
557
563
|
image: theme.images.order.status8
|
|
558
564
|
},
|
|
559
565
|
{
|
|
560
566
|
key: 23,
|
|
561
567
|
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
562
568
|
slug: 'ORDER_DRIVER_ON_WAY',
|
|
563
|
-
percentage:
|
|
569
|
+
percentage: 0.8,
|
|
564
570
|
image: theme.images.order.status8
|
|
565
571
|
}
|
|
566
572
|
];
|
|
567
|
-
|
|
573
|
+
|
|
574
|
+
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
575
|
+
|
|
576
|
+
return objectStatus && objectStatus;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export const getOrderStatuPickUp = (s: any) => {
|
|
580
|
+
const status = parseInt(s);
|
|
581
|
+
const orderStatus = [
|
|
582
|
+
{
|
|
583
|
+
key: 0,
|
|
584
|
+
value: t('PENDING', 'Pending'),
|
|
585
|
+
slug: 'PENDING',
|
|
586
|
+
percentage: 0.1,
|
|
587
|
+
image: theme.images.order.status0,
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
key: 1,
|
|
591
|
+
value: t('COMPLETED', 'Completed'),
|
|
592
|
+
slug: 'COMPLETED',
|
|
593
|
+
percentage: 1,
|
|
594
|
+
image: theme.images.order.status1,
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
key: 2,
|
|
598
|
+
value: t('REJECTED', 'Rejected'),
|
|
599
|
+
slug: 'REJECTED',
|
|
600
|
+
percentage: 0,
|
|
601
|
+
image: theme.images.order.status2,
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
key: 4,
|
|
605
|
+
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
606
|
+
slug: 'PREPARATION_COMPLETED',
|
|
607
|
+
percentage: 0.5,
|
|
608
|
+
image: theme.images.order.status4,
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
key: 5,
|
|
612
|
+
value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
|
|
613
|
+
slug: 'REJECTED_BY_BUSINESS',
|
|
614
|
+
percentage: 0,
|
|
615
|
+
image: theme.images.order.status5,
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
key: 7,
|
|
619
|
+
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
620
|
+
slug: 'ACCEPTED_BY_BUSINESS',
|
|
621
|
+
percentage: 0.3,
|
|
622
|
+
image: theme.images.order.status7,
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
key: 13,
|
|
626
|
+
value: t('PREORDER', 'PreOrder'),
|
|
627
|
+
slug: 'PREORDER',
|
|
628
|
+
percentage: 0,
|
|
629
|
+
image: theme.images.order.status13,
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
key: 14,
|
|
633
|
+
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
634
|
+
slug: 'ORDER_NOT_READY',
|
|
635
|
+
percentage: 0.3,
|
|
636
|
+
image: theme.images.order.status13,
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
key: 15,
|
|
640
|
+
value: t(
|
|
641
|
+
'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
642
|
+
'Order picked up completed by customer',
|
|
643
|
+
),
|
|
644
|
+
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
645
|
+
percentage: 1,
|
|
646
|
+
image: theme.images.order.status1,
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
key: 16,
|
|
650
|
+
value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
|
|
651
|
+
slug: 'CANCELLED_BY_CUSTOMER',
|
|
652
|
+
percentage: 0,
|
|
653
|
+
image: theme.images.order.status2,
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
key: 17,
|
|
657
|
+
value: t(
|
|
658
|
+
'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
659
|
+
'Order not picked up by customer',
|
|
660
|
+
),
|
|
661
|
+
slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
662
|
+
percentage: 0,
|
|
663
|
+
image: theme.images.order.status2,
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
key: 20,
|
|
667
|
+
value: t(
|
|
668
|
+
'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
669
|
+
'Customer almost arrived to business',
|
|
670
|
+
),
|
|
671
|
+
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
672
|
+
percentage: 0.7,
|
|
673
|
+
image: theme.images.order.status7,
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
key: 21,
|
|
677
|
+
value: t(
|
|
678
|
+
'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
679
|
+
'Customer arrived to business',
|
|
680
|
+
),
|
|
681
|
+
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
682
|
+
percentage: 0.9,
|
|
683
|
+
image: theme.images.order.status7,
|
|
684
|
+
}
|
|
685
|
+
];
|
|
686
|
+
|
|
568
687
|
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
569
688
|
|
|
570
689
|
return objectStatus && objectStatus;
|
|
571
690
|
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Function to get brightness of color.
|
|
694
|
+
*/
|
|
695
|
+
export const lightenDarkenColor = (color: any) => {
|
|
696
|
+
|
|
697
|
+
let r, g, b, hsp
|
|
698
|
+
if (!color) return
|
|
699
|
+
if (color.match(/^rgb/)) {
|
|
700
|
+
// If HEX --> store the red, green, blue values in separate variables
|
|
701
|
+
color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)
|
|
702
|
+
|
|
703
|
+
r = color[1]
|
|
704
|
+
g = color[2]
|
|
705
|
+
b = color[3]
|
|
706
|
+
} else {
|
|
707
|
+
// If RGB --> Convert it to HEX
|
|
708
|
+
color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'))
|
|
709
|
+
|
|
710
|
+
r = color >> 16
|
|
711
|
+
g = color >> 8 & 255
|
|
712
|
+
b = color & 255
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// HSP (Highly Sensitive Poo) equation
|
|
716
|
+
hsp = Math.sqrt(
|
|
717
|
+
0.299 * (r * r) +
|
|
718
|
+
0.587 * (g * g) +
|
|
719
|
+
0.114 * (b * b)
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
// Using the HSP value, determine whether the color is light or dark
|
|
723
|
+
if (hsp > 197) {
|
|
724
|
+
return true //is light color
|
|
725
|
+
} else {
|
|
726
|
+
return false
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export const vibrateApp = (impact ?: string) => {
|
|
731
|
+
const options = {
|
|
732
|
+
enableVibrateFallback: true,
|
|
733
|
+
ignoreAndroidSystemSettings: false
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
737
|
+
|
|
738
|
+
}
|