ordering-ui-react-native 0.17.50-release → 0.17.51-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/business/src/components/OrderDetails/Delivery.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +1 -2
- package/themes/original/src/components/BusinessController/index.tsx +7 -31
- package/themes/original/src/components/BusinessController/styles.tsx +4 -5
- package/themes/original/src/components/BusinessInformation/index.tsx +106 -83
- package/themes/original/src/components/BusinessPreorder/index.tsx +6 -3
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/Checkout/index.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -5
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/UserProfile/index.tsx +81 -55
- package/themes/original/src/components/Wallets/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -229,7 +229,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
229
229
|
}, [props.order?.loading]);
|
|
230
230
|
|
|
231
231
|
useEffect(() => {
|
|
232
|
-
if (order?.
|
|
232
|
+
if (!order?.driver_id && session?.user?.level === 4) {
|
|
233
233
|
setAlertState({
|
|
234
234
|
open: true,
|
|
235
235
|
content: [
|
|
@@ -94,8 +94,7 @@ export const OrderItem = (props: any) => {
|
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
const getDelayMinutes = (order: any) => {
|
|
97
|
-
const
|
|
98
|
-
const cdtToutc = moment(order?.delivery_datetime).add(offset, 'minutes').format('YYYY-MM-DD HH:mm:ss')
|
|
97
|
+
const cdtToutc = moment(order?.delivery_datetime).utc().format('YYYY-MM-DD HH:mm:ss')
|
|
99
98
|
const _delivery = order?.delivery_datetime_utc
|
|
100
99
|
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
|
|
101
100
|
: parseDate(cdtToutc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
|
|
@@ -42,7 +42,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
42
42
|
navigation,
|
|
43
43
|
isBusinessOpen,
|
|
44
44
|
style,
|
|
45
|
-
isCustomLayout,
|
|
46
45
|
businessHeader,
|
|
47
46
|
businessFeatured,
|
|
48
47
|
businessLogo,
|
|
@@ -76,7 +75,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
76
75
|
const hideBusinessHeader = theme?.business_listing_view?.components?.business?.components?.header?.hidden
|
|
77
76
|
const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
|
|
78
77
|
|
|
79
|
-
const textSize =
|
|
78
|
+
const textSize = 12
|
|
80
79
|
const cardHeight = windowHeight * 0.3
|
|
81
80
|
|
|
82
81
|
const styles = StyleSheet.create({
|
|
@@ -214,7 +213,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
214
213
|
<BusinessHero>
|
|
215
214
|
{!hideBusinessHeader && (
|
|
216
215
|
<FastImage
|
|
217
|
-
style={{ height:
|
|
216
|
+
style={{ height: cardHeight * 0.66 }}
|
|
218
217
|
source={(businessHeader || business?.header || typeof theme.images.dummies.businessHeader === 'string') ? {
|
|
219
218
|
uri: optimizeImage(businessHeader || business?.header || theme.images.dummies.businessHeader, 'h_500,c_limit'),
|
|
220
219
|
priority: FastImage.priority.normal,
|
|
@@ -227,7 +226,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
227
226
|
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
228
227
|
</View>
|
|
229
228
|
)}
|
|
230
|
-
{
|
|
229
|
+
{!hideBusinessOffer && (
|
|
231
230
|
getBusinessOffer((business?.offers)) &&
|
|
232
231
|
<OfferBox
|
|
233
232
|
isClosed={!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1')}
|
|
@@ -257,7 +256,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
257
256
|
</BusinessState>
|
|
258
257
|
</BusinessHero>
|
|
259
258
|
<BusinessContent>
|
|
260
|
-
<BusinessInfo style={
|
|
259
|
+
<BusinessInfo style={{ position: 'absolute', bottom: 85, left: 15 }}>
|
|
261
260
|
{!hideBusinessLogo && (
|
|
262
261
|
<BusinessLogo style={styles.businessLogo}>
|
|
263
262
|
<FastImage
|
|
@@ -270,38 +269,15 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
270
269
|
/>
|
|
271
270
|
</BusinessLogo>
|
|
272
271
|
)}
|
|
273
|
-
{!isCustomLayout && (!hideBusinessFavorite || !hideBusinessReviews) && (
|
|
274
|
-
<ReviewAndFavorite>
|
|
275
|
-
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
|
|
276
|
-
<Reviews>
|
|
277
|
-
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
278
|
-
<OText size={10} style={{ lineHeight: 15 }}>
|
|
279
|
-
{parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
|
|
280
|
-
</OText>
|
|
281
|
-
</Reviews>
|
|
282
|
-
)}
|
|
283
|
-
{!hideBusinessFavorite && (
|
|
284
|
-
<LottieAnimation
|
|
285
|
-
type='favorite'
|
|
286
|
-
onClick={handleChangeFavorite}
|
|
287
|
-
initialValue={business?.favorite ? 0.5 : 0}
|
|
288
|
-
toValue={business?.favorite ? 0 : 0.5}
|
|
289
|
-
disableAnimation={!auth}
|
|
290
|
-
iconProps={{ color: theme.colors.danger5, size: 18 }}
|
|
291
|
-
isActive={business?.favorite}
|
|
292
|
-
/>
|
|
293
|
-
)}
|
|
294
|
-
</ReviewAndFavorite>
|
|
295
|
-
)}
|
|
296
272
|
</BusinessInfo>
|
|
297
|
-
<View style={
|
|
273
|
+
<View style={{ width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
|
|
298
274
|
<OText
|
|
299
275
|
size={textSize + 2}
|
|
300
276
|
style={{ lineHeight: 18, marginBottom: 6 }}
|
|
301
277
|
weight={'500'}>
|
|
302
278
|
{business?.name}
|
|
303
279
|
</OText>
|
|
304
|
-
{
|
|
280
|
+
{(!hideBusinessFavorite || !hideBusinessReviews) && (
|
|
305
281
|
<ReviewAndFavorite>
|
|
306
282
|
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
|
|
307
283
|
<Reviews>
|
|
@@ -325,7 +301,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
325
301
|
</ReviewAndFavorite>
|
|
326
302
|
)}
|
|
327
303
|
</View>
|
|
328
|
-
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={
|
|
304
|
+
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={1}>
|
|
329
305
|
{business?.address}
|
|
330
306
|
</OText>
|
|
331
307
|
<Metadata>
|
|
@@ -34,8 +34,8 @@ export const Metadata = styled.View`
|
|
|
34
34
|
|
|
35
35
|
export const BusinessState = styled.View`
|
|
36
36
|
position: absolute;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
top: ${(props: any) => props.isRibbon ? '32px' : '15px'};
|
|
38
|
+
right: 15px;
|
|
39
39
|
`
|
|
40
40
|
|
|
41
41
|
export const BusinessLogo = styled.View`
|
|
@@ -85,10 +85,9 @@ export const RibbonBox = styled.View`
|
|
|
85
85
|
export const OfferBox = styled.View`
|
|
86
86
|
position: absolute;
|
|
87
87
|
z-index: 1;
|
|
88
|
-
top: 20px;
|
|
89
|
-
right: 10px;
|
|
90
88
|
border-radius: 50px;
|
|
91
|
-
|
|
89
|
+
top: ${(props: any) => props.isRibbon ? '32px' : '15px'};
|
|
90
|
+
right: ${(props: any) => props.isClosed ? '110px' : '15px'};
|
|
92
91
|
background: ${(props: any) => props.theme.colors.inputBorderColor};
|
|
93
92
|
padding: 3px 8px;
|
|
94
93
|
max-width: 180px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
BusinessInformation as BusinessInformationController,
|
|
4
|
-
useLanguage, useUtils
|
|
4
|
+
useLanguage, useUtils, useConfig,
|
|
5
5
|
} from 'ordering-components/native';
|
|
6
6
|
import { useTheme } from 'styled-components/native';
|
|
7
7
|
import { OIcon, OText } from '../shared';
|
|
@@ -22,25 +22,27 @@ import { GoogleMap } from '../GoogleMap';
|
|
|
22
22
|
import { WebView } from 'react-native-webview';
|
|
23
23
|
import { formatUrlVideo } from '../../utils'
|
|
24
24
|
import { ScheduleAccordion } from '../ScheduleAccordion';
|
|
25
|
+
import moment from 'moment';
|
|
25
26
|
const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
26
27
|
const { businessState, businessSchedule, businessLocation } = props;
|
|
27
28
|
|
|
28
29
|
const theme = useTheme();
|
|
29
30
|
const [, t] = useLanguage();
|
|
30
31
|
const [{ optimizeImage }] = useUtils();
|
|
32
|
+
const [{ configs }] = useConfig()
|
|
33
|
+
|
|
34
|
+
const hideLocation = theme?.business_view?.components?.information?.components?.location?.hidden
|
|
35
|
+
const hideSchedule = theme?.business_view?.components?.information?.components?.schedule?.hidden
|
|
36
|
+
const hideVideos = theme?.business_view?.components?.information?.components?.videos?.hidden
|
|
37
|
+
const hideImages = theme?.business_view?.components?.information?.components?.images?.hidden
|
|
38
|
+
const hideAddress = theme?.business_view?.components?.information?.components?.address?.hidden
|
|
39
|
+
const formatTime = configs?.general_hour_format?.value
|
|
40
|
+
|
|
41
|
+
const checkTime = (val: number) => (val < 10 ? `0${val}` : val);
|
|
42
|
+
const timeFormated = (time: any) => {
|
|
43
|
+
return moment(`1900-01-01 ${checkTime(time.hour)}:${checkTime(time.minute)}`).format(formatTime)
|
|
44
|
+
}
|
|
31
45
|
|
|
32
|
-
const scheduleFormatted = ({
|
|
33
|
-
hour,
|
|
34
|
-
minute,
|
|
35
|
-
}: {
|
|
36
|
-
hour: number | string;
|
|
37
|
-
minute: number | string;
|
|
38
|
-
}) => {
|
|
39
|
-
const checkTime = (val: number | string) => (val < 10 ? `0${val}` : val);
|
|
40
|
-
const zz = hour > 12 ? 'PM' : 'AM';
|
|
41
|
-
const h = parseInt(`${hour}`);
|
|
42
|
-
return `${h > 12 ? h - 12 : h}:${checkTime(minute)} ${zz}`;
|
|
43
|
-
};
|
|
44
46
|
const businessCoordinate = {
|
|
45
47
|
lat: businessState?.business?.location?.lat,
|
|
46
48
|
lng: businessState?.business?.location?.lng,
|
|
@@ -78,87 +80,108 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
78
80
|
<OText size={24} weight={'600'}>
|
|
79
81
|
{businessState?.business?.name}
|
|
80
82
|
</OText>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
{!hideLocation && (
|
|
84
|
+
<>
|
|
85
|
+
<GrayBackground>
|
|
86
|
+
<OText size={16} weight="500">
|
|
87
|
+
{t('BUSINESS_LOCATION', 'Business Location')}
|
|
88
|
+
</OText>
|
|
89
|
+
</GrayBackground>
|
|
90
|
+
{businessLocation.location && (
|
|
91
|
+
<WrapBusinessMap style={styles.wrapMapStyle}>
|
|
92
|
+
<GoogleMap
|
|
93
|
+
readOnly
|
|
94
|
+
location={businessLocation.location}
|
|
95
|
+
markerTitle={businessState?.business?.name}
|
|
96
|
+
/>
|
|
97
|
+
</WrapBusinessMap>
|
|
98
|
+
)}
|
|
99
|
+
</>
|
|
100
|
+
)}
|
|
101
|
+
{!hideAddress && (
|
|
102
|
+
<OText size={12} mBottom={20}>
|
|
103
|
+
{businessState?.business?.address}
|
|
84
104
|
</OText>
|
|
85
|
-
</GrayBackground>
|
|
86
|
-
{businessLocation.location && (
|
|
87
|
-
<WrapBusinessMap style={styles.wrapMapStyle}>
|
|
88
|
-
<GoogleMap
|
|
89
|
-
readOnly
|
|
90
|
-
location={businessLocation.location}
|
|
91
|
-
markerTitle={businessState?.business?.name}
|
|
92
|
-
/>
|
|
93
|
-
</WrapBusinessMap>
|
|
94
105
|
)}
|
|
95
|
-
<OText size={12} mBottom={20}>
|
|
96
|
-
{businessState?.business?.address}
|
|
97
|
-
</OText>
|
|
98
106
|
<DivideView />
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{businessSchedule
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
{!hideSchedule && (
|
|
108
|
+
<>
|
|
109
|
+
<GrayBackground>
|
|
110
|
+
<OText size={16} weight="500">
|
|
111
|
+
{t('OPENING_TIME', 'Opening Time')}
|
|
112
|
+
</OText>
|
|
113
|
+
</GrayBackground>
|
|
114
|
+
{businessSchedule && businessSchedule?.length > 0 && (
|
|
115
|
+
<WrapScheduleBlock>
|
|
116
|
+
{businessSchedule.map((schedule: any, i: number) => (
|
|
117
|
+
<ScheduleBlock key={i}>
|
|
118
|
+
<ScheduleAccordion
|
|
119
|
+
weekIndex={i}
|
|
120
|
+
timeFormated={timeFormated}
|
|
121
|
+
schedule={schedule}
|
|
122
|
+
/>
|
|
123
|
+
</ScheduleBlock>
|
|
124
|
+
))}
|
|
125
|
+
</WrapScheduleBlock>
|
|
126
|
+
)}
|
|
127
|
+
</>
|
|
116
128
|
)}
|
|
129
|
+
|
|
117
130
|
{/* {businessState?.business?.gallery?.length > 0 && ( */}
|
|
131
|
+
|
|
118
132
|
<>
|
|
119
|
-
{
|
|
133
|
+
{!hideVideos && (
|
|
120
134
|
<>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
{bVideos().length > 0 && (
|
|
136
|
+
<>
|
|
137
|
+
<DivideView />
|
|
138
|
+
<GrayBackground>
|
|
139
|
+
<OText size={16} weight="500">
|
|
140
|
+
{t('VIDEOS', 'Videos')}
|
|
141
|
+
</OText>
|
|
142
|
+
</GrayBackground>
|
|
143
|
+
<MediaWrapper horizontal>
|
|
144
|
+
{bVideos().map((v: any) => (
|
|
145
|
+
<WebView
|
|
146
|
+
key={`vid_id_${v.id}`}
|
|
147
|
+
style={{ width: 210, height: 127, borderRadius: 7.6 }}
|
|
148
|
+
javaScriptEnabled={true}
|
|
149
|
+
domStorageEnabled={true}
|
|
150
|
+
source={{
|
|
151
|
+
html: `
|
|
152
|
+
<iframe width='80%' height='80%' src="${formatUrlVideo(v.video)}" frameBorder='0' allow='autoplay; encrypted-media' allowFullScreen />
|
|
137
153
|
`,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
154
|
+
}}
|
|
155
|
+
mediaPlaybackRequiresUserAction={true}
|
|
156
|
+
/>
|
|
157
|
+
))}
|
|
158
|
+
</MediaWrapper>
|
|
159
|
+
</>
|
|
160
|
+
)}
|
|
143
161
|
</>
|
|
144
162
|
)}
|
|
145
|
-
|
|
163
|
+
|
|
164
|
+
{!hideImages && (
|
|
146
165
|
<>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
{bImages().length > 0 && (
|
|
167
|
+
<>
|
|
168
|
+
<DivideView />
|
|
169
|
+
<GrayBackground>
|
|
170
|
+
<OText size={16} weight="500">
|
|
171
|
+
{t('IMAGES', 'Images')}
|
|
172
|
+
</OText>
|
|
173
|
+
</GrayBackground>
|
|
174
|
+
<MediaWrapper horizontal>
|
|
175
|
+
{bImages().map((i: any) => (
|
|
176
|
+
i.file != null &&
|
|
177
|
+
<View key={i.id} style={{ width: 210, height: 127, borderRadius: 7.6, marginEnd: 20, overflow: 'hidden' }}>
|
|
178
|
+
<OIcon cover url={optimizeImage(i?.file, 'h_150,c_limit')} width={210} height={127} />
|
|
179
|
+
{/* <OText size={12} color={colors.red} style={{position: 'absolute'}}>{i.file}</OText> */}
|
|
180
|
+
</View>
|
|
181
|
+
))}
|
|
182
|
+
</MediaWrapper>
|
|
183
|
+
</>
|
|
184
|
+
)}
|
|
162
185
|
</>
|
|
163
186
|
)}
|
|
164
187
|
</>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useFocusEffect } from '@react-navigation/native'
|
|
2
3
|
import { TouchableOpacity, StyleSheet, View, Dimensions, Platform } from 'react-native'
|
|
3
4
|
import { useLanguage, useUtils, useConfig, useOrder, MomentOption } from 'ordering-components/native'
|
|
4
5
|
import { OButton, OIcon, OText } from '../shared'
|
|
@@ -310,9 +311,11 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
310
311
|
}
|
|
311
312
|
}, [dateSelected])
|
|
312
313
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
useFocusEffect(
|
|
315
|
+
React.useCallback(() => {
|
|
316
|
+
handleAsap && handleAsap()
|
|
317
|
+
}, [])
|
|
318
|
+
)
|
|
316
319
|
|
|
317
320
|
return (
|
|
318
321
|
<>
|
|
@@ -572,7 +572,7 @@ const CheckoutUI = (props: any) => {
|
|
|
572
572
|
data: deliveryOptions || [],
|
|
573
573
|
renderItem: ({ item }: any) => (
|
|
574
574
|
<TouchableOpacity
|
|
575
|
-
onPress={() => changeDeliveryOption(item.value)}
|
|
575
|
+
onPress={() => !!cart?.uuid && changeDeliveryOption(item.value)}
|
|
576
576
|
disabled={
|
|
577
577
|
deliveryOptionSelected === item.value
|
|
578
578
|
}
|
|
@@ -108,14 +108,14 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
108
108
|
/* const toggleAccordion = () => {
|
|
109
109
|
if ((!product?.valid_menu && isCartProduct)) return
|
|
110
110
|
if (isActive) {
|
|
111
|
-
|
|
111
|
+
Animated.timing(setHeight.height, {
|
|
112
112
|
toValue: 100,
|
|
113
113
|
duration: 500,
|
|
114
114
|
easing: Easing.linear,
|
|
115
115
|
useNativeDriver: false,
|
|
116
|
-
|
|
116
|
+
}).start()
|
|
117
117
|
} else {
|
|
118
|
-
|
|
118
|
+
setHeightState({height: new Animated.Value(0)})
|
|
119
119
|
}
|
|
120
120
|
}*/
|
|
121
121
|
|
|
@@ -136,7 +136,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
/*useEffect(() => {
|
|
139
|
-
|
|
139
|
+
toggleAccordion()
|
|
140
140
|
}, [isActive])*/
|
|
141
141
|
|
|
142
142
|
const productOptions = getProductMax && [...Array(getProductMax(product) + 1),].map((_: any, opt: number) => {
|
|
@@ -289,7 +289,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
289
289
|
)}
|
|
290
290
|
{productInfo().options.length > 0 && (
|
|
291
291
|
<ProductOptionsList>
|
|
292
|
-
{productInfo().options.map((option: any, i: number) => (
|
|
292
|
+
{productInfo().options.sort((a: any, b: any) => a.rank - b.rank).map((option: any, i: number) => (
|
|
293
293
|
<ProductOption key={option.id + i}>
|
|
294
294
|
<OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
|
|
295
295
|
{option.suboptions.map((suboption: any) => (
|
|
@@ -13,7 +13,7 @@ import { OIcon, OText } from '../shared';
|
|
|
13
13
|
export const ScheduleAccordion = (props: any) => {
|
|
14
14
|
|
|
15
15
|
const {
|
|
16
|
-
|
|
16
|
+
timeFormated,
|
|
17
17
|
schedule,
|
|
18
18
|
weekIndex
|
|
19
19
|
} = props
|
|
@@ -52,9 +52,9 @@ export const ScheduleAccordion = (props: any) => {
|
|
|
52
52
|
{schedule?.lapses?.map((lapse: any) => (
|
|
53
53
|
schedule?.enabled ?
|
|
54
54
|
<OText mBottom={16}>
|
|
55
|
-
{
|
|
55
|
+
{timeFormated(lapse.open) +
|
|
56
56
|
' - ' +
|
|
57
|
-
|
|
57
|
+
timeFormated(lapse.close)}
|
|
58
58
|
</OText>
|
|
59
59
|
:
|
|
60
60
|
<OText color={theme.colors.red} mBottom={16}>
|
|
@@ -48,9 +48,19 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
48
48
|
|
|
49
49
|
const theme = useTheme();
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
52
|
+
const hideProfileImage = theme?.profile?.components?.picture?.hidden
|
|
53
|
+
const hideOrders = theme?.profile?.components?.orders?.hidden
|
|
54
|
+
const hideProfile = theme?.profile?.components?.profile?.hidden
|
|
55
|
+
const hideWallet = theme?.profile?.components?.wallet?.hidden
|
|
56
|
+
const hideMessages = theme?.bar_menu?.components?.messages?.hidden
|
|
57
|
+
const hideHelp = theme?.bar_menu?.components?.help?.hidden
|
|
58
|
+
const hideFavorites = theme?.bar_menu?.components?.favortes?.hidden
|
|
59
|
+
const hideSession = theme?.bar_menu?.components?.sessions?.hidden
|
|
60
|
+
const hidePromotions = theme?.bar_menu?.components?.promotions?.hidden
|
|
61
|
+
const hideAddressList = theme?.profile?.components?.address_list?.hidden
|
|
62
|
+
const showLanguages = theme?.profile?.components?.languages?.hidden
|
|
63
|
+
const showNotifications = !theme?.profile?.components?.notification_settings?.hidden
|
|
54
64
|
const langPickerStyle = StyleSheet.create({
|
|
55
65
|
inputAndroid: {
|
|
56
66
|
color: theme.colors.textNormal,
|
|
@@ -153,7 +163,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
153
163
|
return (
|
|
154
164
|
<View style={{ flex: 1, height: '100%', paddingTop: 20 }}>
|
|
155
165
|
<CenterView style={styles.pagePadding}>
|
|
156
|
-
{user?.photo && (
|
|
166
|
+
{user?.photo && !hideProfileImage && (
|
|
157
167
|
<View style={styles.photo}>
|
|
158
168
|
<FastImage
|
|
159
169
|
style={{ height: 60, width: 60, borderRadius: 8 }}
|
|
@@ -167,75 +177,91 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
167
177
|
)}
|
|
168
178
|
<View style={{ flexBasis: '70%' }}>
|
|
169
179
|
<OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
|
|
170
|
-
|
|
171
|
-
<
|
|
172
|
-
|
|
180
|
+
{!hideProfile && (
|
|
181
|
+
<TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
|
|
182
|
+
<OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
|
|
183
|
+
</TouchableOpacity>
|
|
184
|
+
)}
|
|
173
185
|
</View>
|
|
174
186
|
</CenterView>
|
|
175
187
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32 }} />
|
|
176
188
|
<Spinner visible={notificationsGroup?.loading} />
|
|
177
189
|
<ListWrap style={{ ...styles.pagePadding }}>
|
|
178
190
|
<Actions>
|
|
179
|
-
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
{
|
|
191
|
+
{!hideAddressList && (
|
|
192
|
+
<ListItem onPress={() => onRedirect('AddressList', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
193
|
+
<OIcon src={theme.images.general.pin} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
194
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SAVED_PLACES', 'My saved places')}</OText>
|
|
195
|
+
</ListItem>
|
|
196
|
+
)}
|
|
197
|
+
{!hideMessages && (
|
|
198
|
+
<ListItem onPress={() => onRedirect('Messages', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
199
|
+
<MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
200
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
|
|
201
|
+
</ListItem>
|
|
202
|
+
)}
|
|
203
|
+
{!hideOrders && (
|
|
204
|
+
<ListItem onPress={() => onRedirect('MyOrders', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
205
|
+
<FontAwesome name='list-alt' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
206
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_ORDERS', 'My Orders')}</OText>
|
|
207
|
+
</ListItem>
|
|
208
|
+
)}
|
|
209
|
+
{isWalletEnabled && !hideWallet && (
|
|
192
210
|
<ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
193
211
|
<Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
194
212
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
|
|
195
213
|
</ListItem>
|
|
196
214
|
)}
|
|
197
|
-
{IsPromotionsEnabled && (
|
|
215
|
+
{IsPromotionsEnabled && !hidePromotions && (
|
|
198
216
|
<ListItem onPress={() => onRedirect('Promotions', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
199
217
|
<MaterialIcons name='local-offer' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
200
218
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('PROMOTIONS', 'Promotions')}</OText>
|
|
201
219
|
</ListItem>
|
|
202
220
|
)}
|
|
203
|
-
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
<
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
<
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
<
|
|
234
|
-
|
|
235
|
-
|
|
221
|
+
{!hideHelp && (
|
|
222
|
+
<ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
|
|
223
|
+
<OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
224
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
|
|
225
|
+
</ListItem>
|
|
226
|
+
)}
|
|
227
|
+
{showNotifications && (
|
|
228
|
+
<ListItem onPress={() => navigation.navigate('Notifications', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
229
|
+
<NotificationBadge style={{ borderRadius: 100 / 2 }} />
|
|
230
|
+
<Ionicons name='notifications-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
231
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MARKETING_NOTIFICATIONS', 'Marketing notifications')}
|
|
232
|
+
</OText>
|
|
233
|
+
<NotificationsWrapper>
|
|
234
|
+
<ToggleSwitch
|
|
235
|
+
isOn={user && (!!user?.settings?.notification?.newsletter ||
|
|
236
|
+
!!user?.settings?.sms?.newsletter ||
|
|
237
|
+
!!user?.settings?.email?.newsletter)}
|
|
238
|
+
onColor={theme.colors.primary}
|
|
239
|
+
size="small"
|
|
240
|
+
disabled={notificationsGroup?.loading}
|
|
241
|
+
offColor={theme.colors.disabled}
|
|
242
|
+
animationSpeed={400}
|
|
243
|
+
onToggle={() => handleChangePromotions(!(user && (!!user?.settings?.notification?.newsletter ||
|
|
244
|
+
!!user?.settings?.sms?.newsletter ||
|
|
245
|
+
!!user?.settings?.email?.newsletter)))}
|
|
246
|
+
/>
|
|
247
|
+
</NotificationsWrapper>
|
|
248
|
+
</ListItem>
|
|
249
|
+
)}
|
|
250
|
+
{!hideSession && (
|
|
251
|
+
<ListItem onPress={() => navigation.navigate('Sessions')} activeOpacity={0.7}>
|
|
252
|
+
<Ionicons name='md-list-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
253
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SESSIONS', 'Sessions')}</OText>
|
|
254
|
+
</ListItem>
|
|
255
|
+
)}
|
|
256
|
+
{!hideFavorites && (
|
|
257
|
+
<ListItem onPress={() => navigation.navigate('Favorite')} activeOpacity={0.7}>
|
|
258
|
+
<Ionicons name='heart-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
259
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('FAVORITES', 'Favorites')}</OText>
|
|
260
|
+
</ListItem>
|
|
261
|
+
)}
|
|
236
262
|
</Actions>
|
|
237
263
|
|
|
238
|
-
|
|
264
|
+
<Actions style={{ paddingTop: height * .02 }}>
|
|
239
265
|
{!showLanguages && (
|
|
240
266
|
<LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} />
|
|
241
267
|
)}
|
|
@@ -143,7 +143,7 @@ const WalletsUI = (props: any) => {
|
|
|
143
143
|
btnStyle={{ paddingLeft: 0 }}
|
|
144
144
|
hideArrowLeft={!hideWalletsTheme}
|
|
145
145
|
/>
|
|
146
|
-
{isChewLayout && (
|
|
146
|
+
{isChewLayout && !openHistory && (
|
|
147
147
|
<OButton
|
|
148
148
|
text={t('WALLET_HISTORY', 'Wallet history')}
|
|
149
149
|
bgColor={theme.colors.white}
|