ordering-ui-react-native 0.16.64-release → 0.16.65-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 +1 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/Cart/index.tsx +1 -1
- package/themes/original/src/components/CartContent/index.tsx +1 -1
- package/themes/original/src/components/Checkout/index.tsx +1 -1
- package/themes/original/src/components/DriverTips/index.tsx +44 -34
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +2 -2
- package/themes/original/src/components/MultiCheckout/index.tsx +35 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +27 -18
- package/themes/original/src/components/MyOrders/index.tsx +24 -22
- package/themes/original/src/components/ProductForm/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/Wallets/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ export const BusinessBasicInformation = (
|
|
|
46
46
|
const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
|
|
47
47
|
const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
|
|
48
48
|
const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
|
|
49
|
-
|
|
49
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
50
50
|
const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
51
51
|
|
|
52
52
|
const styles = StyleSheet.create({
|
|
@@ -76,7 +76,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
76
76
|
{ text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
|
|
77
77
|
]
|
|
78
78
|
|
|
79
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
79
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
80
80
|
|
|
81
81
|
const priceList = [
|
|
82
82
|
{ level: '1', content: '$' },
|
|
@@ -81,7 +81,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
81
81
|
const isFocused = useIsFocused();
|
|
82
82
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
83
83
|
|
|
84
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
84
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
85
85
|
const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
86
86
|
const hideBusinessNearCity = theme?.business_view?.components?.near_business?.hidden ?? true
|
|
87
87
|
|
|
@@ -76,7 +76,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
76
76
|
const [orderingTheme] = useOrderingTheme()
|
|
77
77
|
const isFocused = useIsFocused();
|
|
78
78
|
const appState = useRef(AppState.currentState)
|
|
79
|
-
|
|
79
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
80
80
|
const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
|
|
81
81
|
const [refreshing] = useState(false);
|
|
82
82
|
const bgHeader = orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image
|
|
@@ -20,7 +20,7 @@ export const CartContent = (props: any) => {
|
|
|
20
20
|
const [{ configs }] = useConfig()
|
|
21
21
|
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
22
22
|
|
|
23
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
23
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
24
24
|
const isMultiCheckout = configs?.checkout_multi_business_enabled?.value === '1'
|
|
25
25
|
const cartsAvailable: any = Object.values(carts)?.filter((cart: any) => cart?.valid && cart?.status !== 2)
|
|
26
26
|
|
|
@@ -153,7 +153,7 @@ const CheckoutUI = (props: any) => {
|
|
|
153
153
|
const isWalletCreditPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
|
|
154
154
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletCreditPointsEnabled)
|
|
155
155
|
const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
|
|
156
|
-
|
|
156
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
157
157
|
|
|
158
158
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
159
159
|
const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
|
|
@@ -22,17 +22,20 @@ const DriverTipsUI = (props: any) => {
|
|
|
22
22
|
const {
|
|
23
23
|
driverTip,
|
|
24
24
|
driverTipsOptions,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
isMulti,
|
|
26
|
+
cart,
|
|
27
27
|
isDriverTipUseCustom,
|
|
28
|
-
handlerChangeOption
|
|
28
|
+
handlerChangeOption,
|
|
29
|
+
isFixedPrice
|
|
29
30
|
} = props;
|
|
30
31
|
|
|
31
32
|
const [{ parsePrice }] = useUtils();
|
|
33
|
+
const theme = useTheme();
|
|
32
34
|
const [, t] = useLanguage();
|
|
33
35
|
const [{ configs }] = useConfig();
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
+
const [customTip, setCustomTip] = useState((!isMulti && isDriverTipUseCustom && !driverTipsOptions.includes(driverTip)) ?? false)
|
|
37
|
+
const currentTip = customTip ? parseFloat(driverTip || 0) > 0 : (!customTip && !driverTipsOptions.includes(driverTip) && parseFloat(driverTip || 0)) > 0
|
|
38
|
+
const [value, setvalue] = useState('');
|
|
36
39
|
|
|
37
40
|
const style = StyleSheet.create({
|
|
38
41
|
semicircle: {
|
|
@@ -48,53 +51,59 @@ const DriverTipsUI = (props: any) => {
|
|
|
48
51
|
}
|
|
49
52
|
})
|
|
50
53
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const placeholderCurrency = (configs?.currency_position?.value || 'left') === 'left'
|
|
54
|
+
const placeholderCurrency = !isFixedPrice ? `0%` : (configs?.currency_position?.value || 'left') === 'left'
|
|
54
55
|
? `${configs?.format_number_currency?.value}0`
|
|
55
56
|
: `0${configs?.format_number_currency?.value}`
|
|
56
57
|
|
|
57
58
|
const handleChangeDriverTip = (val: any) => {
|
|
58
59
|
const tip = Number(val)
|
|
59
60
|
if ((isNaN(tip) || tip < 0)) {
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
setvalue(value)
|
|
62
|
+
return
|
|
62
63
|
}
|
|
63
64
|
setvalue(val)
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
|
|
66
67
|
return (
|
|
67
68
|
<DTContainer>
|
|
68
69
|
<DTLabel>
|
|
69
70
|
{t('CUSTOM_DRIVER_TIP_MESSAGE', '100% of these tips go directly to your driver')}
|
|
70
71
|
</DTLabel>
|
|
71
72
|
<DTWrapperTips>
|
|
72
|
-
{
|
|
73
|
+
{driverTipsOptions.map((option: any, i: number) => (
|
|
73
74
|
<TouchableOpacity
|
|
74
75
|
key={i}
|
|
75
|
-
onPress={() =>
|
|
76
|
+
onPress={() => {
|
|
77
|
+
handlerChangeOption(option)
|
|
78
|
+
setCustomTip(false)
|
|
79
|
+
}}
|
|
76
80
|
>
|
|
77
81
|
<DTCard
|
|
78
82
|
style={style.semicircle}
|
|
79
|
-
isActive={option ===
|
|
83
|
+
isActive={(option === driverTip && !customTip)}
|
|
80
84
|
>
|
|
81
|
-
<OText size={12} numberOfLines={2} color={option ===
|
|
85
|
+
<OText size={12} numberOfLines={2} color={(option === driverTip && !customTip) ? '#FFF' : theme.colors.textSecondary}>
|
|
82
86
|
{`${isFixedPrice ? parsePrice(option) : `${option}%`}`}
|
|
83
87
|
</OText>
|
|
84
88
|
</DTCard>
|
|
85
89
|
</TouchableOpacity>
|
|
86
90
|
))}
|
|
91
|
+
{isDriverTipUseCustom && (
|
|
92
|
+
<TouchableOpacity
|
|
93
|
+
onPress={() => setCustomTip(true)}
|
|
94
|
+
>
|
|
95
|
+
<DTCard
|
|
96
|
+
style={style.semicircle}
|
|
97
|
+
isActive={customTip}
|
|
98
|
+
>
|
|
99
|
+
<OText size={12} numberOfLines={2} color={customTip ? '#FFF' : theme.colors.textSecondary}>
|
|
100
|
+
{t('CUSTOM_TIP', 'Custom')}
|
|
101
|
+
</OText>
|
|
102
|
+
</DTCard>
|
|
103
|
+
</TouchableOpacity>
|
|
104
|
+
)}
|
|
87
105
|
</DTWrapperTips>
|
|
88
|
-
{
|
|
89
|
-
<OText
|
|
90
|
-
color={theme.colors.error}
|
|
91
|
-
size={16}
|
|
92
|
-
style={{ marginTop: 10, textAlign: 'center' }}
|
|
93
|
-
>
|
|
94
|
-
{t('CUSTOM_DRIVER_TIP_AMOUNT', 'The driver\'s current tip comes from a custom option')}
|
|
95
|
-
</OText>
|
|
96
|
-
)}
|
|
97
|
-
{isDriverTipUseCustom && (
|
|
106
|
+
{customTip && (
|
|
98
107
|
<DTForm>
|
|
99
108
|
<DTWrapperInput>
|
|
100
109
|
<OInput
|
|
@@ -120,17 +129,18 @@ const DriverTipsUI = (props: any) => {
|
|
|
120
129
|
}}
|
|
121
130
|
/>
|
|
122
131
|
</DTWrapperInput>
|
|
123
|
-
{parseFloat(driverTip || 0) > 0 && (
|
|
124
|
-
<OText
|
|
125
|
-
color={theme.colors.error}
|
|
126
|
-
size={16}
|
|
127
|
-
style={{ marginTop: 10, textAlign: 'center' }}
|
|
128
|
-
>
|
|
129
|
-
{t('CURRENT_DRIVER_TIP_AMOUNT', 'Current driver tip amount')}: {parsePrice(driverTip)}
|
|
130
|
-
</OText>
|
|
131
|
-
)}
|
|
132
132
|
</DTForm>
|
|
133
133
|
)}
|
|
134
|
+
{currentTip && (
|
|
135
|
+
<OText
|
|
136
|
+
color={theme.colors.primary}
|
|
137
|
+
size={16}
|
|
138
|
+
style={{ marginTop: 10, textAlign: 'center' }}
|
|
139
|
+
>
|
|
140
|
+
{t('CURRENT_DRIVER_TIP_AMOUNT', 'Current driver tip amount')}{!isFixedPrice &&
|
|
141
|
+
` (${driverTip}%)`}: {isFixedPrice ? parsePrice(driverTip) : parsePrice(cart?.driver_tip)}
|
|
142
|
+
</OText>
|
|
143
|
+
)}
|
|
134
144
|
</DTContainer>
|
|
135
145
|
)
|
|
136
146
|
}
|
|
@@ -61,7 +61,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
61
61
|
case 'paypal':
|
|
62
62
|
return theme.images.general.paypal
|
|
63
63
|
case 'stripe':
|
|
64
|
-
return theme.images.general.
|
|
64
|
+
return theme.images.general.creditCard
|
|
65
65
|
case 'stripe_direct':
|
|
66
66
|
return theme.images.general.stripecc
|
|
67
67
|
case 'stripe_connect':
|
|
@@ -83,7 +83,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
83
83
|
isActive={paymethodSelected?.id === item.id}
|
|
84
84
|
>
|
|
85
85
|
<OIcon
|
|
86
|
-
src={getPayIcon(item.paymethod?.gateway)}
|
|
86
|
+
src={getPayIcon(item?.gateway ?? item.paymethod?.gateway)}
|
|
87
87
|
width={20}
|
|
88
88
|
height={20}
|
|
89
89
|
color={paymethodSelected?.id === item.id ? theme.colors.white : theme.colors.backgroundDark}
|
|
@@ -21,6 +21,8 @@ import { AddressDetails } from '../AddressDetails'
|
|
|
21
21
|
import { MultiCartsPaymethodsAndWallets } from '../MultiCartsPaymethodsAndWallets'
|
|
22
22
|
import { Cart } from '../Cart'
|
|
23
23
|
import { FloatingButton } from '../FloatingButton'
|
|
24
|
+
import { DriverTips } from '../DriverTips'
|
|
25
|
+
import { DriverTipsContainer } from '../Cart/styles'
|
|
24
26
|
|
|
25
27
|
import {
|
|
26
28
|
ChContainer,
|
|
@@ -78,8 +80,12 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
78
80
|
|
|
79
81
|
const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
|
|
80
82
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
83
|
+
const isMultiDriverTips = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
81
84
|
const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
|
|
82
85
|
const walletCarts = (Object.values(carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
|
|
86
|
+
const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
|
|
87
|
+
? JSON.parse(configs?.driver_tip_options?.value) || []
|
|
88
|
+
: configs?.driver_tip_options?.value || []
|
|
83
89
|
|
|
84
90
|
const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
|
|
85
91
|
const [phoneUpdate, setPhoneUpdate] = useState(false);
|
|
@@ -227,6 +233,35 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
227
233
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
228
234
|
</ChSection>
|
|
229
235
|
|
|
236
|
+
{
|
|
237
|
+
isMultiDriverTips &&
|
|
238
|
+
options?.type === 1 &&
|
|
239
|
+
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
240
|
+
openCarts.every((cart: any) => cart.business_id && cart.status !== 2) &&
|
|
241
|
+
driverTipsOptions && driverTipsOptions?.length > 0 &&
|
|
242
|
+
(
|
|
243
|
+
<ChSection>
|
|
244
|
+
<DriverTipsContainer>
|
|
245
|
+
<OText size={14} lineHeight={20} color={theme.colors.textNormal}>
|
|
246
|
+
{t('DRIVER_TIPS', 'Driver Tips')}
|
|
247
|
+
</OText>
|
|
248
|
+
<DriverTips
|
|
249
|
+
isMulti
|
|
250
|
+
carts={openCarts}
|
|
251
|
+
businessIds={openCarts.map((cart: any) => cart.business_id)}
|
|
252
|
+
driverTipsOptions={driverTipsOptions}
|
|
253
|
+
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
254
|
+
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
255
|
+
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
256
|
+
? openCarts[0]?.driver_tip
|
|
257
|
+
: openCarts[0]?.driver_tip_rate}
|
|
258
|
+
useOrderContext
|
|
259
|
+
/>
|
|
260
|
+
</DriverTipsContainer>
|
|
261
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
262
|
+
</ChSection>
|
|
263
|
+
)}
|
|
264
|
+
|
|
230
265
|
<ChSection>
|
|
231
266
|
<ChCarts>
|
|
232
267
|
<CartsHeader>
|
|
@@ -3,7 +3,6 @@ import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as Multi
|
|
|
3
3
|
import { View, StyleSheet, BackHandler, TouchableOpacity } from 'react-native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
import { OText, OButton } from '../shared'
|
|
6
|
-
import { Container } from '../../layouts/Container'
|
|
7
6
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
|
|
8
7
|
import { SingleOrderCard } from './SingleOrderCard'
|
|
9
8
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
@@ -45,6 +44,12 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
45
44
|
const [, t] = useLanguage()
|
|
46
45
|
const [{ parsePrice, parseNumber, parseDate }] = useUtils();
|
|
47
46
|
const [, { showToast }] = useToast();
|
|
47
|
+
const [{ configs }] = useConfig()
|
|
48
|
+
|
|
49
|
+
const isTaxIncludedOnPrice = orders.every((_order: any) => _order.taxes?.length ? _order.taxes?.every((_tax: any) => _tax.type === 1) : true)
|
|
50
|
+
const progressBarStyle = configs.multi_business_checkout_progress_bar_style?.value
|
|
51
|
+
const showBarInOrder = ['group', 'both']
|
|
52
|
+
const showBarInIndividual = ['individual', 'both']
|
|
48
53
|
|
|
49
54
|
const walletName: any = {
|
|
50
55
|
cash: {
|
|
@@ -197,23 +202,27 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
197
202
|
</Row>
|
|
198
203
|
))}
|
|
199
204
|
<BorderLine />
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
205
|
+
{!isTaxIncludedOnPrice && (
|
|
206
|
+
<>
|
|
207
|
+
<Row>
|
|
208
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
209
|
+
{t('TOTAL_BEFORE_TAX', 'Total before tax')}:
|
|
210
|
+
</OText>
|
|
211
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
212
|
+
{parsePrice(ordersSummary?.subtotal)}
|
|
213
|
+
</OText>
|
|
214
|
+
</Row>
|
|
215
|
+
<Row>
|
|
216
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
217
|
+
{t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
|
|
218
|
+
</OText>
|
|
219
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
220
|
+
{parsePrice(ordersSummary?.tax)}
|
|
221
|
+
</OText>
|
|
222
|
+
</Row>
|
|
223
|
+
<BorderLine />
|
|
224
|
+
</>
|
|
225
|
+
)}
|
|
217
226
|
<Row style={{ marginTop: 10 }}>
|
|
218
227
|
<OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
|
|
219
228
|
{t('PAYMENT_TOTAL', 'Payment total')}:
|
|
@@ -30,14 +30,17 @@ export const MyOrders = (props: any) => {
|
|
|
30
30
|
|
|
31
31
|
const notOrderOptions = ['business', 'products']
|
|
32
32
|
const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
|
|
33
|
+
|
|
34
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
35
|
+
const showNavbar = theme?.bar_menu?.components?.orders?.hidden
|
|
36
|
+
const hideOrdersTheme = theme?.bar_menu?.components?.orders?.hidden
|
|
37
|
+
const hideProductsTab = theme?.orders?.components?.products_tab?.hidden
|
|
38
|
+
const hideBusinessTab = theme?.orders?.components?.business_tab?.hidden
|
|
33
39
|
const MyOrdersMenu = [
|
|
34
|
-
{ key: 'orders', value: t('ORDERS', 'Orders') },
|
|
35
|
-
{ key: 'business', value: t('BUSINESS', 'Business') },
|
|
36
|
-
{ key: 'products', value: t('PRODUCTS', 'Products') }
|
|
40
|
+
{ key: 'orders', value: t('ORDERS', 'Orders'), disabled: false },
|
|
41
|
+
{ key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
|
|
42
|
+
{ key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
|
|
37
43
|
]
|
|
38
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
39
|
-
const showNavbar = theme?.bar_menu?.components?.orders?.hidden
|
|
40
|
-
|
|
41
44
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
42
45
|
|
|
43
46
|
const handleOnRefresh = () => {
|
|
@@ -87,7 +90,7 @@ export const MyOrders = (props: any) => {
|
|
|
87
90
|
},
|
|
88
91
|
...props.titleStyle
|
|
89
92
|
}}>
|
|
90
|
-
{!props.hideBackBtn && !isChewLayout && (
|
|
93
|
+
{!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
|
|
91
94
|
<OButton
|
|
92
95
|
imgLeftStyle={{ width: 18 }}
|
|
93
96
|
imgRightSrc={null}
|
|
@@ -99,7 +102,8 @@ export const MyOrders = (props: any) => {
|
|
|
99
102
|
borderColor: '#FFF',
|
|
100
103
|
shadowColor: '#FFF',
|
|
101
104
|
paddingLeft: 0,
|
|
102
|
-
paddingRight: 0
|
|
105
|
+
paddingRight: 0,
|
|
106
|
+
marginTop: 30,
|
|
103
107
|
}}
|
|
104
108
|
onClick={goToBack}
|
|
105
109
|
icon={AntDesignIcon}
|
|
@@ -109,7 +113,7 @@ export const MyOrders = (props: any) => {
|
|
|
109
113
|
}}
|
|
110
114
|
/>
|
|
111
115
|
)}
|
|
112
|
-
<HeaderTitle ph={
|
|
116
|
+
<HeaderTitle ph={10} text={t('MY_ORDERS', 'My Orders')} />
|
|
113
117
|
</View>
|
|
114
118
|
)}
|
|
115
119
|
{!hideOrders && !isChewLayout && !showNavbar && (
|
|
@@ -123,7 +127,7 @@ export const MyOrders = (props: any) => {
|
|
|
123
127
|
showsHorizontalScrollIndicator={false}
|
|
124
128
|
scrollEventThrottle={16}
|
|
125
129
|
>
|
|
126
|
-
{MyOrdersMenu.filter(option => !hideOrders || option.key !== 'orders').map(option => (
|
|
130
|
+
{MyOrdersMenu.filter(option => (!hideOrders || option.key !== 'orders') && !option.disabled).map(option => (
|
|
127
131
|
<Tab
|
|
128
132
|
key={option.key}
|
|
129
133
|
onPress={() => setSelectedOption(option.key)}
|
|
@@ -143,18 +147,16 @@ export const MyOrders = (props: any) => {
|
|
|
143
147
|
)}
|
|
144
148
|
{selectedOption === 'orders' && (
|
|
145
149
|
<>
|
|
146
|
-
{
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
</View>
|
|
157
|
-
)}
|
|
150
|
+
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
151
|
+
<OrdersOption
|
|
152
|
+
{...props}
|
|
153
|
+
activeOrders
|
|
154
|
+
ordersLength={ordersLength}
|
|
155
|
+
setOrdersLength={setOrdersLength}
|
|
156
|
+
setRefreshOrders={setRefreshOrders}
|
|
157
|
+
refreshOrders={refreshOrders}
|
|
158
|
+
/>
|
|
159
|
+
</View>
|
|
158
160
|
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
159
161
|
<OrdersOption
|
|
160
162
|
{...props}
|
|
@@ -77,7 +77,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
77
77
|
const theme = useTheme();
|
|
78
78
|
const [, { showToast }] = useToast()
|
|
79
79
|
|
|
80
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
80
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
81
81
|
|
|
82
82
|
const styles = StyleSheet.create({
|
|
83
83
|
mainContainer: {
|
|
@@ -41,7 +41,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
41
41
|
const [showMessage, setShowMessage] = useState(false)
|
|
42
42
|
const [isDirty, setIsDirty] = useState(false)
|
|
43
43
|
|
|
44
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
44
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
45
45
|
const iconsSize = isChewLayout ? 20 : 16
|
|
46
46
|
|
|
47
47
|
const handleSuboptionClick = () => {
|
|
@@ -44,7 +44,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
44
44
|
|
|
45
45
|
const theme = useTheme();
|
|
46
46
|
const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
|
|
47
|
-
|
|
47
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
48
48
|
|
|
49
49
|
const textSize = isChewLayout ? 12 : 10
|
|
50
50
|
|
|
@@ -49,7 +49,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
49
49
|
|
|
50
50
|
const theme = useTheme();
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
53
53
|
|
|
54
54
|
const langPickerStyle = StyleSheet.create({
|
|
55
55
|
inputAndroid: {
|
|
@@ -62,7 +62,7 @@ const WalletsUI = (props: any) => {
|
|
|
62
62
|
|
|
63
63
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
64
64
|
const [openHistory, setOpenHistory] = useState(false)
|
|
65
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
65
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
66
66
|
|
|
67
67
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
68
68
|
|