ordering-ui-react-native 0.17.74 → 0.17.76

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.
Files changed (31) hide show
  1. package/package.json +1 -1
  2. package/themes/original/src/components/AddressList/index.tsx +14 -18
  3. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  4. package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
  5. package/themes/original/src/components/BusinessController/index.tsx +2 -1
  6. package/themes/original/src/components/BusinessListingSearch/index.tsx +4 -2
  7. package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -3
  8. package/themes/original/src/components/BusinessProductsListing/styles.tsx +1 -1
  9. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
  10. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  11. package/themes/original/src/components/CartContent/index.tsx +5 -1
  12. package/themes/original/src/components/CartContent/styles.tsx +1 -1
  13. package/themes/original/src/components/Checkout/index.tsx +2 -1
  14. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  15. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  16. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  17. package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
  18. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  19. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  20. package/themes/original/src/components/MyOrders/index.tsx +6 -8
  21. package/themes/original/src/components/NavBar/index.tsx +2 -7
  22. package/themes/original/src/components/Notifications/index.tsx +42 -52
  23. package/themes/original/src/components/Notifications/styles.tsx +8 -1
  24. package/themes/original/src/components/OrdersOption/index.tsx +15 -13
  25. package/themes/original/src/components/ProductForm/index.tsx +11 -3
  26. package/themes/original/src/components/ProductForm/styles.tsx +2 -2
  27. package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
  28. package/themes/original/src/components/UserProfile/index.tsx +3 -5
  29. package/themes/original/src/components/UserProfileForm/index.tsx +10 -21
  30. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  31. package/themes/original/src/components/Wallets/index.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.17.74",
3
+ "version": "0.17.76",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -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 { AddressListContainer, AddressItem } from './styles'
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
- <AddressListContainer>
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
- </AddressListContainer>
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 AddressListContainer = styled.View`
3
+ export const Container = styled.ScrollView`
4
+ position: relative;
4
5
  flex: 1;
5
6
  paddingLeft: 40px;
6
7
  paddingRight: 40px;
7
- paddingBottom: 20px;
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?.business_view?.components?.header?.components?.layout?.type === 'chew'
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?.business_view?.components?.header?.components?.layout?.type === 'chew'
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?.business_view?.components?.header?.components?.layout?.type === 'chew'
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' ? 0 : 100
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, zIndex: 20000 }}>
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)}
@@ -24,7 +24,7 @@ export const WrapSearchBar = styled.View`
24
24
  flex: 1;
25
25
  `
26
26
  export const WrapContent = styled.View`
27
- padding: 10px 40px;
27
+ padding-vertical: 10px;
28
28
  `
29
29
 
30
30
  export const BusinessProductsListingContainer = styled.ScrollView`
@@ -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: 40px;
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) => (
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native';
2
2
 
3
3
  export const CCContainer = styled.View`
4
- padding: 20px 40px;
4
+ padding-vertical: 20px;
5
5
  `
6
6
 
7
7
  export const CCNotCarts = styled.View`
@@ -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?.business_view?.components?.header?.components?.layout?.type === 'chew'
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
- HeaderWrapper
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
- <HeaderWrapper>
44
- <OButton
45
- imgRightSrc={null}
46
- style={styles.btnBackArrow}
47
- onClick={() => goToBack()}
48
- icon={AntDesignIcon}
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
- export const HeaderWrapper = styled.View`
8
- padding: 10px 20px 20px 0;
9
- flex-direction: row;
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, OButton, OIcon } from '../shared'
4
+ import { OText, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet, TouchableOpacity } from 'react-native'
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
  }
@@ -4,3 +4,8 @@ export const Content = styled.View`
4
4
  padding-vertical: 20px;
5
5
  margin-bottom: 20px;
6
6
  `
7
+ export const Container = styled.ScrollView`
8
+ position: relative;
9
+ flex: 1;
10
+ margin: 10px 0;
11
+ `
@@ -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, OButton, OIcon } from '../shared'
4
+ import { OText, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet, TouchableOpacity } from 'react-native'
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
  }
@@ -3,4 +3,11 @@ import styled from 'styled-components/native'
3
3
  export const Content = styled.View`
4
4
  padding-vertical: 20px;
5
5
  margin-bottom: 20px;
6
- `
6
+ `
7
+
8
+ export const Container = styled.ScrollView`
9
+ position: relative;
10
+ flex: 1;
11
+ margin: 10px 0;
12
+ `
13
+
@@ -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?.business_view?.components?.header?.components?.layout?.type === 'chew'
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={{ paddingLeft: 40, paddingRight: 40 }}>
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={{ paddingLeft: 40, paddingRight: 40 }}>
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={props.leftImg}
67
- imgLeftStyle={{ width: 18 }}
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 { Platform, StyleSheet, View } from 'react-native'
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
- <View style={{ ...styles.pagePadding }}>
91
- <NotificationsGroupSwitchWrapper>
92
- <OText style={{ ...styles.title }}>{t('MARKETING_NOTIFICATIONS', 'Marketing Notifications')}</OText>
93
- <SwitchWrapper>
94
- <OText>{t('EMAILS', 'Emails')}</OText>
95
- <ToggleSwitch
96
- isOn={notificationsList?.email}
97
- onColor={theme.colors.primary}
98
- size="small"
99
- disabled={singleNotifications?.loading}
100
- offColor={theme.colors.disabled}
101
- animationSpeed={400}
102
- onToggle={() => handleEditNotifications('email', !notificationsList?.email)}
103
- />
104
- </SwitchWrapper>
105
- <SwitchWrapper>
106
- <OText>{t('SMS', 'Sms')}</OText>
107
- <ToggleSwitch
108
- isOn={notificationsList?.sms}
109
- onColor={theme.colors.primary}
110
- size="small"
111
- disabled={singleNotifications?.loading}
112
- offColor={theme.colors.disabled}
113
- animationSpeed={400}
114
- onToggle={() => handleEditNotifications('sms', !notificationsList?.sms)}
115
- />
116
- </SwitchWrapper>
117
- <SwitchWrapper>
118
- <OText>{t('PUSH_NOTIFICATIONS', 'Push Notifications')}</OText>
119
- <ToggleSwitch
120
- isOn={notificationsList?.notification}
121
- onColor={theme.colors.primary}
122
- size="small"
123
- disabled={singleNotifications?.loading}
124
- offColor={theme.colors.disabled}
125
- animationSpeed={400}
126
- onToggle={() => handleEditNotifications('notification', !notificationsList?.notification)}
127
- />
128
- </SwitchWrapper>
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
+ `
@@ -72,9 +72,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
72
72
 
73
73
  useEffect(() => {
74
74
  if (loading || error) return
75
- const orders = _orders.map((order: any) => order?.cart_group_id
76
- ? _orders
77
- .filter((_order : any) => _order?.cart_group_id === order?.cart_group_id)
75
+ const ordersReduced = _orders.map((order: any) => order?.cart_group_id
76
+ ? _orders
77
+ ?.filter((_order : any) => _order?.cart_group_id === order?.cart_group_id)
78
78
  ?.reduce((orderCompleted : any, currentOrder : any) => ({
79
79
  ...orderCompleted,
80
80
  total: orderCompleted.summary?.total + currentOrder?.summary?.total,
@@ -84,17 +84,19 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
84
84
  review: orderCompleted.review && currentOrder.review,
85
85
  user_review: orderCompleted.user_review && currentOrder.user_review,
86
86
  products: [orderCompleted.products, currentOrder.products].flat()
87
- })).filter((order: any) => {
88
- const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
89
- if (!isDuplicate) {
90
- uniqueOrders.push(order?.cart_group_id)
91
- return true
92
- }
93
- return false
94
- })
95
- : order)
87
+ }))
88
+ : order)
89
+ const orders = ordersReduced?.filter((order: any) => {
90
+ if (!order?.cart_group_id) return true
91
+ const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
92
+ if (!isDuplicate) {
93
+ uniqueOrders.push(order?.cart_group_id)
94
+ return true
95
+ }
96
+ return false
97
+ })
96
98
  setOrders(orders)
97
- }, [JSON.stringify(_orders)])
99
+ }, [_orders?.length])
98
100
 
99
101
  const getOrderStatus = (s: string) => {
100
102
  const status = parseInt(s)
@@ -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 onLayout={(event: any) => setSummaryRefHeight(event.nativeEvent.layout?.height)}>
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 40px;
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 40px 0;
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?.business_view?.components?.header?.components?.layout?.type === 'chew'
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
- paddingLeft: 40,
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
- style={{ paddingHorizontal: 40 }}
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 style={styles.pagePadding}>
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, marginLeft: -40, marginRight: -40, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
313
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
323
314
  <Spinner visible={formState?.loading || verifyPhoneState?.loading} />
324
- <View style={styles.pagePadding}>
325
- <UserFormDetailsUI
326
- {...props}
327
- isEdit
328
- setWillVerifyOtpState={setWillVerifyOtpState}
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?.wallets_view?.components?.layout?.type === 'chew'
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