ordering-ui-react-native 0.16.61-release → 0.16.62-release

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/package.json +1 -1
  2. package/themes/original/src/components/AddressList/index.tsx +17 -17
  3. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  4. package/themes/original/src/components/BusinessProductsListing/index.tsx +4 -4
  5. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  6. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
  7. package/themes/original/src/components/Favorite/index.tsx +7 -4
  8. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  9. package/themes/original/src/components/FloatingButton/index.tsx +1 -1
  10. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  11. package/themes/original/src/components/Help/index.tsx +7 -7
  12. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  13. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  14. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  15. package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
  16. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  17. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  18. package/themes/original/src/components/LottieAnimation/index.tsx +16 -7
  19. package/themes/original/src/components/MessageListing/index.tsx +7 -7
  20. package/themes/original/src/components/MomentOption/index.tsx +9 -5
  21. package/themes/original/src/components/MultiCheckout/index.tsx +2 -7
  22. package/themes/original/src/components/NavBar/index.tsx +2 -7
  23. package/themes/original/src/components/Notifications/index.tsx +46 -50
  24. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  25. package/themes/original/src/components/ProductForm/index.tsx +15 -8
  26. package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
  27. package/themes/original/src/components/Promotions/index.tsx +3 -2
  28. package/themes/original/src/components/UserProfileForm/index.tsx +19 -28
  29. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  30. package/themes/original/src/components/shared/OButton.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.16.61-release",
3
+ "version": "0.16.62-release",
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'
@@ -143,8 +142,7 @@ const AddressListUI = (props: AddressListParams) => {
143
142
  }, [])
144
143
 
145
144
  return (
146
- <Container
147
- noPadding
145
+ <Container
148
146
  refreshControl={
149
147
  <RefreshControl
150
148
  refreshing={refreshing}
@@ -152,17 +150,18 @@ const AddressListUI = (props: AddressListParams) => {
152
150
  />
153
151
  }
154
152
  >
155
- {isProfile && (
156
- <NavBar
157
- title={t('SAVED_PLACES', 'My saved places')}
158
- titleAlign={'center'}
159
- onActionLeft={goToBack}
160
- showCall={false}
161
- style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginTop: Platform.OS === 'ios' ? 0 : 30 }}
162
- />
163
- )}
164
153
  {(!addressList.loading || (isFromProductsList || isFromBusinesses || isFromProfile || isProfile)) && (
165
- <AddressListContainer>
154
+ <>
155
+ {isProfile && (
156
+ <NavBar
157
+ title={t('SAVED_PLACES', 'My saved places')}
158
+ titleAlign={'center'}
159
+ onActionLeft={goToBack}
160
+ showCall={false}
161
+ paddingTop={10}
162
+ btnStyle={{ paddingLeft: 0 }}
163
+ />
164
+ )}
166
165
  {
167
166
  route &&
168
167
  (
@@ -178,8 +177,8 @@ const AddressListUI = (props: AddressListParams) => {
178
177
  onActionLeft={() => goToBack()}
179
178
  showCall={false}
180
179
  btnStyle={{ paddingLeft: 0 }}
181
- paddingTop={0}
182
- style={{ marginTop: Platform.OS === 'ios' ? 0 : 40 }}
180
+ paddingTop={10}
181
+ style={{ marginTop: 0 }}
183
182
  titleWrapStyle={{ paddingHorizontal: 0 }}
184
183
  titleStyle={{ marginLeft: 0, marginRight: 0 }}
185
184
  />
@@ -328,7 +327,8 @@ const AddressListUI = (props: AddressListParams) => {
328
327
  />
329
328
  </>
330
329
  )}
331
- </AddressListContainer>
330
+ </>
331
+
332
332
  )}
333
333
  </Container>
334
334
  )
@@ -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`
@@ -30,7 +30,6 @@ import {
30
30
  WrapSearchBar,
31
31
  WrapContent,
32
32
  FiltProductsContainer,
33
- ContainerSafeAreaView,
34
33
  BackgroundGray,
35
34
  ProfessionalFilterWrapper,
36
35
  NearBusiness,
@@ -139,7 +138,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
139
138
 
140
139
  const currentCart: any = Object.values(orderState.carts).find((cart: any) => cart?.business?.slug === business?.slug) ?? {}
141
140
  const isOpenFiltProducts = isOpenSearchBar && !!searchValue
142
- const filtProductsHeight = Platform.OS === 'ios' ? 0 : 100
141
+ const filtProductsHeight = Platform.OS === 'ios' ? 165 : 100
143
142
  const onRedirect = (route: string, params?: any) => {
144
143
  navigation.navigate(route, params)
145
144
  }
@@ -371,7 +370,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
371
370
  <FiltProductsContainer
372
371
  style={{
373
372
  height: Dimensions.get('window').height - filtProductsHeight,
374
- top: Platform.OS === 'ios' ? searchBarHeight + insets.top : searchBarHeight
373
+ top: Platform.OS === 'ios' ? (searchBarHeight - 10) + insets.top : searchBarHeight
375
374
  }}
376
375
  contentContainerStyle={{ flexGrow: 1 }}
377
376
  >
@@ -533,7 +532,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
533
532
  )}
534
533
  </IOScrollView>
535
534
  {!loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0 && (
536
- <View style={{ marginBottom: Platform.OS === 'ios' ? 20 : 0 }}>
535
+ <View style={{ marginBottom: 0 }}>
537
536
  <FloatingButton
538
537
  btnText={
539
538
  openUpselling
@@ -588,6 +587,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
588
587
  professionalList={business?.professionals}
589
588
  professionalSelected={professionalSelected}
590
589
  handleChangeProfessional={handleChangeProfessionalSelected}
590
+ handleChangeProfessional={handleChangeProfessionalSelected}
591
591
  handleUpdateProfessionals={handleUpdateProfessionals}
592
592
  onSave={() => setOpenService(false)}
593
593
  onClose={() => setOpenService(false)}
@@ -284,7 +284,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
284
284
  style={{ paddingTop: top + 20 }}>
285
285
  {!auth && (
286
286
  <TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
287
- <IconAntDesign name='arrowleft' size={26} />
287
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
288
288
  </TouchableOpacity>
289
289
  )}
290
290
  <Search>
@@ -79,7 +79,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
79
79
  const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
80
80
  const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
81
81
  const [refreshing] = useState(false);
82
- const bgHeader = orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image
82
+ const bgHeader = orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image
83
83
  const styles = StyleSheet.create({
84
84
  container: {
85
85
  marginBottom: 0,
@@ -473,7 +473,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
473
473
  {!auth && (
474
474
 
475
475
  <TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
476
- <IconAntDesign name='arrowleft' size={26} />
476
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
477
477
  </TouchableOpacity>
478
478
  )}
479
479
  </HeaderWrapper>
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from 'react'
2
2
  import { useLanguage, useOrder } from 'ordering-components/native'
3
3
  import { useTheme } from 'styled-components/native'
4
+ import { Platform } from 'react-native'
4
5
  import { FavoriteList } from '../FavoriteList'
5
6
  import NavBar from '../NavBar'
6
7
  import { OText } from '../shared'
@@ -33,7 +34,9 @@ export const Favorite = (props: any) => {
33
34
  }
34
35
 
35
36
  return (
36
- <Container>
37
+ <Container
38
+ pdng={Platform.OS === 'ios' ? '20px' : '30px'}
39
+ >
37
40
  <NavBar
38
41
  title={t('FAVORITE', 'Favorite')}
39
42
  titleAlign={'center'}
@@ -51,9 +54,9 @@ export const Favorite = (props: any) => {
51
54
  >
52
55
  <OText
53
56
  color={menu.key === tabSelected ? theme.colors.textNormal : theme.colors.disabled}
54
- size={14}
55
- weight={menu.key === tabSelected ? '500' : '400'}
56
- style={{ marginBottom: 12 }}
57
+ size={14}
58
+ weight={menu.key === tabSelected ? '500' : '400'}
59
+ style={{ marginBottom: 12 }}
57
60
  >
58
61
  {menu.name}
59
62
  </OText>
@@ -18,5 +18,5 @@ export const Tab = styled.TouchableOpacity`
18
18
  export const Container = styled.View`
19
19
  padding-horizontal: 40px;
20
20
  padding-bottom: 20px;
21
- padding-top: 30px;
21
+ padding-top: ${(props: any) => props.pdng};
22
22
  `
@@ -62,7 +62,7 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
62
62
  return (
63
63
  <Container
64
64
  style={{
65
- paddingBottom: Platform.OS === 'ios' ? iosBottom ?? 0 : bottom + 16
65
+ paddingBottom: Platform.OS === 'ios' ? 20 : bottom + 16
66
66
  }}>
67
67
 
68
68
  <View style={styles.infoCont}>
@@ -12,7 +12,7 @@ export const Container = styled.View`
12
12
  width: 100%;
13
13
  justify-content: space-between;
14
14
  background-color: #FFF;
15
- z-index: 9999;
15
+ z-index: 20001;
16
16
  justify-content: space-between;
17
17
  `
18
18
 
@@ -31,20 +31,20 @@ export const Help = (props: HelpParams) => {
31
31
 
32
32
  return (
33
33
  <Container
34
+ pt={10}
34
35
  noPadding
35
36
  refreshControl={
36
- <RefreshControl
37
- refreshing={refreshing}
38
- onRefresh={() => handleOnRefresh()}
39
- />
40
- }
37
+ <RefreshControl
38
+ refreshing={refreshing}
39
+ onRefresh={() => handleOnRefresh()}
40
+ />
41
+ }
41
42
  >
42
43
  <NavBar
43
44
  title={t('HELP', 'Help')}
44
45
  titleAlign={'center'}
45
46
  onActionLeft={goToBack}
46
47
  showCall={false}
47
- paddingTop={10}
48
48
  btnStyle={{ paddingLeft: 0 }}
49
49
  />
50
50
  <HelpSubItem
@@ -53,7 +53,7 @@ export const Help = (props: HelpParams) => {
53
53
  <OText size={14}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
54
54
  </HelpSubItem>
55
55
  <HelpSubItem
56
- onPress={() => onRedirect('HelpAccountAndPayment')}
56
+ onPress={() => onRedirect('HelpAccountAndPayment')}
57
57
  >
58
58
  <OText size={14}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
59
59
  </HelpSubItem>
@@ -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
+
@@ -1,4 +1,4 @@
1
- import React, { useRef } from 'react'
1
+ import React, { useRef, useState } from 'react'
2
2
  import Lottie from 'lottie-react-native';
3
3
  import { TouchableOpacity, Easing, ViewStyle, Animated } from 'react-native';
4
4
  import IconAntDesign from 'react-native-vector-icons/AntDesign'
@@ -13,9 +13,9 @@ interface Props {
13
13
  duration?: number,
14
14
  type: 'favorite', // animation types
15
15
  isActive: boolean,
16
- animationType?: ((value : number) => number);
16
+ animationType?: ((value: number) => number);
17
17
  useNativeDriver?: boolean,
18
- iconProps?: {color?: string, size?: number, style?: ViewStyle}
18
+ iconProps?: { color?: string, size?: number, style?: ViewStyle }
19
19
  }
20
20
 
21
21
  export const LottieAnimation = (props: Props) => {
@@ -34,30 +34,39 @@ export const LottieAnimation = (props: Props) => {
34
34
  } = props
35
35
  const theme = useTheme()
36
36
  const animationProgress = useRef(new Animated.Value(initialValue))
37
+ const [isHide, setIsHide] = useState(true)
37
38
  const favoriteArray = ['heart', 'hearto']
38
39
  const icon = type === 'favorite' ? favoriteArray : []
39
40
  const animationGif = type === 'favorite' ? theme.images?.general?.heart : ''
40
41
  const onPressLottie = () => {
41
42
  if (!disableAnimation) {
43
+ setIsHide(false)
42
44
  Animated.timing(animationProgress.current, {
43
45
  toValue,
44
46
  duration: duration || 5000,
45
47
  easing: animationType || Easing.linear,
46
48
  useNativeDriver: useNativeDriver ?? true
47
49
  }).start();
50
+ hideLottie()
48
51
  }
49
52
  onClick()
50
53
  }
51
54
 
55
+ const hideLottie = () => {
56
+ setTimeout(() => setIsHide(true), 4500)
57
+ }
58
+
52
59
  return (
53
60
  <TouchableOpacity
54
61
  onPress={onPressLottie}
55
62
  style={style}
56
63
  >
57
- <Lottie
58
- progress={animationProgress.current}
59
- source={animationGif}
60
- />
64
+ {!isHide &&
65
+ <Lottie
66
+ progress={animationProgress.current}
67
+ source={animationGif}
68
+ />
69
+ }
61
70
  <IconAntDesign
62
71
  name={isActive ? icon[0] : icon[1]}
63
72
  color={iconProps?.color || theme.colors.danger5}
@@ -16,7 +16,7 @@ import {
16
16
  PlaceholderLine,
17
17
  Fade
18
18
  } from "rn-placeholder";
19
- import { View, BackHandler } from 'react-native'
19
+ import { View, BackHandler, Platform } from 'react-native'
20
20
  import {
21
21
  MessageListingWrapper,
22
22
  MessageContainer
@@ -77,7 +77,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
77
77
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
78
78
  { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
79
79
  { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
80
- { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
80
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
81
81
  ]
82
82
 
83
83
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -102,7 +102,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
102
102
  }, [orderList, loading])
103
103
 
104
104
  useEffect(() => {
105
- if(refreshOrders){
105
+ if (refreshOrders) {
106
106
  loadOrders(false, false, false, true)
107
107
  setRefreshOrders && setRefreshOrders(false)
108
108
  }
@@ -225,7 +225,7 @@ const OrderMessageUI = (props: any) => {
225
225
  }
226
226
 
227
227
  export const OrderListing = (props: OrdersOptionParams) => {
228
- const [businessState] = useBusiness();
228
+ const [businessState] = useBusiness();
229
229
  const OrderListingProps = {
230
230
  ...props,
231
231
  UIComponent: OrdersOptionUI,
@@ -236,7 +236,7 @@ export const OrderListing = (props: OrdersOptionParams) => {
236
236
  pageSize: 10,
237
237
  controlType: 'infinity'
238
238
  },
239
- businessId: businessState?.business?.id,
239
+ businessId: businessState?.business?.id,
240
240
  profileMessages: true,
241
241
  orderBy: 'last_direct_message_at',
242
242
  orderDirection: 'asc'
@@ -292,7 +292,7 @@ export const MessageListing = (props: MessageListingParams) => {
292
292
  titleAlign={'center'}
293
293
  onActionLeft={goToBack}
294
294
  showCall={false}
295
- paddingTop={10}
295
+ paddingTop={Platform.OS === 'ios' ? 20 : 10}
296
296
  btnStyle={{ paddingLeft: 0 }}
297
297
  />
298
298
  <OrderListing
@@ -300,7 +300,7 @@ export const MessageListing = (props: MessageListingParams) => {
300
300
  setSelectedOrderId={setSelectedOrderId}
301
301
  setOrderList={setOrderListStatus}
302
302
  setOpenMessges={setOpenMessges}
303
- franchiseId={props.franchiseId}
303
+ franchiseId={props.franchiseId}
304
304
  />
305
305
  {openMessages && seletedOrder && (
306
306
  <OModal
@@ -13,7 +13,8 @@ import IconAntDesign from 'react-native-vector-icons/AntDesign'
13
13
  import {
14
14
  StyleSheet,
15
15
  View,
16
- TouchableOpacity
16
+ TouchableOpacity,
17
+ Platform
17
18
  } from 'react-native';
18
19
  import Spinner from 'react-native-loading-spinner-overlay';
19
20
  import { MomentOptionParams } from '../../types';
@@ -253,19 +254,22 @@ const MomentOptionUI = (props: MomentOptionParams) => {
253
254
 
254
255
  return (
255
256
  <>
256
- <Container style={{ paddingLeft: 40, paddingRight: 40 }}>
257
- <View style={{ paddingBottom: 90 }}>
257
+ <Container
258
+ style={{
259
+ paddingLeft: 40,
260
+ paddingRight: 40
261
+ }}>
262
+ <View style={{ paddingBottom: 90, paddingRight: 20 }}>
258
263
  <NavBar
259
264
  onActionLeft={() => goToBack()}
260
265
  btnStyle={{ paddingLeft: 0 }}
261
- paddingTop={0}
262
266
  style={{ paddingBottom: 0 }}
267
+ paddingTop={Platform.OS === 'ios' ? 10 : 0}
263
268
  title={t('QUESTION_WHEN_ORDER', 'When do you want your order?')}
264
269
  titleAlign={'center'}
265
270
  titleStyle={{ fontSize: 14, marginRight: 0, marginLeft: 0 }}
266
271
  titleWrapStyle={{ paddingHorizontal: 0 }}
267
272
  />
268
-
269
273
  <WrapSelectOption
270
274
  onPress={() => _handleAsap()}
271
275
  disabled={orderState.loading} style={{ alignItems: 'flex-start' }}>
@@ -65,9 +65,7 @@ const MultiCheckoutUI = (props: any) => {
65
65
  paddingLeft: 40,
66
66
  paddingRight: 40
67
67
  },
68
- wrapperNavbar: Platform.OS === 'ios'
69
- ? { paddingVertical: 0, paddingHorizontal: 40 }
70
- : { paddingVertical: 20, paddingHorizontal: 40 }
68
+ wrapperNavbar: { paddingHorizontal: 40 }
71
69
  })
72
70
 
73
71
  const [, { showToast }] = useToast();
@@ -149,15 +147,12 @@ const MultiCheckoutUI = (props: any) => {
149
147
  <Container noPadding>
150
148
  <View style={styles.wrapperNavbar}>
151
149
  <NavBar
152
- isVertical
153
150
  title={t('CHECKOUT', 'Checkout')}
154
151
  titleAlign={'center'}
155
152
  onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
156
153
  showCall={false}
154
+ paddingTop={Platform.OS === 'ios' ? 0 : 4}
157
155
  btnStyle={{ paddingLeft: 0 }}
158
- style={{ marginTop: Platform.OS === 'ios' ? 0 : 30 }}
159
- titleWrapStyle={{ paddingHorizontal: 0 }}
160
- titleStyle={{ marginRight: 0, marginLeft: 0 }}
161
156
  />
162
157
  </View>
163
158
  <ChContainer style={styles.pagePadding}>
@@ -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,58 +69,59 @@ const NotificationsUI = (props: any) => {
70
69
  }, [notificationsList])
71
70
 
72
71
  return (
73
- <Container noPadding>
72
+ <Container>
74
73
  <NavBar
75
74
  title={t('NOTIFICATIONS', 'Notifications')}
76
75
  titleAlign={'center'}
77
76
  onActionLeft={goToBack}
78
77
  showCall={false}
79
- style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginTop: Platform.OS === 'ios' ? 0 : 30 }}
78
+ style={{
79
+ paddingHorizontal: 40,
80
+ paddingVertical: 0,
81
+ }}
80
82
  />
81
83
  {showCustomerPromotions && showNotifications && (
82
84
  <>
83
85
  <Spinner visible={singleNotifications?.loading} />
84
- <View style={{ ...styles.pagePadding }}>
85
- <NotificationsGroupSwitchWrapper>
86
- <OText style={{ ...styles.title }}>{t('MARKETING_NOTIFICATIONS', 'Marketing Notifications')}</OText>
87
- <SwitchWrapper>
88
- <OText>{t('EMAILS', 'Emails')}</OText>
89
- <ToggleSwitch
90
- isOn={notificationsList?.email}
91
- onColor={theme.colors.primary}
92
- size="small"
93
- disabled={singleNotifications?.loading}
94
- offColor={theme.colors.disabled}
95
- animationSpeed={400}
96
- onToggle={() => handleEditNotifications('email', !notificationsList?.email)}
97
- />
98
- </SwitchWrapper>
99
- <SwitchWrapper>
100
- <OText>{t('SMS', 'Sms')}</OText>
101
- <ToggleSwitch
102
- isOn={notificationsList?.sms}
103
- onColor={theme.colors.primary}
104
- size="small"
105
- disabled={singleNotifications?.loading}
106
- offColor={theme.colors.disabled}
107
- animationSpeed={400}
108
- onToggle={() => handleEditNotifications('sms', !notificationsList?.sms)}
109
- />
110
- </SwitchWrapper>
111
- <SwitchWrapper>
112
- <OText>{t('PUSH_NOTIFICATIONS', 'Push Notifications')}</OText>
113
- <ToggleSwitch
114
- isOn={notificationsList?.notification}
115
- onColor={theme.colors.primary}
116
- size="small"
117
- disabled={singleNotifications?.loading}
118
- offColor={theme.colors.disabled}
119
- animationSpeed={400}
120
- onToggle={() => handleEditNotifications('notification', !notificationsList?.notification)}
121
- />
122
- </SwitchWrapper>
123
- </NotificationsGroupSwitchWrapper>
124
- </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>
125
125
  </>
126
126
  )}
127
127
  </Container>
@@ -132,10 +132,6 @@ const styles = StyleSheet.create({
132
132
  title: {
133
133
  marginBottom: 24,
134
134
  fontWeight: 'bold',
135
- },
136
- pagePadding: {
137
- paddingLeft: 40,
138
- paddingRight: 40
139
135
  }
140
136
  });
141
137
 
@@ -96,7 +96,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
96
96
  <NavBar
97
97
  onActionLeft={() => goToBack()}
98
98
  btnStyle={{ paddingLeft: 0, width: 50 }}
99
- paddingTop={0}
99
+ paddingTop={Platform.OS === 'ios' ? 10 : 0}
100
100
  style={{ paddingBottom: 0 }}
101
101
  title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
102
102
  titleAlign={'center'}
@@ -51,6 +51,7 @@ import { ScrollView } from 'react-native-gesture-handler';
51
51
  import { ProductOptionSubOption } from '../ProductOptionSubOption';
52
52
  import { NotFoundSource } from '../NotFoundSource';
53
53
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
54
+ import NavBar from '../NavBar';
54
55
  const windowWidth = Dimensions.get('window').width;
55
56
 
56
57
  export const ProductOptionsUI = (props: any) => {
@@ -166,6 +167,10 @@ export const ProductOptionsUI = (props: any) => {
166
167
  justifyContent: 'space-between',
167
168
  width: '100%',
168
169
  marginTop: 10
170
+ },
171
+ wrapperNavbar: {
172
+ paddingHorizontal: 40,
173
+ paddingTop: 0,
169
174
  }
170
175
  });
171
176
 
@@ -208,7 +213,7 @@ export const ProductOptionsUI = (props: any) => {
208
213
  };
209
214
 
210
215
  const handleSaveProduct = () => {
211
- Vibration.vibrate()
216
+ Vibration.vibrate()
212
217
  if (!productCart.quantity) {
213
218
  showToast(ToastType.Error, t('VALIDATION_ERROR_REQUIRED', 'The quantity field is required').replace('_attribute_', t('PRODUCT_POTIONS_QUANTITY', 'Quantity')))
214
219
  return
@@ -301,7 +306,7 @@ export const ProductOptionsUI = (props: any) => {
301
306
  maxProductQuantity === 0 ||
302
307
  Object.keys(errors)?.length > 0;
303
308
 
304
-
309
+
305
310
  const ExtraOptions = ({ eID, options }: any) => (
306
311
  <>
307
312
  {options.map(({ id, name, respect_to, suboptions }: any) => (
@@ -483,14 +488,16 @@ export const ProductOptionsUI = (props: any) => {
483
488
  }
484
489
  }, [])
485
490
 
486
-
487
491
  return (
488
492
  <SafeAreaView style={{ flex: 1 }}>
489
- <TopHeader>
490
- <TopActions onPress={() => handleGoBack()}>
491
- <IconAntDesign name='arrowleft' size={26} />
492
- </TopActions>
493
- </TopHeader>
493
+ <View style={styles.wrapperNavbar}>
494
+ <NavBar
495
+ onActionLeft={() => handleGoBack()}
496
+ showCall={false}
497
+ btnStyle={{ paddingLeft: 0 }}
498
+ paddingTop={4}
499
+ />
500
+ </View>
494
501
  {!error && (
495
502
  <ScrollView
496
503
  ref={scrollViewRef}
@@ -68,7 +68,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
68
68
 
69
69
  return (
70
70
  <View>
71
- <Container onPress={() => handleSuboptionClick()}>
71
+ <Container>
72
72
  <IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
73
73
  {((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
74
74
  state?.selected ? (
@@ -19,7 +19,7 @@ import { useTheme } from 'styled-components/native';
19
19
  import { OButton, OIcon, OModal, OText } from '../shared'
20
20
  import { Placeholder, PlaceholderLine } from 'rn-placeholder'
21
21
  import { NotFoundSource } from '../NotFoundSource'
22
- import { View, StyleSheet, ScrollView, Platform, RefreshControl } from 'react-native'
22
+ import { View, StyleSheet, ScrollView, RefreshControl } from 'react-native'
23
23
  import { PromotionParams } from '../../types'
24
24
  import { Container } from '../../layouts/Container'
25
25
 
@@ -99,6 +99,7 @@ const PromotionsUI = (props: PromotionParams) => {
99
99
  return (
100
100
  <Container
101
101
  noPadding
102
+ pt={20}
102
103
  refreshControl={
103
104
  <RefreshControl
104
105
  refreshing={refreshing}
@@ -111,7 +112,7 @@ const PromotionsUI = (props: PromotionParams) => {
111
112
  titleAlign={'center'}
112
113
  onActionLeft={() => navigation.goBack()}
113
114
  showCall={false}
114
- style={{ paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginLeft: 20 }}
115
+ style={{ paddingVertical: 0, marginLeft: 20 }}
115
116
  />
116
117
  <PromotionsContainer>
117
118
  <SearchBarContainer>
@@ -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,17 +278,16 @@ const ProfileUI = (props: ProfileParams) => {
284
278
 
285
279
  return (
286
280
  <>
287
- <NavBar
288
- title={t('ACCOUNT', 'Account')}
289
- titleAlign={'center'}
290
- onActionLeft={() => navigation.goBack()}
291
- showCall={false}
292
- style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 30 }}
293
- />
294
- <KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
295
- <Container noPadding>
296
-
297
- <CenterView style={styles.pagePadding}>
281
+ <Container>
282
+ <NavBar
283
+ title={t('ACCOUNT', 'Account')}
284
+ titleAlign={'center'}
285
+ onActionLeft={() => navigation.goBack()}
286
+ showCall={false}
287
+ btnStyle={{ paddingLeft: 0 }}
288
+ />
289
+ <KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
290
+ <CenterView>
298
291
  <View style={styles.photo}>
299
292
  {user?.photo ? (
300
293
  <FastImage
@@ -317,17 +310,15 @@ const ProfileUI = (props: ProfileParams) => {
317
310
  onClick={() => handleImagePicker()}
318
311
  />
319
312
  </CenterView>
320
- <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 }} />
321
314
  <Spinner visible={formState?.loading || verifyPhoneState?.loading} />
322
- <View style={styles.pagePadding}>
323
- <UserFormDetailsUI
324
- {...props}
325
- isEdit
326
- setWillVerifyOtpState={setWillVerifyOtpState}
327
- />
328
- </View>
329
- </Container>
330
- </KeyboardAvoidingView>
315
+ <UserFormDetailsUI
316
+ {...props}
317
+ isEdit
318
+ setWillVerifyOtpState={setWillVerifyOtpState}
319
+ />
320
+ </KeyboardAvoidingView>
321
+ </Container>
331
322
  <OModal
332
323
  open={isModalVisible}
333
324
  onClose={() => setIsModalVisible(false)}
@@ -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
  `
@@ -120,7 +120,7 @@ const OButton = (props: Props): React.ReactElement => {
120
120
  <props.icon {...props.iconProps} />
121
121
  ) : null}
122
122
  {props.imgLeftSrc ? (
123
- <OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} />
123
+ <OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} color={theme.colors.textNormal} />
124
124
  ) : null}
125
125
  {props.text ? (
126
126
  <StyledText style={props.textStyle}>{props.text}</StyledText>