ordering-ui-react-native 0.17.74 → 0.17.75
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/AddressList/index.tsx +14 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +2 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +4 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -3
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/CartContent/index.tsx +5 -1
- package/themes/original/src/components/CartContent/styles.tsx +1 -1
- package/themes/original/src/components/Checkout/index.tsx +2 -1
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
- package/themes/original/src/components/HelpGuide/index.tsx +6 -6
- package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +6 -15
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/MyOrders/index.tsx +6 -8
- package/themes/original/src/components/NavBar/index.tsx +2 -7
- package/themes/original/src/components/Notifications/index.tsx +42 -52
- package/themes/original/src/components/Notifications/styles.tsx +8 -1
- package/themes/original/src/components/ProductForm/index.tsx +11 -3
- package/themes/original/src/components/ProductForm/styles.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +3 -5
- package/themes/original/src/components/UserProfileForm/index.tsx +10 -21
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/Wallets/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { AddressList as AddressListController, useLanguage, useOrder, useSession } from 'ordering-components/native'
|
|
3
|
-
import {
|
|
3
|
+
import { AddressItem, Container } from './styles'
|
|
4
4
|
import { Platform, RefreshControl, StyleSheet, View } from 'react-native'
|
|
5
5
|
import { OButton, OText, OAlert, OModal, OIcon } from '../shared'
|
|
6
|
-
import { Container } from '../../layouts/Container'
|
|
7
6
|
import { AddressListParams } from '../../types'
|
|
8
7
|
import { NotFoundSource } from '../NotFoundSource'
|
|
9
8
|
import NavBar from '../NavBar'
|
|
@@ -139,8 +138,6 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
139
138
|
|
|
140
139
|
return (
|
|
141
140
|
<Container
|
|
142
|
-
pt={20}
|
|
143
|
-
noPadding
|
|
144
141
|
refreshControl={
|
|
145
142
|
<RefreshControl
|
|
146
143
|
refreshing={refreshing}
|
|
@@ -148,20 +145,18 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
148
145
|
/>
|
|
149
146
|
}
|
|
150
147
|
>
|
|
151
|
-
{isProfile && (
|
|
152
|
-
<NavBar
|
|
153
|
-
title={t('SAVED_PLACES', 'My saved places')}
|
|
154
|
-
titleAlign={'center'}
|
|
155
|
-
onActionLeft={goToBack}
|
|
156
|
-
showCall={false}
|
|
157
|
-
style={{
|
|
158
|
-
paddingHorizontal: 40,
|
|
159
|
-
marginTop: Platform.OS === 'ios' ? 0 : 10
|
|
160
|
-
}}
|
|
161
|
-
/>
|
|
162
|
-
)}
|
|
163
148
|
{(!addressList.loading || (isFromProductsList || isFromBusinesses || isFromProfile || isProfile)) && (
|
|
164
|
-
|
|
149
|
+
<>
|
|
150
|
+
{isProfile && (
|
|
151
|
+
<NavBar
|
|
152
|
+
title={t('SAVED_PLACES', 'My saved places')}
|
|
153
|
+
titleAlign={'center'}
|
|
154
|
+
onActionLeft={goToBack}
|
|
155
|
+
showCall={false}
|
|
156
|
+
paddingTop={10}
|
|
157
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
158
|
+
/>
|
|
159
|
+
)}
|
|
165
160
|
{
|
|
166
161
|
route &&
|
|
167
162
|
(
|
|
@@ -327,7 +322,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
327
322
|
/>
|
|
328
323
|
</>
|
|
329
324
|
)}
|
|
330
|
-
|
|
325
|
+
</>
|
|
326
|
+
|
|
331
327
|
)}
|
|
332
328
|
</Container>
|
|
333
329
|
)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Container = styled.ScrollView`
|
|
4
|
+
position: relative;
|
|
4
5
|
flex: 1;
|
|
5
6
|
paddingLeft: 40px;
|
|
6
7
|
paddingRight: 40px;
|
|
7
|
-
|
|
8
|
+
margin-bottom: 40px;
|
|
9
|
+
padding-top: 10px;
|
|
8
10
|
`
|
|
9
11
|
|
|
10
12
|
export const AddressItem = styled.TouchableOpacity`
|
|
@@ -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
|
-
const isChewLayout = theme?.
|
|
49
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
50
50
|
const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
51
51
|
|
|
52
52
|
const styles = StyleSheet.create({
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ToastType
|
|
12
12
|
} from 'ordering-components/native';
|
|
13
13
|
import { OIcon, OText } from '../shared';
|
|
14
|
-
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
14
|
+
import { Dimensions, StyleSheet, Vibration, 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';
|
|
@@ -142,6 +142,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
const handleBusinessClick = (selectedBusiness: any) => {
|
|
145
|
+
Vibration.vibrate()
|
|
145
146
|
if (business?.open) handleClick && handleClick(selectedBusiness)
|
|
146
147
|
else {
|
|
147
148
|
if (configState?.configs?.preorder_status_enabled?.value === '1') {
|
|
@@ -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?.
|
|
79
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
80
80
|
|
|
81
81
|
const priceList = [
|
|
82
82
|
{ level: '1', content: '$' },
|
|
@@ -229,7 +229,9 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
229
229
|
}, [isFocused])
|
|
230
230
|
|
|
231
231
|
return (
|
|
232
|
-
<BContainer
|
|
232
|
+
<BContainer
|
|
233
|
+
style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
|
|
234
|
+
>
|
|
233
235
|
<SearchWrapper>
|
|
234
236
|
<SearchBar
|
|
235
237
|
lazyLoad
|
|
@@ -82,7 +82,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
82
82
|
const isFocused = useIsFocused();
|
|
83
83
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
84
84
|
|
|
85
|
-
const isChewLayout = theme?.
|
|
85
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
86
86
|
const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
87
87
|
const hideBusinessNearCity = theme?.business_view?.components?.near_business?.hidden ?? true
|
|
88
88
|
|
|
@@ -139,7 +139,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
139
139
|
|
|
140
140
|
const currentCart: any = Object.values(orderState.carts).find((cart: any) => cart?.business?.slug === business?.slug) ?? {}
|
|
141
141
|
const isOpenFiltProducts = isOpenSearchBar && !!searchValue
|
|
142
|
-
const filtProductsHeight = Platform.OS === 'ios' ?
|
|
142
|
+
const filtProductsHeight = Platform.OS === 'ios' ? 165 : 100
|
|
143
143
|
const onRedirect = (route: string, params?: any) => {
|
|
144
144
|
navigation.navigate(route, params)
|
|
145
145
|
}
|
|
@@ -458,6 +458,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
458
458
|
<>
|
|
459
459
|
<WrapContent
|
|
460
460
|
onLayout={(event: any) => setProductListLayout(event.nativeEvent.layout)}
|
|
461
|
+
style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
|
|
461
462
|
>
|
|
462
463
|
<BusinessProductsList
|
|
463
464
|
categories={[
|
|
@@ -515,7 +516,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
515
516
|
)}
|
|
516
517
|
</IOScrollView>
|
|
517
518
|
{!loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0 && (
|
|
518
|
-
<View style={{ marginBottom: 0
|
|
519
|
+
<View style={{ marginBottom: 0 }}>
|
|
519
520
|
<FloatingButton
|
|
520
521
|
btnText={
|
|
521
522
|
openUpselling
|
|
@@ -571,6 +572,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
571
572
|
professionalList={business?.professionals}
|
|
572
573
|
professionalSelected={professionalSelected}
|
|
573
574
|
handleChangeProfessional={handleChangeProfessionalSelected}
|
|
575
|
+
handleChangeProfessional={handleChangeProfessionalSelected}
|
|
574
576
|
handleUpdateProfessionals={handleUpdateProfessionals}
|
|
575
577
|
onSave={() => setOpenService(false)}
|
|
576
578
|
onClose={() => setOpenService(false)}
|
|
@@ -557,7 +557,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
557
557
|
<PageBanner position='app_business_listing' />
|
|
558
558
|
|
|
559
559
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
560
|
-
<ListWrapper>
|
|
560
|
+
<ListWrapper ph={isChewLayout && 20}>
|
|
561
561
|
{!businessId && (
|
|
562
562
|
<BusinessTypeFilter
|
|
563
563
|
images={props.images}
|
|
@@ -67,7 +67,7 @@ export const HeaderWrapper = styled.ImageBackground`
|
|
|
67
67
|
|
|
68
68
|
export const ListWrapper = styled.View`
|
|
69
69
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
70
|
-
padding-horizontal:
|
|
70
|
+
padding-horizontal: ${(props: any) => props.ph ?? 40}px;
|
|
71
71
|
`;
|
|
72
72
|
|
|
73
73
|
export const FeaturedWrapper = styled.View`
|
|
@@ -19,8 +19,12 @@ export const CartContent = (props: any) => {
|
|
|
19
19
|
const [, t] = useLanguage()
|
|
20
20
|
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
21
21
|
|
|
22
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
23
|
+
|
|
22
24
|
return (
|
|
23
|
-
<CCContainer
|
|
25
|
+
<CCContainer
|
|
26
|
+
style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
|
|
27
|
+
>
|
|
24
28
|
{isOrderStateCarts && carts?.length > 0 && (
|
|
25
29
|
<>
|
|
26
30
|
{carts.map((cart: any, i: number) => (
|
|
@@ -154,7 +154,7 @@ const CheckoutUI = (props: any) => {
|
|
|
154
154
|
const isWalletCreditPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
|
|
155
155
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletCreditPointsEnabled)
|
|
156
156
|
const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
|
|
157
|
-
const isChewLayout = theme?.
|
|
157
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
158
158
|
|
|
159
159
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
160
160
|
const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
|
|
@@ -191,6 +191,7 @@ const CheckoutUI = (props: any) => {
|
|
|
191
191
|
|
|
192
192
|
const handlePlaceOrder = (confirmPayment: any, forcePlace: boolean = false) => {
|
|
193
193
|
if (!userErrors.length && !requiredFields?.length || forcePlace) {
|
|
194
|
+
Vibration.vibrate()
|
|
194
195
|
handlerClickPlaceOrder && handlerClickPlaceOrder(null, null, confirmPayment)
|
|
195
196
|
return
|
|
196
197
|
}
|
|
@@ -9,8 +9,9 @@ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
Content,
|
|
12
|
-
|
|
12
|
+
Container
|
|
13
13
|
} from './styles'
|
|
14
|
+
import NavBar from '../NavBar'
|
|
14
15
|
|
|
15
16
|
export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
16
17
|
const {
|
|
@@ -20,15 +21,6 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
20
21
|
const theme = useTheme()
|
|
21
22
|
|
|
22
23
|
const styles = StyleSheet.create({
|
|
23
|
-
btnBackArrow: {
|
|
24
|
-
borderWidth: 0,
|
|
25
|
-
backgroundColor: theme.colors.white,
|
|
26
|
-
borderColor: theme.colors.white,
|
|
27
|
-
shadowColor: theme.colors.white,
|
|
28
|
-
display: 'flex',
|
|
29
|
-
justifyContent: 'flex-start',
|
|
30
|
-
paddingLeft: 0,
|
|
31
|
-
},
|
|
32
24
|
imageStyle: {
|
|
33
25
|
width: '100%',
|
|
34
26
|
height: 300,
|
|
@@ -39,26 +31,13 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
39
31
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
40
32
|
|
|
41
33
|
return (
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
iconProps={{
|
|
50
|
-
name: 'arrowleft',
|
|
51
|
-
size: 26
|
|
52
|
-
}}
|
|
53
|
-
/>
|
|
54
|
-
<OText
|
|
55
|
-
size={24}
|
|
56
|
-
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
57
|
-
color={theme.colors.textNormal}
|
|
58
|
-
>
|
|
59
|
-
{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}
|
|
60
|
-
</OText>
|
|
61
|
-
</HeaderWrapper>
|
|
34
|
+
<Container>
|
|
35
|
+
<NavBar
|
|
36
|
+
title={t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}
|
|
37
|
+
onActionLeft={goToBack}
|
|
38
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
39
|
+
showCall={false}
|
|
40
|
+
/>
|
|
62
41
|
<Content>
|
|
63
42
|
<OText mBottom={20}>
|
|
64
43
|
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vel in congue nisl, nisi. Mauris, condimentum auctor sed cras cursus arcu pellentesque.
|
|
@@ -78,6 +57,6 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
78
57
|
cover
|
|
79
58
|
/>
|
|
80
59
|
</Content>
|
|
81
|
-
|
|
60
|
+
</Container>
|
|
82
61
|
)
|
|
83
62
|
}
|
|
@@ -4,7 +4,9 @@ export const Content = styled.View`
|
|
|
4
4
|
padding-vertical: 20px;
|
|
5
5
|
margin-bottom: 20px;
|
|
6
6
|
`
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
export const Container = styled.ScrollView`
|
|
9
|
+
position: relative;
|
|
10
|
+
flex: 1;
|
|
11
|
+
margin: 10px 0;
|
|
10
12
|
`
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components/native'
|
|
3
3
|
import { HelpGuideParams } from '../../types'
|
|
4
|
-
import { OText,
|
|
4
|
+
import { OText, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet
|
|
6
|
+
import { StyleSheet } from 'react-native'
|
|
7
7
|
import NavBar from '../NavBar'
|
|
8
8
|
import {
|
|
9
|
-
Content
|
|
9
|
+
Content,
|
|
10
|
+
Container
|
|
10
11
|
} from './styles'
|
|
11
|
-
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
12
12
|
|
|
13
13
|
export const HelpGuide = (props: HelpGuideParams) => {
|
|
14
14
|
const {
|
|
@@ -37,7 +37,7 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
37
37
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
|
-
|
|
40
|
+
<Container>
|
|
41
41
|
<NavBar
|
|
42
42
|
title={t('GUIDE_TO_ORDERING', 'Guide to Ordering')}
|
|
43
43
|
onActionLeft={goToBack}
|
|
@@ -63,6 +63,6 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
63
63
|
cover
|
|
64
64
|
/>
|
|
65
65
|
</Content>
|
|
66
|
-
|
|
66
|
+
</Container>
|
|
67
67
|
)
|
|
68
68
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components/native'
|
|
3
3
|
import { HelpOrderParams } from '../../types'
|
|
4
|
-
import { OText,
|
|
4
|
+
import { OText, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet
|
|
6
|
+
import { StyleSheet } from 'react-native'
|
|
7
7
|
import { WebView } from 'react-native-webview'
|
|
8
|
-
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
9
8
|
import NavBar from '../NavBar'
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
|
-
Content
|
|
11
|
+
Content,
|
|
12
|
+
Container
|
|
13
13
|
} from './styles'
|
|
14
14
|
|
|
15
15
|
export const HelpOrder = (props: HelpOrderParams) => {
|
|
@@ -20,15 +20,6 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
20
20
|
const theme = useTheme()
|
|
21
21
|
|
|
22
22
|
const styles = StyleSheet.create({
|
|
23
|
-
btnBackArrow: {
|
|
24
|
-
borderWidth: 0,
|
|
25
|
-
backgroundColor: theme.colors.white,
|
|
26
|
-
borderColor: theme.colors.white,
|
|
27
|
-
shadowColor: theme.colors.white,
|
|
28
|
-
display: 'flex',
|
|
29
|
-
justifyContent: 'flex-start',
|
|
30
|
-
paddingLeft: 0,
|
|
31
|
-
},
|
|
32
23
|
imageStyle: {
|
|
33
24
|
width: '100%',
|
|
34
25
|
height: 120
|
|
@@ -42,7 +33,7 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
42
33
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
43
34
|
|
|
44
35
|
return (
|
|
45
|
-
|
|
36
|
+
<Container>
|
|
46
37
|
<NavBar
|
|
47
38
|
title={t('HELP_WITH_ORDER', 'Help with an order')}
|
|
48
39
|
onActionLeft={goToBack}
|
|
@@ -75,6 +66,6 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
75
66
|
style={styles.videoStyle}
|
|
76
67
|
/>
|
|
77
68
|
</Content>
|
|
78
|
-
|
|
69
|
+
</Container>
|
|
79
70
|
)
|
|
80
71
|
}
|
|
@@ -35,7 +35,7 @@ export const MyOrders = (props: any) => {
|
|
|
35
35
|
{ key: 'business', value: t('BUSINESS', 'Business') },
|
|
36
36
|
{ key: 'products', value: t('PRODUCTS', 'Products') }
|
|
37
37
|
]
|
|
38
|
-
const isChewLayout = theme?.
|
|
38
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
39
39
|
const showNavbar = theme?.bar_menu?.components?.orders?.hidden
|
|
40
40
|
|
|
41
41
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
@@ -68,7 +68,6 @@ export const MyOrders = (props: any) => {
|
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
70
|
<Container
|
|
71
|
-
pt={0}
|
|
72
71
|
noPadding
|
|
73
72
|
refreshControl={
|
|
74
73
|
<RefreshControl
|
|
@@ -84,12 +83,11 @@ export const MyOrders = (props: any) => {
|
|
|
84
83
|
display: 'flex',
|
|
85
84
|
flexDirection: 'row',
|
|
86
85
|
alignItems: 'center',
|
|
87
|
-
paddingHorizontal: 40,
|
|
88
|
-
marginTop: Platform.OS === 'android' ? 50 : 30,
|
|
86
|
+
paddingHorizontal: isChewLayout ? 20 : 40,
|
|
89
87
|
},
|
|
90
88
|
...props.titleStyle
|
|
91
89
|
}}>
|
|
92
|
-
{!props.hideBackBtn && (
|
|
90
|
+
{!props.hideBackBtn && !isChewLayout && (
|
|
93
91
|
<OButton
|
|
94
92
|
imgLeftStyle={{ width: 18 }}
|
|
95
93
|
imgRightSrc={null}
|
|
@@ -121,7 +119,7 @@ export const MyOrders = (props: any) => {
|
|
|
121
119
|
<ScrollView
|
|
122
120
|
horizontal
|
|
123
121
|
style={{ ...styles.container, borderBottomWidth: 1 }}
|
|
124
|
-
contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 40 }}
|
|
122
|
+
contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : isChewLayout ? 20 : 40 }}
|
|
125
123
|
showsHorizontalScrollIndicator={false}
|
|
126
124
|
scrollEventThrottle={16}
|
|
127
125
|
>
|
|
@@ -146,7 +144,7 @@ export const MyOrders = (props: any) => {
|
|
|
146
144
|
{selectedOption === 'orders' && (
|
|
147
145
|
<>
|
|
148
146
|
{ordersLength?.activeOrdersLength > 0 && (
|
|
149
|
-
<View style={{
|
|
147
|
+
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
150
148
|
<OrdersOption
|
|
151
149
|
{...props}
|
|
152
150
|
activeOrders
|
|
@@ -157,7 +155,7 @@ export const MyOrders = (props: any) => {
|
|
|
157
155
|
/>
|
|
158
156
|
</View>
|
|
159
157
|
)}
|
|
160
|
-
<View style={{
|
|
158
|
+
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
161
159
|
<OrdersOption
|
|
162
160
|
{...props}
|
|
163
161
|
ordersLength={ordersLength}
|
|
@@ -63,16 +63,11 @@ const NavBar = (props: Props) => {
|
|
|
63
63
|
return (
|
|
64
64
|
<Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
|
|
65
65
|
<OButton
|
|
66
|
-
imgLeftSrc={
|
|
67
|
-
imgLeftStyle={{ width:
|
|
66
|
+
imgLeftSrc={theme.images.general.arrow_left}
|
|
67
|
+
imgLeftStyle={{ width: 26 }}
|
|
68
68
|
imgRightSrc={null}
|
|
69
69
|
style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
|
|
70
70
|
onClick={props?.onActionLeft}
|
|
71
|
-
icon={AntDesignIcon}
|
|
72
|
-
iconProps={{
|
|
73
|
-
name: 'arrowleft',
|
|
74
|
-
size: 26
|
|
75
|
-
}}
|
|
76
71
|
/>
|
|
77
72
|
<TitleTopWrapper>
|
|
78
73
|
{props.withIcon
|
|
@@ -7,13 +7,12 @@ import {
|
|
|
7
7
|
useToast,
|
|
8
8
|
ToastType,
|
|
9
9
|
} from 'ordering-components/native'
|
|
10
|
-
import { NotificationsGroupSwitchWrapper, SwitchWrapper } from './styles'
|
|
11
|
-
import {
|
|
10
|
+
import { NotificationsGroupSwitchWrapper, SwitchWrapper, Container } from './styles'
|
|
11
|
+
import { StyleSheet, View } from 'react-native'
|
|
12
12
|
import { useState } from 'react'
|
|
13
13
|
import { useTheme } from 'styled-components/native';
|
|
14
14
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
15
15
|
import ToggleSwitch from 'toggle-switch-react-native'
|
|
16
|
-
import { Container } from '../../layouts/Container'
|
|
17
16
|
import NavBar from '../NavBar'
|
|
18
17
|
import { OText } from '../shared'
|
|
19
18
|
|
|
@@ -70,10 +69,7 @@ const NotificationsUI = (props: any) => {
|
|
|
70
69
|
}, [notificationsList])
|
|
71
70
|
|
|
72
71
|
return (
|
|
73
|
-
<Container
|
|
74
|
-
noPadding
|
|
75
|
-
pt={10}
|
|
76
|
-
>
|
|
72
|
+
<Container>
|
|
77
73
|
<NavBar
|
|
78
74
|
title={t('NOTIFICATIONS', 'Notifications')}
|
|
79
75
|
titleAlign={'center'}
|
|
@@ -87,47 +83,45 @@ const NotificationsUI = (props: any) => {
|
|
|
87
83
|
{showCustomerPromotions && showNotifications && (
|
|
88
84
|
<>
|
|
89
85
|
<Spinner visible={singleNotifications?.loading} />
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
</NotificationsGroupSwitchWrapper>
|
|
130
|
-
</View>
|
|
86
|
+
<NotificationsGroupSwitchWrapper>
|
|
87
|
+
<OText style={{ ...styles.title }}>{t('MARKETING_NOTIFICATIONS', 'Marketing Notifications')}</OText>
|
|
88
|
+
<SwitchWrapper>
|
|
89
|
+
<OText>{t('EMAILS', 'Emails')}</OText>
|
|
90
|
+
<ToggleSwitch
|
|
91
|
+
isOn={notificationsList?.email}
|
|
92
|
+
onColor={theme.colors.primary}
|
|
93
|
+
size="small"
|
|
94
|
+
disabled={singleNotifications?.loading}
|
|
95
|
+
offColor={theme.colors.disabled}
|
|
96
|
+
animationSpeed={400}
|
|
97
|
+
onToggle={() => handleEditNotifications('email', !notificationsList?.email)}
|
|
98
|
+
/>
|
|
99
|
+
</SwitchWrapper>
|
|
100
|
+
<SwitchWrapper>
|
|
101
|
+
<OText>{t('SMS', 'Sms')}</OText>
|
|
102
|
+
<ToggleSwitch
|
|
103
|
+
isOn={notificationsList?.sms}
|
|
104
|
+
onColor={theme.colors.primary}
|
|
105
|
+
size="small"
|
|
106
|
+
disabled={singleNotifications?.loading}
|
|
107
|
+
offColor={theme.colors.disabled}
|
|
108
|
+
animationSpeed={400}
|
|
109
|
+
onToggle={() => handleEditNotifications('sms', !notificationsList?.sms)}
|
|
110
|
+
/>
|
|
111
|
+
</SwitchWrapper>
|
|
112
|
+
<SwitchWrapper>
|
|
113
|
+
<OText>{t('PUSH_NOTIFICATIONS', 'Push Notifications')}</OText>
|
|
114
|
+
<ToggleSwitch
|
|
115
|
+
isOn={notificationsList?.notification}
|
|
116
|
+
onColor={theme.colors.primary}
|
|
117
|
+
size="small"
|
|
118
|
+
disabled={singleNotifications?.loading}
|
|
119
|
+
offColor={theme.colors.disabled}
|
|
120
|
+
animationSpeed={400}
|
|
121
|
+
onToggle={() => handleEditNotifications('notification', !notificationsList?.notification)}
|
|
122
|
+
/>
|
|
123
|
+
</SwitchWrapper>
|
|
124
|
+
</NotificationsGroupSwitchWrapper>
|
|
131
125
|
</>
|
|
132
126
|
)}
|
|
133
127
|
</Container>
|
|
@@ -138,10 +132,6 @@ const styles = StyleSheet.create({
|
|
|
138
132
|
title: {
|
|
139
133
|
marginBottom: 24,
|
|
140
134
|
fontWeight: 'bold',
|
|
141
|
-
},
|
|
142
|
-
pagePadding: {
|
|
143
|
-
paddingLeft: 40,
|
|
144
|
-
paddingRight: 40
|
|
145
135
|
}
|
|
146
136
|
});
|
|
147
137
|
|
|
@@ -4,9 +4,16 @@ export const ContainerButtons = styled.View`
|
|
|
4
4
|
margin-vertical: 50px
|
|
5
5
|
`
|
|
6
6
|
|
|
7
|
+
export const Container = styled.ScrollView`
|
|
8
|
+
position: relative;
|
|
9
|
+
flex: 1;
|
|
10
|
+
padding: 20px;
|
|
11
|
+
`
|
|
12
|
+
|
|
7
13
|
export const NotificationsGroupSwitchWrapper = styled.View`
|
|
8
14
|
flex-grow: 1;
|
|
9
15
|
justify-content: space-between;
|
|
16
|
+
paddingHorizontal: 20px;
|
|
10
17
|
`
|
|
11
18
|
|
|
12
19
|
export const SwitchWrapper = styled.View`
|
|
@@ -14,4 +21,4 @@ export const SwitchWrapper = styled.View`
|
|
|
14
21
|
justify-content: space-between;
|
|
15
22
|
align-items: center;
|
|
16
23
|
margin-bottom: 12px;
|
|
17
|
-
`
|
|
24
|
+
`
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
I18nManager,
|
|
10
10
|
SafeAreaView,
|
|
11
11
|
Platform,
|
|
12
|
-
Button
|
|
12
|
+
Button,
|
|
13
|
+
Vibration
|
|
13
14
|
} from 'react-native';
|
|
14
15
|
import {
|
|
15
16
|
ProductForm as ProductOptions,
|
|
@@ -75,6 +76,8 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
75
76
|
const theme = useTheme();
|
|
76
77
|
const [, { showToast }] = useToast()
|
|
77
78
|
|
|
79
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
80
|
+
|
|
78
81
|
const styles = StyleSheet.create({
|
|
79
82
|
mainContainer: {
|
|
80
83
|
|
|
@@ -205,6 +208,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
205
208
|
};
|
|
206
209
|
|
|
207
210
|
const handleSaveProduct = () => {
|
|
211
|
+
Vibration.vibrate()
|
|
208
212
|
if (!productCart.quantity) {
|
|
209
213
|
showToast(ToastType.Error, t('VALIDATION_ERROR_REQUIRED', 'The quantity field is required').replace('_attribute_', t('PRODUCT_POTIONS_QUANTITY', 'Quantity')))
|
|
210
214
|
return
|
|
@@ -618,7 +622,10 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
618
622
|
</>
|
|
619
623
|
)}
|
|
620
624
|
</WrapHeader>
|
|
621
|
-
<ProductSummary
|
|
625
|
+
<ProductSummary
|
|
626
|
+
ph={isChewLayout ? 20 : 40}
|
|
627
|
+
onLayout={(event: any) => setSummaryRefHeight(event.nativeEvent.layout?.height)}
|
|
628
|
+
>
|
|
622
629
|
<ProductTitle>
|
|
623
630
|
{loading && !product ? (
|
|
624
631
|
<Placeholder Animation={Fade}>
|
|
@@ -718,7 +725,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
718
725
|
marginBottom: 20,
|
|
719
726
|
borderBottomWidth: 1,
|
|
720
727
|
borderBottomColor: theme.colors.border,
|
|
721
|
-
marginHorizontal: 30,
|
|
728
|
+
marginHorizontal: isChewLayout ? 20 : 30,
|
|
722
729
|
backgroundColor: theme.colors.backgroundPage,
|
|
723
730
|
}}
|
|
724
731
|
>
|
|
@@ -792,6 +799,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
792
799
|
</>
|
|
793
800
|
) : (
|
|
794
801
|
<ProductEditions
|
|
802
|
+
style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
|
|
795
803
|
onLayout={(event: any) => {
|
|
796
804
|
setEditionsLayoutY(event.nativeEvent.layout?.y)
|
|
797
805
|
}}
|
|
@@ -47,7 +47,7 @@ export const ProductTitle = styled.View`
|
|
|
47
47
|
export const ProductDescription = styled.View``
|
|
48
48
|
|
|
49
49
|
export const ProductEditions = styled.View`
|
|
50
|
-
padding: 0
|
|
50
|
+
padding-vertical: 0;
|
|
51
51
|
`
|
|
52
52
|
|
|
53
53
|
export const SectionTitle = styled.View`
|
|
@@ -94,7 +94,7 @@ export const WeightUnitItem = styled.View`
|
|
|
94
94
|
`}
|
|
95
95
|
`
|
|
96
96
|
export const ProductSummary = styled.View`
|
|
97
|
-
padding: 26px
|
|
97
|
+
padding: 26px ${(props: any) => props.ph}px 0;
|
|
98
98
|
position: relative;
|
|
99
99
|
background-color: white;
|
|
100
100
|
z-index: 100;
|
|
@@ -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?.
|
|
44
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
45
45
|
const iconsSize = isChewLayout ? 20 : 16
|
|
46
46
|
|
|
47
47
|
const handleSuboptionClick = () => {
|
|
@@ -49,6 +49,8 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
49
49
|
|
|
50
50
|
const theme = useTheme();
|
|
51
51
|
|
|
52
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
53
|
+
|
|
52
54
|
const langPickerStyle = StyleSheet.create({
|
|
53
55
|
inputAndroid: {
|
|
54
56
|
color: theme.colors.textNormal,
|
|
@@ -89,8 +91,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
89
91
|
marginEnd: 14
|
|
90
92
|
},
|
|
91
93
|
pagePadding: {
|
|
92
|
-
|
|
93
|
-
paddingRight: 40
|
|
94
|
+
paddingHorizontal: isChewLayout ? 20 : 40
|
|
94
95
|
},
|
|
95
96
|
messageIconStyle: {
|
|
96
97
|
fontSize: 18,
|
|
@@ -164,9 +165,6 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
164
165
|
|
|
165
166
|
return (
|
|
166
167
|
<View style={{ flex: 1, height: height - top - bottom, paddingTop: 20 }}>
|
|
167
|
-
{/* <OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
|
|
168
|
-
{t('PROFILE', 'Profile')}
|
|
169
|
-
</OText> */}
|
|
170
168
|
<CenterView style={styles.pagePadding}>
|
|
171
169
|
{user?.photo && (
|
|
172
170
|
<View style={styles.photo}>
|
|
@@ -16,9 +16,8 @@ import { ProfileParams } from '../../types';
|
|
|
16
16
|
import { UserFormDetailsUI } from '../UserFormDetails';
|
|
17
17
|
|
|
18
18
|
import { OIcon, OIconButton, OModal } from '../shared';
|
|
19
|
-
import { CenterView } from './styles';
|
|
19
|
+
import { CenterView, Container } from './styles';
|
|
20
20
|
import NavBar from '../NavBar';
|
|
21
|
-
import { Container } from '../../layouts/Container';
|
|
22
21
|
import { VerifyPhone } from '../VerifyPhone'
|
|
23
22
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
24
23
|
import FastImage from 'react-native-fast-image'
|
|
@@ -51,11 +50,6 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
51
50
|
shadowOpacity: 0.2,
|
|
52
51
|
backgroundColor: theme.colors.white,
|
|
53
52
|
},
|
|
54
|
-
pagePadding: {
|
|
55
|
-
paddingLeft: 40,
|
|
56
|
-
paddingRight: 40,
|
|
57
|
-
justifyContent: 'center',
|
|
58
|
-
},
|
|
59
53
|
navBarStyle: {
|
|
60
54
|
paddingLeft: 40,
|
|
61
55
|
paddingRight: 40,
|
|
@@ -284,19 +278,16 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
284
278
|
|
|
285
279
|
return (
|
|
286
280
|
<>
|
|
287
|
-
<Container
|
|
288
|
-
pt={15}
|
|
289
|
-
noPadding
|
|
290
|
-
>
|
|
281
|
+
<Container>
|
|
291
282
|
<NavBar
|
|
292
283
|
title={t('ACCOUNT', 'Account')}
|
|
293
284
|
titleAlign={'center'}
|
|
294
285
|
onActionLeft={() => navigation.goBack()}
|
|
295
286
|
showCall={false}
|
|
296
|
-
|
|
287
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
297
288
|
/>
|
|
298
289
|
<KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
|
|
299
|
-
<CenterView
|
|
290
|
+
<CenterView>
|
|
300
291
|
<View style={styles.photo}>
|
|
301
292
|
{user?.photo ? (
|
|
302
293
|
<FastImage
|
|
@@ -319,15 +310,13 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
319
310
|
onClick={() => handleImagePicker()}
|
|
320
311
|
/>
|
|
321
312
|
</CenterView>
|
|
322
|
-
<View style={{ height: 8,
|
|
313
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
|
|
323
314
|
<Spinner visible={formState?.loading || verifyPhoneState?.loading} />
|
|
324
|
-
<
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
/>
|
|
330
|
-
</View>
|
|
315
|
+
<UserFormDetailsUI
|
|
316
|
+
{...props}
|
|
317
|
+
isEdit
|
|
318
|
+
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
319
|
+
/>
|
|
331
320
|
</KeyboardAvoidingView>
|
|
332
321
|
</Container>
|
|
333
322
|
<OModal
|
|
@@ -9,6 +9,13 @@ export const UserData = styled.View`
|
|
|
9
9
|
text-align: center;
|
|
10
10
|
`
|
|
11
11
|
|
|
12
|
+
export const Container = styled.ScrollView`
|
|
13
|
+
position: relative;
|
|
14
|
+
flex: 1;
|
|
15
|
+
paddingTop: 20px;
|
|
16
|
+
margin-bottom: 40px;
|
|
17
|
+
`
|
|
18
|
+
|
|
12
19
|
export const Names = styled.View`
|
|
13
20
|
flex-direction: row;
|
|
14
21
|
`
|
|
@@ -71,7 +71,7 @@ const WalletsUI = (props: any) => {
|
|
|
71
71
|
|
|
72
72
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
73
73
|
const [openHistory, setOpenHistory] = useState(false)
|
|
74
|
-
const isChewLayout = theme?.
|
|
74
|
+
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
75
75
|
|
|
76
76
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
77
77
|
|