ordering-ui-react-native 0.17.61 → 0.17.62
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/AddressDetails/index.tsx +9 -7
- package/themes/original/src/components/AddressForm/index.tsx +7 -1
- package/themes/original/src/components/BusinessController/index.tsx +66 -40
- package/themes/original/src/components/BusinessController/styles.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +27 -11
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +9 -8
- package/themes/original/src/components/Checkout/index.tsx +36 -53
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/MyOrders/index.tsx +42 -42
- package/themes/original/src/components/ProductForm/styles.tsx +2 -4
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -8
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +17 -21
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -0
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/original/src/types/index.tsx +4 -0
package/package.json
CHANGED
|
@@ -24,13 +24,15 @@ const AddressDetailsUI = (props: any) => {
|
|
|
24
24
|
return (
|
|
25
25
|
<ADContainer>
|
|
26
26
|
<ADHeader>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
{props.HeaderTitle ?? (
|
|
28
|
+
<OText
|
|
29
|
+
size={16}
|
|
30
|
+
lineHeight={24}
|
|
31
|
+
color={theme.colors.textNormal}
|
|
32
|
+
>
|
|
33
|
+
{t('DELIVERY_ADDRESS', 'Delivery address')}
|
|
34
|
+
</OText>
|
|
35
|
+
)}
|
|
34
36
|
</ADHeader>
|
|
35
37
|
{!!apiKey && (
|
|
36
38
|
<ADMap
|
|
@@ -65,6 +65,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
65
65
|
} = props;
|
|
66
66
|
|
|
67
67
|
const theme = useTheme();
|
|
68
|
+
const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
|
|
68
69
|
|
|
69
70
|
const tagsName = [
|
|
70
71
|
{ icon: theme.images.general.tag_home, value: 'home' },
|
|
@@ -104,6 +105,12 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
104
105
|
end: 0,
|
|
105
106
|
top: 12,
|
|
106
107
|
zIndex: 1002,
|
|
108
|
+
right: autoCompleteInputFocused && (
|
|
109
|
+
!!address?.address ||
|
|
110
|
+
!!formState.changes?.address ||
|
|
111
|
+
!!addressState.address.address
|
|
112
|
+
) ? 30 : 15,
|
|
113
|
+
width: 16
|
|
107
114
|
},
|
|
108
115
|
wrapperNavbar: Platform.OS === 'ios'
|
|
109
116
|
? { paddingVertical: 0, paddingHorizontal: 40 }
|
|
@@ -138,7 +145,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
138
145
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
139
146
|
const [isSignUpEffect, setIsSignUpEffect] = useState(false);
|
|
140
147
|
const [hasEditing, setAddressEditing] = useState(false);
|
|
141
|
-
const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
|
|
142
148
|
|
|
143
149
|
const googleInput: any = useRef(null);
|
|
144
150
|
const internalNumberRef: any = useRef(null);
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ToastType
|
|
12
12
|
} from 'ordering-components/native';
|
|
13
13
|
import { OIcon, OText } from '../shared';
|
|
14
|
-
import { StyleSheet, View } from 'react-native';
|
|
14
|
+
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
15
15
|
import { InView } from 'react-native-intersection-observer'
|
|
16
16
|
import { BusinessControllerParams } from '../../types';
|
|
17
17
|
import { convertHoursToMinutes, shape } from '../../utils';
|
|
@@ -40,6 +40,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
40
40
|
navigation,
|
|
41
41
|
isBusinessOpen,
|
|
42
42
|
style,
|
|
43
|
+
isCustomLayout,
|
|
43
44
|
businessHeader,
|
|
44
45
|
businessFeatured,
|
|
45
46
|
businessLogo,
|
|
@@ -51,6 +52,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
51
52
|
handleFavoriteBusiness,
|
|
52
53
|
enableIntersection
|
|
53
54
|
} = props;
|
|
55
|
+
|
|
54
56
|
const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] = useUtils();
|
|
55
57
|
const [, { showToast }] = useToast()
|
|
56
58
|
const [orderState] = useOrder();
|
|
@@ -58,14 +60,19 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
58
60
|
const [configState] = useConfig();
|
|
59
61
|
const [, t] = useLanguage();
|
|
60
62
|
const theme = useTheme()
|
|
63
|
+
const windowHeight = Dimensions.get('window').height
|
|
61
64
|
const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
|
|
62
65
|
|
|
66
|
+
const textSize = isCustomLayout ? 12 : 10
|
|
67
|
+
const cardHeight = windowHeight * 0.3
|
|
68
|
+
|
|
63
69
|
const styles = StyleSheet.create({
|
|
64
70
|
container: {
|
|
65
71
|
marginVertical: 20,
|
|
66
72
|
borderRadius: 7.6,
|
|
67
73
|
width: '100%',
|
|
68
|
-
position: 'relative'
|
|
74
|
+
position: 'relative',
|
|
75
|
+
height: cardHeight
|
|
69
76
|
},
|
|
70
77
|
headerStyle: {
|
|
71
78
|
borderTopLeftRadius: 7.6,
|
|
@@ -159,11 +166,8 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
159
166
|
<InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
|
|
160
167
|
{isIntersectionObserver ? (
|
|
161
168
|
<CardAnimation
|
|
169
|
+
style={[style, styles.container]}
|
|
162
170
|
onClick={() => handleBusinessClick(business)}
|
|
163
|
-
style={[
|
|
164
|
-
style,
|
|
165
|
-
styles.container
|
|
166
|
-
]}
|
|
167
171
|
>
|
|
168
172
|
{business?.ribbon?.enabled && (
|
|
169
173
|
<RibbonBox
|
|
@@ -185,7 +189,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
185
189
|
)}
|
|
186
190
|
<BusinessHero>
|
|
187
191
|
<FastImage
|
|
188
|
-
style={{ height: 120 }}
|
|
192
|
+
style={{ height: isCustomLayout ? cardHeight * 0.66 : 120 }}
|
|
189
193
|
source={(businessHeader || business?.header) ? {
|
|
190
194
|
uri: optimizeImage(businessHeader || business?.header, 'h_500,c_limit'),
|
|
191
195
|
priority: FastImage.priority.normal,
|
|
@@ -211,7 +215,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
211
215
|
</BusinessState>
|
|
212
216
|
</BusinessHero>
|
|
213
217
|
<BusinessContent>
|
|
214
|
-
<BusinessInfo>
|
|
218
|
+
<BusinessInfo style={isCustomLayout && { position: 'absolute', bottom: 85, left: 15 }}>
|
|
215
219
|
<BusinessLogo style={styles.businessLogo}>
|
|
216
220
|
<FastImage
|
|
217
221
|
style={{ width: 56, height: 56 }}
|
|
@@ -222,38 +226,60 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
222
226
|
resizeMode={FastImage.resizeMode.cover}
|
|
223
227
|
/>
|
|
224
228
|
</BusinessLogo>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
229
|
+
{!isCustomLayout && (
|
|
230
|
+
<ReviewAndFavorite>
|
|
231
|
+
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
|
|
232
|
+
<Reviews>
|
|
233
|
+
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
234
|
+
<OText size={10} style={{ lineHeight: 15 }}>
|
|
235
|
+
{parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
|
|
236
|
+
</OText>
|
|
237
|
+
</Reviews>
|
|
238
|
+
)}
|
|
239
|
+
<LottieAnimation
|
|
240
|
+
type='favorite'
|
|
241
|
+
onClick={handleChangeFavorite}
|
|
242
|
+
initialValue={business?.favorite ? 0.75 : 0}
|
|
243
|
+
toValue={business?.favorite ? 0 : 0.75}
|
|
244
|
+
disableAnimation={!auth}
|
|
245
|
+
iconProps={{ color: theme.colors.danger5, size: 18 }}
|
|
246
|
+
isActive={business?.favorite}
|
|
247
|
+
/>
|
|
248
|
+
</ReviewAndFavorite>
|
|
249
|
+
)}
|
|
244
250
|
</BusinessInfo>
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
<View style={isCustomLayout && { width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
|
|
252
|
+
<OText
|
|
253
|
+
size={textSize + 2}
|
|
254
|
+
style={{ lineHeight: 18, marginBottom: 6 }}
|
|
255
|
+
weight={'500'}>
|
|
256
|
+
{business?.name}
|
|
257
|
+
</OText>
|
|
258
|
+
{isCustomLayout && (
|
|
259
|
+
<ReviewAndFavorite>
|
|
260
|
+
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
|
|
261
|
+
<Reviews>
|
|
262
|
+
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
263
|
+
<OText size={10} style={{ lineHeight: 15 }}>
|
|
264
|
+
{parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
|
|
265
|
+
</OText>
|
|
266
|
+
</Reviews>
|
|
267
|
+
)}
|
|
268
|
+
<LottieAnimation
|
|
269
|
+
type='favorite'
|
|
270
|
+
onClick={handleChangeFavorite}
|
|
271
|
+
initialValue={business?.favorite ? 0.75 : 0}
|
|
272
|
+
toValue={business?.favorite ? 0 : 0.75}
|
|
273
|
+
disableAnimation={!auth}
|
|
274
|
+
iconProps={{ color: theme.colors.danger5, size: 18 }}
|
|
275
|
+
isActive={business?.favorite}
|
|
276
|
+
/>
|
|
277
|
+
</ReviewAndFavorite>
|
|
278
|
+
)}
|
|
279
|
+
</View>
|
|
280
|
+
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={isCustomLayout ? 1 : 2}>
|
|
252
281
|
{business?.address}
|
|
253
282
|
</OText>
|
|
254
|
-
{/* <BusinessCategory>
|
|
255
|
-
<OText>{getBusinessType()}</OText>
|
|
256
|
-
</BusinessCategory> */}
|
|
257
283
|
<Metadata>
|
|
258
284
|
{!isBusinessOpen ? (
|
|
259
285
|
<View style={styles.closed}>
|
|
@@ -264,16 +290,16 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
264
290
|
) : (
|
|
265
291
|
<View style={styles.bullet}>
|
|
266
292
|
{orderState?.options?.type === 1 && (
|
|
267
|
-
<OText size={
|
|
293
|
+
<OText size={textSize} color={theme.colors.textSecondary}>
|
|
268
294
|
{`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
|
|
269
295
|
</OText>
|
|
270
296
|
)}
|
|
271
|
-
<OText size={
|
|
297
|
+
<OText size={textSize} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
|
|
272
298
|
orderState?.options?.type === 1
|
|
273
299
|
? (businessDeliveryTime ?? business?.delivery_time)
|
|
274
300
|
: (businessPickupTime ?? business?.pickup_time),
|
|
275
301
|
)} \u2022 `}</OText>
|
|
276
|
-
<OText size={
|
|
302
|
+
<OText size={textSize} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
|
|
277
303
|
</View>
|
|
278
304
|
)}
|
|
279
305
|
</Metadata>
|
|
@@ -9,7 +9,7 @@ export const BusinessHero = styled.View`
|
|
|
9
9
|
|
|
10
10
|
export const BusinessContent = styled.View`
|
|
11
11
|
padding-horizontal: 18px;
|
|
12
|
-
padding-bottom:
|
|
12
|
+
padding-bottom: 10px;
|
|
13
13
|
border-bottom-left-radius: 7.6px;
|
|
14
14
|
border-bottom-right-radius: 7.6px;
|
|
15
15
|
border-width: 1px;
|
|
@@ -76,6 +76,8 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
76
76
|
{ text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
|
|
77
77
|
]
|
|
78
78
|
|
|
79
|
+
const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
|
|
80
|
+
|
|
79
81
|
const priceList = [
|
|
80
82
|
{ level: '1', content: '$' },
|
|
81
83
|
{ level: '2', content: '$$' },
|
|
@@ -97,7 +99,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
97
99
|
width: '100%'
|
|
98
100
|
},
|
|
99
101
|
searchInput: {
|
|
100
|
-
fontSize:
|
|
102
|
+
fontSize: 12,
|
|
101
103
|
},
|
|
102
104
|
productsContainer: {
|
|
103
105
|
marginTop: 20
|
|
@@ -231,6 +233,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
231
233
|
<SearchWrapper>
|
|
232
234
|
<SearchBar
|
|
233
235
|
lazyLoad
|
|
236
|
+
{...(isChewLayout && { height: 55 })}
|
|
234
237
|
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
|
|
235
238
|
placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
|
|
236
239
|
onSearch={(val: string) => handleChangeTermValue(val)}
|
|
@@ -255,6 +258,12 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
255
258
|
BusinessControllerSkeletons={BusinessControllerSkeletons}
|
|
256
259
|
businessPaginationProps={paginationProps}
|
|
257
260
|
franchiseId={brandId}
|
|
261
|
+
hideBackBtn
|
|
262
|
+
titleStyle={{
|
|
263
|
+
paddingHorizontal: 0,
|
|
264
|
+
marginTop: 0,
|
|
265
|
+
marginLeft: 0
|
|
266
|
+
}}
|
|
258
267
|
/>
|
|
259
268
|
)}
|
|
260
269
|
|
|
@@ -263,19 +272,26 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
263
272
|
{t('BUSINESSES', 'Businesses')}
|
|
264
273
|
</OText>
|
|
265
274
|
</OptionTitle>
|
|
266
|
-
<ScrollView horizontal>
|
|
275
|
+
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
267
276
|
{businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
|
|
268
|
-
<
|
|
277
|
+
<View
|
|
269
278
|
key={business.id}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
style={{
|
|
280
|
+
width: screenWidth - 120,
|
|
281
|
+
marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0
|
|
282
|
+
}}
|
|
283
|
+
>
|
|
284
|
+
<BusinessController
|
|
285
|
+
business={business}
|
|
286
|
+
isBusinessOpen={business.open}
|
|
287
|
+
enableIntersection={false}
|
|
288
|
+
handleCustomClick={() => onBusinessClick(business)}
|
|
289
|
+
handleUpdateBusinessList={handleUpdateBusinessList}
|
|
290
|
+
orderType={orderState?.options?.type}
|
|
291
|
+
/>
|
|
292
|
+
</View>
|
|
278
293
|
))}
|
|
294
|
+
{console.log(screenWidth)}
|
|
279
295
|
{!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
|
|
280
296
|
<LoadMoreBusinessContainer>
|
|
281
297
|
<OButton
|
|
@@ -314,10 +314,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
314
314
|
key={business?.id}
|
|
315
315
|
onPress={() => handleBusinessClick && handleBusinessClick(business)}
|
|
316
316
|
style={{
|
|
317
|
-
width:
|
|
318
|
-
height:
|
|
319
|
-
|
|
320
|
-
borderBottomWidth: business?.slug === actualSlug ? 2 : 0,
|
|
317
|
+
width: 60,
|
|
318
|
+
height: 60,
|
|
319
|
+
borderRadius: 8,
|
|
321
320
|
marginRight: 5
|
|
322
321
|
}}
|
|
323
322
|
>
|
|
@@ -326,8 +325,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
326
325
|
width: 56,
|
|
327
326
|
height: 56,
|
|
328
327
|
marginRight: 20,
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
borderRadius: 8,
|
|
329
|
+
borderColor: theme.colors.primary,
|
|
330
|
+
borderWidth: business?.slug === actualSlug ? 2 : 0
|
|
331
331
|
}}
|
|
332
332
|
source={{
|
|
333
333
|
uri: business?.logo,
|
|
@@ -370,8 +370,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
370
370
|
>
|
|
371
371
|
{isChewLayout && (
|
|
372
372
|
<View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
373
|
-
<OText size={
|
|
374
|
-
{t('WELCOME', 'Welcome')} {user?.name}
|
|
373
|
+
<OText size={24} weight={700} color={theme.colors?.white}>
|
|
374
|
+
{t('WELCOME', 'Welcome')} {user?.name}
|
|
375
375
|
</OText>
|
|
376
376
|
</View>
|
|
377
377
|
)}
|
|
@@ -575,6 +575,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
575
575
|
<BusinessController
|
|
576
576
|
key={`${business.id}_` + i}
|
|
577
577
|
enableIntersection
|
|
578
|
+
isCustomLayout={isChewLayout}
|
|
578
579
|
business={business}
|
|
579
580
|
isBusinessOpen={business.open}
|
|
580
581
|
handleCustomClick={handleBusinessClick}
|
|
@@ -153,6 +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
|
+
const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
|
|
156
157
|
|
|
157
158
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
158
159
|
const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
|
|
@@ -162,7 +163,6 @@ const CheckoutUI = (props: any) => {
|
|
|
162
163
|
}, cart?.subtotal)
|
|
163
164
|
const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) ||
|
|
164
165
|
placing || errorCash || subtotalWithTaxes < cart?.minimum ||
|
|
165
|
-
// (placeSpotTypes.includes(options?.type) && !cart?.place) ||
|
|
166
166
|
(options.type === 1 &&
|
|
167
167
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
168
168
|
validationFields?.fields?.checkout?.driver_tip?.required &&
|
|
@@ -268,10 +268,6 @@ const CheckoutUI = (props: any) => {
|
|
|
268
268
|
}
|
|
269
269
|
}, [errors])
|
|
270
270
|
|
|
271
|
-
// useEffect(() => {
|
|
272
|
-
// handlePaymethodChange(null)
|
|
273
|
-
// }, [cart?.total])
|
|
274
|
-
|
|
275
271
|
useEffect(() => {
|
|
276
272
|
if (cart?.products?.length === 0) {
|
|
277
273
|
onNavigationRedirect('Business', { store: cart?.business?.slug, header: null, logo: null })
|
|
@@ -282,6 +278,21 @@ const CheckoutUI = (props: any) => {
|
|
|
282
278
|
onFailPaypal()
|
|
283
279
|
}, [showGateway.closedByUser])
|
|
284
280
|
|
|
281
|
+
const HeaderTitle = (props: any) => {
|
|
282
|
+
const { text } = props
|
|
283
|
+
return (
|
|
284
|
+
<OText
|
|
285
|
+
size={16}
|
|
286
|
+
lineHeight={24}
|
|
287
|
+
weight={'500'}
|
|
288
|
+
mBottom={props.mb ?? 10}
|
|
289
|
+
color={theme.colors.textNormal}
|
|
290
|
+
>
|
|
291
|
+
{text}
|
|
292
|
+
</OText>
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
|
|
285
296
|
return (
|
|
286
297
|
<>
|
|
287
298
|
<Container noPadding>
|
|
@@ -299,13 +310,20 @@ const CheckoutUI = (props: any) => {
|
|
|
299
310
|
<ChContainer style={styles.pagePadding}>
|
|
300
311
|
<ChSection style={{ paddingTop: 0 }}>
|
|
301
312
|
<ChHeader>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
313
|
+
<CHMomentWrapper isCustomColor={isChewLayout} onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
|
|
314
|
+
<OText
|
|
315
|
+
size={12}
|
|
316
|
+
numberOfLines={1}
|
|
317
|
+
ellipsizeMode={'tail'}
|
|
318
|
+
color={theme.colors?.[isChewLayout ? 'white' : 'textSecondary']}
|
|
319
|
+
>
|
|
320
|
+
{t(getTypesText(options?.type || 1), 'Delivery')}
|
|
321
|
+
</OText>
|
|
305
322
|
<OIcon
|
|
306
323
|
src={theme.images.general.arrow_down}
|
|
307
324
|
width={10}
|
|
308
325
|
style={{ marginStart: 8 }}
|
|
326
|
+
{...(isChewLayout && { color: 'white' })}
|
|
309
327
|
/>
|
|
310
328
|
</CHMomentWrapper>
|
|
311
329
|
<CHMomentWrapper
|
|
@@ -348,9 +366,7 @@ const CheckoutUI = (props: any) => {
|
|
|
348
366
|
Object.values(businessDetails?.business).length > 0 &&
|
|
349
367
|
(
|
|
350
368
|
<>
|
|
351
|
-
<
|
|
352
|
-
{t('BUSINESS_DETAILS', 'Business Details')}
|
|
353
|
-
</OText>
|
|
369
|
+
<HeaderTitle text={t('BUSINESS_DETAILS', 'Business Details')} />
|
|
354
370
|
<View>
|
|
355
371
|
<OText size={12} lineHeight={18} weight={'400'}>
|
|
356
372
|
{businessDetails?.business?.name}
|
|
@@ -369,9 +385,7 @@ const CheckoutUI = (props: any) => {
|
|
|
369
385
|
)}
|
|
370
386
|
{businessDetails?.error && businessDetails?.error?.length > 0 && (
|
|
371
387
|
<View>
|
|
372
|
-
<
|
|
373
|
-
{t('BUSINESS_DETAILS', 'Business Details')}
|
|
374
|
-
</OText>
|
|
388
|
+
<HeaderTitle text={t('BUSINESS_DETAILS', 'Business Details')} />
|
|
375
389
|
<NotFoundSource
|
|
376
390
|
content={businessDetails?.error[0]?.message || businessDetails?.error[0]}
|
|
377
391
|
/>
|
|
@@ -393,6 +407,7 @@ const CheckoutUI = (props: any) => {
|
|
|
393
407
|
) : (
|
|
394
408
|
<UserDetails
|
|
395
409
|
isUserDetailsEdit={isUserDetailsEdit}
|
|
410
|
+
HeaderTitle={<HeaderTitle text={t('CUSTOMER_DETAILS', 'Customer Details')} mb={0} />}
|
|
396
411
|
cartStatus={cart?.status}
|
|
397
412
|
businessId={cart?.business_id}
|
|
398
413
|
useValidationFields
|
|
@@ -417,8 +432,8 @@ const CheckoutUI = (props: any) => {
|
|
|
417
432
|
</Placeholder>
|
|
418
433
|
</View>
|
|
419
434
|
) : (
|
|
420
|
-
|
|
421
|
-
<
|
|
435
|
+
<ChSection>
|
|
436
|
+
<HeaderTitle text={t('DELIVERY_OPTIONS', 'Delivery options')} />
|
|
422
437
|
<View
|
|
423
438
|
style={{
|
|
424
439
|
backgroundColor: theme.colors.inputDisabled,
|
|
@@ -464,7 +479,7 @@ const CheckoutUI = (props: any) => {
|
|
|
464
479
|
/>
|
|
465
480
|
</View>
|
|
466
481
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
|
|
467
|
-
|
|
482
|
+
</ChSection>
|
|
468
483
|
)}
|
|
469
484
|
|
|
470
485
|
</DeliveryOptionsContainer>
|
|
@@ -486,29 +501,6 @@ const CheckoutUI = (props: any) => {
|
|
|
486
501
|
</ChSection>
|
|
487
502
|
)}
|
|
488
503
|
|
|
489
|
-
{/* <ChSection>
|
|
490
|
-
<ChTotal>
|
|
491
|
-
{
|
|
492
|
-
(
|
|
493
|
-
<>
|
|
494
|
-
<OIcon
|
|
495
|
-
url={businessLogo || businessDetails?.business?.logo}
|
|
496
|
-
width={80}
|
|
497
|
-
height={80}
|
|
498
|
-
borderRadius={80}
|
|
499
|
-
/>
|
|
500
|
-
<View style={{ marginLeft: 10, width: '85%' }}>
|
|
501
|
-
<OText size={22} numberOfLines={2} ellipsizeMode='tail' style={{ width: '85%' }}>
|
|
502
|
-
{businessName || businessDetails?.business?.name}
|
|
503
|
-
</OText>
|
|
504
|
-
<OText size={22}>
|
|
505
|
-
{cart?.total >= 1 && parsePrice(cart?.total) || cartTotal >= 1 && parsePrice(cartTotal)}
|
|
506
|
-
</OText>
|
|
507
|
-
</View>
|
|
508
|
-
</>
|
|
509
|
-
)}
|
|
510
|
-
</ChTotal>
|
|
511
|
-
</ChSection> */}
|
|
512
504
|
<ChSection>
|
|
513
505
|
<ChAddress>
|
|
514
506
|
{(businessDetails?.loading || cartState.loading) ? (
|
|
@@ -525,6 +517,7 @@ const CheckoutUI = (props: any) => {
|
|
|
525
517
|
uuid={cartUuid}
|
|
526
518
|
apiKey={configs?.google_maps_api_key?.value}
|
|
527
519
|
mapConfigs={mapConfigs}
|
|
520
|
+
HeaderTitle={<HeaderTitle text={t('DELIVERY_ADDRESS', 'Delivery address')} mb={0} />}
|
|
528
521
|
/>
|
|
529
522
|
)}
|
|
530
523
|
</ChAddress>
|
|
@@ -541,9 +534,7 @@ const CheckoutUI = (props: any) => {
|
|
|
541
534
|
(
|
|
542
535
|
<ChSection>
|
|
543
536
|
<ChDriverTips>
|
|
544
|
-
<
|
|
545
|
-
{t('DRIVER_TIPS', 'Driver Tips')}
|
|
546
|
-
</OText>
|
|
537
|
+
<HeaderTitle text={t('DRIVER_TIPS', 'Driver Tips')} mb={0} />
|
|
547
538
|
<DriverTips
|
|
548
539
|
uuid={cartUuid}
|
|
549
540
|
businessId={cart?.business_id}
|
|
@@ -562,9 +553,7 @@ const CheckoutUI = (props: any) => {
|
|
|
562
553
|
{!cartState.loading && cart && cart?.status !== 2 && cart?.valid && (
|
|
563
554
|
<ChSection>
|
|
564
555
|
<ChPaymethods>
|
|
565
|
-
<
|
|
566
|
-
{t('PAYMENT_METHOD', 'Payment Method')}
|
|
567
|
-
</OText>
|
|
556
|
+
<HeaderTitle text={t('PAYMENT_METHOD', 'Payment Method')} mb={0} />
|
|
568
557
|
{!cartState.loading && cart?.status === 4 && (
|
|
569
558
|
<OText
|
|
570
559
|
style={{ textAlign: 'center', marginTop: 20 }}
|
|
@@ -630,13 +619,7 @@ const CheckoutUI = (props: any) => {
|
|
|
630
619
|
) : (
|
|
631
620
|
<>
|
|
632
621
|
<CartHeader>
|
|
633
|
-
<
|
|
634
|
-
size={16}
|
|
635
|
-
lineHeight={24}
|
|
636
|
-
color={theme.colors.textNormal}
|
|
637
|
-
>
|
|
638
|
-
{t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}
|
|
639
|
-
</OText>
|
|
622
|
+
<HeaderTitle text={t('MOBILE_FRONT_YOUR_ORDER', 'Your order')} mb={0} />
|
|
640
623
|
<TouchableOpacity
|
|
641
624
|
onPress={() => onNavigationRedirect('Business', { store: cart?.business?.slug })}
|
|
642
625
|
>
|
|
@@ -6,7 +6,7 @@ export const ChContainer = styled.View`
|
|
|
6
6
|
`
|
|
7
7
|
|
|
8
8
|
export const ChSection = styled.View`
|
|
9
|
-
padding-top:
|
|
9
|
+
padding-top: 20px;
|
|
10
10
|
`
|
|
11
11
|
|
|
12
12
|
export const ChHeader = styled.View`
|
|
@@ -40,7 +40,9 @@ export const ChMoment = styled(ChAddress)`
|
|
|
40
40
|
`
|
|
41
41
|
|
|
42
42
|
export const CHMomentWrapper = styled.TouchableOpacity`
|
|
43
|
-
background-color: ${(props: any) => props.
|
|
43
|
+
background-color: ${(props: any) => props.isCustomColor
|
|
44
|
+
? props.theme.colors.primary
|
|
45
|
+
: props.theme.colors.backgroundGray100};
|
|
44
46
|
border-radius: 7.6px;
|
|
45
47
|
font-size: 12px;
|
|
46
48
|
max-width: 240px;
|