ordering-ui-react-native 0.12.33 → 0.12.37

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/business/src/components/AcceptOrRejectOrder/index.tsx +6 -5
  3. package/themes/business/src/components/OrderDetails/Business.tsx +2 -4
  4. package/themes/business/src/components/OrderDetails/Delivery.tsx +231 -202
  5. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +344 -334
  6. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +83 -69
  7. package/themes/business/src/components/OrdersOption/index.tsx +122 -77
  8. package/themes/business/src/components/PreviousOrders/index.tsx +124 -73
  9. package/themes/business/src/components/PreviousOrders/styles.tsx +7 -0
  10. package/themes/business/src/components/ProductItemAccordion/index.tsx +26 -25
  11. package/themes/business/src/components/shared/OIcon.tsx +2 -0
  12. package/themes/business/src/types/index.tsx +5 -0
  13. package/themes/single-business/src/components/BusinessBasicInformation/index.tsx +1 -1
  14. package/themes/single-business/src/components/BusinessProductsListing/index.tsx +9 -8
  15. package/themes/single-business/src/components/BusinessesListing/index.tsx +307 -296
  16. package/themes/single-business/src/components/BusinessesListing/styles.tsx +41 -14
  17. package/themes/single-business/src/components/HelpAccountAndPayment/index.tsx +7 -6
  18. package/themes/single-business/src/components/HelpGuide/index.tsx +7 -6
  19. package/themes/single-business/src/components/HelpOrder/index.tsx +7 -6
  20. package/themes/single-business/src/components/LanguageSelector/index.tsx +87 -70
  21. package/themes/single-business/src/components/LoginForm/index.tsx +2 -2
  22. package/themes/single-business/src/components/OrderDetails/index.tsx +21 -21
  23. package/themes/single-business/src/components/ProductForm/index.tsx +682 -656
  24. package/themes/single-business/src/components/ProductForm/styles.tsx +1 -1
  25. package/themes/single-business/src/components/UserProfile/index.tsx +2 -2
  26. package/themes/single-business/src/components/shared/OIconButton.tsx +2 -2
  27. package/themes/single-business/src/components/shared/OInput.tsx +1 -0
  28. package/themes/single-business/src/components/shared/OLink.tsx +80 -0
  29. package/themes/single-business/src/components/shared/index.tsx +2 -0
  30. package/themes/single-business/src/types/index.tsx +3 -0
@@ -19,22 +19,19 @@ export const Search = styled.View`
19
19
 
20
20
  export const AddressInput = styled.TouchableOpacity`
21
21
  flex-direction: row;
22
- background-color: ${(props: any) => props.theme.colors.white};
23
- border-radius: 22px;
24
- padding-horizontal: 20px;
25
22
  align-items: center;
26
- width: 100%;
23
+ justify-content: flex-start;
24
+ background-color: white;
25
+ padding-horizontal: 15px;
26
+ border-radius: 24px;
27
27
  height: 44px;
28
- max-height: 44px;
28
+ min-height: 44px;
29
29
  `
30
30
 
31
31
  export const OrderControlContainer = styled.View`
32
32
  width: 100%;
33
- flex-direction: column;
34
- align-items: center;
35
- justify-content: space-between;
36
33
  z-index: 10;
37
- padding-bottom: 20px;
34
+ padding-top: 20px;
38
35
  flex: 1;
39
36
  `
40
37
 
@@ -53,8 +50,8 @@ export const WrapMomentOption = styled.TouchableOpacity`
53
50
 
54
51
  export const HeaderWrapper = styled.ImageBackground`
55
52
  width: 100%;
56
- height: 370px;
57
- padding: 20px 40px;
53
+ height: 200px;
54
+ padding: 0px 40px 20px;
58
55
  background-color: transparent;
59
56
  `;
60
57
 
@@ -65,6 +62,36 @@ export const ListWrapper = styled.View`
65
62
 
66
63
  export const FeaturedWrapper = styled.View`
67
64
  background-color: ${(props: any) => props.theme.colors.backgroundLight};
68
- height: 220px;
69
- paddingVertical: 30px;
70
- `;
65
+ max-height: 220px;
66
+ paddingVertical: 20px;
67
+ `;
68
+
69
+ export const TopHeader = styled.View`
70
+ position: absolute;
71
+ flex-direction: row;
72
+ align-items: center;
73
+ justify-content: space-between;
74
+ z-index: 1;
75
+ height: 34px;
76
+ min-height: 34px;
77
+ `
78
+
79
+ export const DropOptionButton = styled.TouchableOpacity`
80
+ background-color: ${(props: any) => props.theme.colors.backgroundGray100};
81
+ border-radius: 7.6px;
82
+ font-size: 12px;
83
+ max-width: 240px;
84
+ height: 26px;
85
+ align-items: center;
86
+ justify-content: center;
87
+ padding-horizontal: 8px;
88
+ flex-direction: row;
89
+ margin-end: 12px;
90
+ `
91
+
92
+ export const WrapSearchBar = styled.View`
93
+ padding: 10px 30px;
94
+ margin-bottom: 10px;
95
+ background-color: ${(props: any) => props.theme.colors.white};
96
+ flex: 1;
97
+ `
@@ -8,6 +8,7 @@ import { StyleSheet } from 'react-native'
8
8
  import {
9
9
  Content
10
10
  } from './styles'
11
+ import NavBar from '../NavBar'
11
12
 
12
13
  export const HelpAccountAndPayment = (props: HelpParams) => {
13
14
  const {
@@ -37,11 +38,11 @@ export const HelpAccountAndPayment = (props: HelpParams) => {
37
38
 
38
39
  return (
39
40
  <>
40
- <OButton
41
- imgLeftSrc={theme.images.general.arrow_left}
42
- imgRightSrc={null}
43
- style={styles.btnBackArrow}
44
- onClick={() => goToBack()}
41
+ <NavBar
42
+ style={{ paddingBottom: 0, marginLeft:-20, backgroundColor: 'transparent' }}
43
+ btnStyle={{ backgroundColor: 'transparent' }}
44
+ leftImageStyle={{ tintColor: theme.colors.textThird }}
45
+ onActionLeft={() => goToBack()}
45
46
  />
46
47
  <OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
47
48
  <Content>
@@ -65,4 +66,4 @@ export const HelpAccountAndPayment = (props: HelpParams) => {
65
66
  </Content>
66
67
  </>
67
68
  )
68
- }
69
+ }
@@ -7,6 +7,7 @@ import { StyleSheet } from 'react-native'
7
7
  import {
8
8
  Content
9
9
  } from './styles'
10
+ import NavBar from '../NavBar'
10
11
 
11
12
  export const HelpGuide = (props: HelpParams) => {
12
13
  const {
@@ -36,11 +37,11 @@ export const HelpGuide = (props: HelpParams) => {
36
37
 
37
38
  return (
38
39
  <>
39
- <OButton
40
- imgLeftSrc={theme.images.general.arrow_left}
41
- imgRightSrc={null}
42
- style={styles.btnBackArrow}
43
- onClick={() => goToBack()}
40
+ <NavBar
41
+ style={{ paddingBottom: 0, marginLeft:-20, backgroundColor: 'transparent' }}
42
+ btnStyle={{ backgroundColor: 'transparent' }}
43
+ leftImageStyle={{ tintColor: theme.colors.textThird }}
44
+ onActionLeft={() => goToBack()}
44
45
  />
45
46
  <OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
46
47
  <Content>
@@ -64,4 +65,4 @@ export const HelpGuide = (props: HelpParams) => {
64
65
  </Content>
65
66
  </>
66
67
  )
67
- }
68
+ }
@@ -9,6 +9,7 @@ import { WebView } from 'react-native-webview'
9
9
  import {
10
10
  Content
11
11
  } from './styles'
12
+ import NavBar from '../NavBar'
12
13
 
13
14
  export const HelpOrder = (props: HelpParams) => {
14
15
  const {
@@ -41,11 +42,11 @@ export const HelpOrder = (props: HelpParams) => {
41
42
 
42
43
  return (
43
44
  <>
44
- <OButton
45
- imgLeftSrc={theme.images.general.arrow_left}
46
- imgRightSrc={null}
47
- style={styles.btnBackArrow}
48
- onClick={() => goToBack()}
45
+ <NavBar
46
+ style={{ paddingBottom: 0, marginLeft:-20, backgroundColor: 'transparent' }}
47
+ btnStyle={{ backgroundColor: 'transparent' }}
48
+ leftImageStyle={{ tintColor: theme.colors.textThird }}
49
+ onActionLeft={() => goToBack()}
49
50
  />
50
51
  <OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
51
52
  <Content>
@@ -76,4 +77,4 @@ export const HelpOrder = (props: HelpParams) => {
76
77
  </Content>
77
78
  </>
78
79
  )
79
- }
80
+ }
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import { LanguageSelector as LanguageSelectorController, useOrder } from 'ordering-components/native'
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import { Platform, StyleSheet, View } from 'react-native'
5
+ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
5
6
 
6
7
  import RNPickerSelect from 'react-native-picker-select'
7
8
  import { Container } from './styles'
@@ -10,83 +11,99 @@ import { OIcon } from '../shared'
10
11
 
11
12
  const LanguageSelectorUI = (props: LanguageSelectorParams) => {
12
13
 
13
- const [orderState] = useOrder()
14
+ const [orderState] = useOrder()
14
15
 
15
- const theme = useTheme();
16
+ const theme = useTheme();
16
17
 
17
- const _pickerStyle = StyleSheet.create({
18
- inputAndroid: {
19
- color: theme.colors.white,
20
- borderWidth: 1,
21
- borderColor: theme.colors.clear,
22
- paddingHorizontal: 10,
23
- paddingEnd: 24,
24
- height: 40,
25
- backgroundColor: theme.colors.clear,
26
- },
27
- inputIOS: {
28
- color: theme.colors.white,
29
- paddingEnd: 24,
30
- height: 40,
31
- borderWidth: 1,
32
- borderColor: theme.colors.clear,
33
- backgroundColor: theme.colors.clear
34
- },
35
- icon: {
36
- width: 10,
37
- marginTop: 9,
38
- marginEnd: 10
39
- },
40
- placeholder: {
41
- color: theme.colors.secundaryContrast
42
- }
43
- })
18
+ const _pickerStyle = StyleSheet.create({
19
+ inputAndroid: {
20
+ color: theme.colors.white,
21
+ borderWidth: 1,
22
+ borderColor: theme.colors.clear,
23
+ paddingHorizontal: 10,
24
+ paddingEnd: 24,
25
+ height: 40,
26
+ backgroundColor: theme.colors.clear,
27
+ },
28
+ inputIOS: {
29
+ color: theme.colors.white,
30
+ paddingEnd: 24,
31
+ height: 40,
32
+ borderWidth: 1,
33
+ borderColor: theme.colors.clear,
34
+ backgroundColor: theme.colors.clear
35
+ },
36
+ icon: {
37
+ width: 10,
38
+ marginTop: 9,
39
+ marginEnd: 10
40
+ },
41
+ placeholder: {
42
+ color: theme.colors.secundaryContrast
43
+ }
44
+ })
44
45
 
45
- const {
46
- languagesState,
47
- currentLanguage,
48
- handleChangeLanguage,
49
- iconColor,
50
- pickerStyle
51
- } = props
46
+ const {
47
+ languagesState,
48
+ currentLanguage,
49
+ handleChangeLanguage,
50
+ iconColor,
51
+ pickerStyle
52
+ } = props
52
53
 
53
- const _languages = languagesState?.languages?.map((language: any) => {
54
- return {
55
- value: language?.code,
56
- label: language?.name,
57
- inputLabel: language?.name
58
- }
59
- })
60
- _languages && _languages.sort((a: any, b: any) =>
61
- (a.content > b.content) ? 1 : ((b.content > a.content) ? -1 : 0)
62
- )
54
+ const _languages = languagesState?.languages?.map((language: any) => {
55
+ return {
56
+ value: language?.code,
57
+ label: language?.name,
58
+ inputLabel: language?.name
59
+ }
60
+ })
61
+ _languages && _languages.sort((a: any, b: any) =>
62
+ (a.content > b.content) ? 1 : ((b.content > a.content) ? -1 : 0)
63
+ )
63
64
 
64
- return (
65
- <Container>
66
- {languagesState?.languages && (
67
- <>
68
- {iconColor && <OIcon src={theme.images.general.language} color={iconColor} style={{ marginEnd: 14 }} width={16} />}
69
- <RNPickerSelect
70
- onValueChange={handleChangeLanguage}
71
- items={_languages || []}
72
- value={currentLanguage}
73
- style={pickerStyle ? pickerStyle : _pickerStyle}
74
- useNativeAndroidPickerStyle={false}
75
- placeholder={{}}
76
- Icon={() => <View style={pickerStyle ? pickerStyle.icon : _pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.white} style={{ width: '100%' }} /></View>}
77
- disabled={orderState.loading}
78
- />
79
- </>
80
- )}
81
- </Container>
82
- )
65
+ return (
66
+ languagesState?.loading && props.allowLoading ? (
67
+ <Container>
68
+ <Placeholder style={{ width: 100, paddingTop: 10 }} Animation={Fade}>
69
+ <PlaceholderLine height={20} style={{ paddingBottom: 0, marginBottom: 0 }} />
70
+ </Placeholder>
71
+ </Container>
72
+ ) : (
73
+ <Container>
74
+ {languagesState?.languages ? (
75
+ <>
76
+ {iconColor && <OIcon src={theme.images.general.language} color={iconColor} style={{ marginEnd: 14 }} width={16} />}
77
+ <RNPickerSelect
78
+ onValueChange={handleChangeLanguage}
79
+ items={_languages || []}
80
+ value={currentLanguage}
81
+ style={pickerStyle ? pickerStyle : _pickerStyle}
82
+ useNativeAndroidPickerStyle={false}
83
+ placeholder={{}}
84
+ Icon={() => (
85
+ <View
86
+ style={pickerStyle ? pickerStyle.icon : _pickerStyle.icon}
87
+ >
88
+ <OIcon src={theme.images.general.arrow_down} color={theme.colors.white} style={{ width: '100%' }} />
89
+ </View>
90
+ )}
91
+ disabled={orderState.loading}
92
+ />
93
+ </>
94
+ ) : (
95
+ <View style={{ height: 40 }} />
96
+ )}
97
+ </Container>
98
+ )
99
+ )
83
100
  }
84
101
 
85
102
  export const LanguageSelector = (props: LanguageSelectorParams) => {
86
- const LanguageProps = {
87
- ...props,
88
- UIComponent: LanguageSelectorUI
89
- }
103
+ const LanguageProps = {
104
+ ...props,
105
+ UIComponent: LanguageSelectorUI
106
+ }
90
107
 
91
- return <LanguageSelectorController {...LanguageProps} />
108
+ return <LanguageSelectorController {...LanguageProps} />
92
109
  }
@@ -534,7 +534,7 @@ const LoginFormUI = (props: LoginParams) => {
534
534
  handleLoading={(val: boolean) => setIsFBLoading(val)}
535
535
  handleSuccessFacebookLogin={handleSuccessFacebook}
536
536
  />
537
- <GoogleLogin
537
+ {/* <GoogleLogin
538
538
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
539
539
  handleLoading={(val: boolean) => setIsFBLoading(val)}
540
540
  handleSuccessFacebookLogin={handleSuccessFacebook}
@@ -543,7 +543,7 @@ const LoginFormUI = (props: LoginParams) => {
543
543
  handleErrors={(err: any) => showToast(ToastType.Error, err)}
544
544
  handleLoading={(val: boolean) => setIsFBLoading(val)}
545
545
  handleSuccessFacebookLogin={handleSuccessFacebook}
546
- />
546
+ /> */}
547
547
  </SocialButtons>
548
548
  </ButtonsWrapper>
549
549
  </>
@@ -36,13 +36,14 @@ import {
36
36
  OrderDriver,
37
37
  Map,
38
38
  } from './styles';
39
- import { OButton, OIcon, OModal, OText } from '../shared';
39
+ import { OButton, OIcon, OModal, OText, OLink } from '../shared';
40
40
  import { ProductItemAccordion } from '../ProductItemAccordion';
41
41
  import { TouchableOpacity } from 'react-native-gesture-handler';
42
42
  import { OrderDetailsParams } from '../../types';
43
43
  import { USER_TYPE } from '../../config/constants';
44
44
  import { GoogleMap } from '../GoogleMap';
45
45
  import { verifyDecimals } from '../../utils';
46
+ import NavBar from '../NavBar';
46
47
 
47
48
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
48
49
  const {
@@ -375,13 +376,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
375
376
  {order && Object.keys(order).length > 0 && (
376
377
  <>
377
378
  <Header>
378
- <OButton
379
- imgLeftSrc={theme.images.general.arrow_left}
380
- imgRightSrc={null}
381
- style={styles.btnBackArrow}
382
- onClick={() => handleArrowBack()}
383
- imgLeftStyle={{ tintColor: theme.colors.disabled, width: 20 }}
384
- />
379
+ <NavBar
380
+ style={{ paddingBottom: 0, marginLeft: -20, backgroundColor: 'transparent' }}
381
+ btnStyle={{ backgroundColor: 'transparent' }}
382
+ leftImageStyle={{ tintColor: theme.colors.textThird }}
383
+ onActionLeft={() => handleArrowBack()}
384
+ />
385
385
  <OrderInfo>
386
386
  <OrderData>
387
387
  <OText
@@ -487,19 +487,19 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
487
487
  {order?.business?.name}
488
488
  </OText>
489
489
  <Icons>
490
- <TouchableOpacity
491
- onPress={() =>
492
- props.navigation.navigate('Business', {
493
- store: businessData?.slug,
494
- })
495
- }
496
- style={{ paddingEnd: 5 }}>
497
- <OIcon
498
- src={theme.images.general.phone}
499
- width={16}
500
- color={theme.colors.disabled}
501
- />
502
- </TouchableOpacity>
490
+ {(!!order?.business?.cellphone || !!order?.business?.phone) && (
491
+ <View style={{ paddingEnd: 5 }}>
492
+ <OLink
493
+ url={`tel:${order?.business?.cellphone ?? order?.business?.phone}`}
494
+ >
495
+ <OIcon
496
+ src={theme.images.general.phone}
497
+ width={16}
498
+ color={theme.colors.disabled}
499
+ />
500
+ </OLink>
501
+ </View>
502
+ )}
503
503
  <TouchableOpacity
504
504
  style={{ paddingStart: 5 }}
505
505
  onPress={() => handleOpenMessagesForBusiness()}>