ordering-ui-react-native 0.12.32 → 0.12.36

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 (34) hide show
  1. package/package.json +1 -1
  2. package/themes/business/src/components/OrderDetails/Delivery.tsx +206 -178
  3. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +344 -334
  4. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +83 -69
  5. package/themes/business/src/components/OrdersOption/index.tsx +122 -77
  6. package/themes/business/src/components/PreviousOrders/index.tsx +124 -73
  7. package/themes/business/src/components/PreviousOrders/styles.tsx +7 -0
  8. package/themes/business/src/components/ProductItemAccordion/index.tsx +26 -25
  9. package/themes/business/src/components/shared/OButton.tsx +0 -1
  10. package/themes/business/src/components/shared/OIcon.tsx +2 -0
  11. package/themes/business/src/types/index.tsx +5 -0
  12. package/themes/single-business/src/components/BusinessBasicInformation/index.tsx +1 -1
  13. package/themes/single-business/src/components/BusinessProductsListing/index.tsx +9 -8
  14. package/themes/single-business/src/components/BusinessesListing/index.tsx +307 -296
  15. package/themes/single-business/src/components/BusinessesListing/styles.tsx +41 -14
  16. package/themes/single-business/src/components/HelpAccountAndPayment/index.tsx +7 -6
  17. package/themes/single-business/src/components/HelpGuide/index.tsx +7 -6
  18. package/themes/single-business/src/components/HelpOrder/index.tsx +7 -6
  19. package/themes/single-business/src/components/LanguageSelector/index.tsx +87 -70
  20. package/themes/single-business/src/components/LoginForm/index.tsx +2 -2
  21. package/themes/single-business/src/components/OrderDetails/index.tsx +21 -21
  22. package/themes/single-business/src/components/ProductForm/index.tsx +682 -656
  23. package/themes/single-business/src/components/ProductForm/styles.tsx +1 -1
  24. package/themes/single-business/src/components/UserProfile/index.tsx +2 -2
  25. package/themes/single-business/src/components/shared/OIconButton.tsx +2 -2
  26. package/themes/single-business/src/components/shared/OInput.tsx +1 -0
  27. package/themes/single-business/src/components/shared/OLink.tsx +80 -0
  28. package/themes/single-business/src/components/shared/index.tsx +2 -0
  29. package/themes/single-business/src/types/index.tsx +3 -0
  30. package/themes/uber-eats/src/components/AddressList/index.tsx +1 -1
  31. package/themes/uber-eats/src/components/Messages/index.tsx +4 -4
  32. package/themes/uber-eats/src/components/shared/OButton.tsx +0 -1
  33. package/themes/uber-eats/src/components/shared/ODropDown.tsx +3 -2
  34. package/themes/uber-eats/src/components/shared/OIcon.tsx +3 -2
@@ -75,4 +75,4 @@ export const ProductActions = styled.View`
75
75
  `
76
76
  export const ExtraOptionWrap = styled.ScrollView`
77
77
  margin-horizontal: -40px;
78
- `;
78
+ `;
@@ -130,7 +130,7 @@ const ProfileListUI = (props: ProfileParams) => {
130
130
  }
131
131
 
132
132
  return (
133
- <View style={{ flex: 1, height: height - top - bottom - 62 }}>
133
+ <View style={{ flex: 1, height: height - top - bottom - 80 }}>
134
134
  <OText size={24} color={theme.colors.textNormal} lineHeight={36} weight={Platform.OS === 'ios' ? '600' : 'bold'} style={{ marginTop: 14, marginBottom: 24, ...styles.pagePadding }}>{t('PROFILE', 'Profile')}</OText>
135
135
  <CenterView style={styles.pagePadding}>
136
136
  <View style={styles.photo}>
@@ -167,7 +167,7 @@ const ProfileListUI = (props: ProfileParams) => {
167
167
  </Actions>
168
168
 
169
169
  <Actions>
170
- <LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} />
170
+ <LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} allowLoading />
171
171
  <View style={{ height: 17 }} />
172
172
  <LogoutButton color={theme.colors.textNormal} text={t('LOGOUT', 'Logout')} />
173
173
  </Actions>
@@ -21,8 +21,8 @@ const DisabledWrapper = styled.View`
21
21
  justify-content: center;
22
22
  `
23
23
  const Icon = styled.Image`
24
- width: 22px;
25
- height: 22px;
24
+ width: 20px;
25
+ height: 20px;
26
26
  `
27
27
  const Title = styled.Text`
28
28
  font-size: 16px;
@@ -74,6 +74,7 @@ const OInput = (props: Props): React.ReactElement => {
74
74
  <Input
75
75
  name={props.name}
76
76
  secureTextEntry={props.isSecured}
77
+ numberOfLines={props.numberOfLines}
77
78
  onChangeText={(txt: any) => props.name ? props.onChange({ target: { name: props.name, value: txt } }) : props.onChange(txt)}
78
79
  defaultValue={props.value}
79
80
  placeholder={props.placeholder ? props.placeholder : ''}
@@ -0,0 +1,80 @@
1
+ import * as React from 'react';
2
+ import { Alert, Linking, Pressable, TextStyle } from 'react-native';
3
+ import { useLanguage } from 'ordering-components/native';
4
+ import OText from './OText';
5
+ import OButton from './OButton';
6
+
7
+ interface Props {
8
+ url: string | undefined;
9
+ shorcut?: string;
10
+ color?: string;
11
+ PressStyle?: TextStyle;
12
+ TextStyle?: TextStyle;
13
+ type?: string;
14
+ hasButton?: boolean;
15
+ children?: any;
16
+ }
17
+
18
+ const OLink = (props: Props): React.ReactElement => {
19
+ const { url, shorcut, color, PressStyle, TextStyle, type, hasButton, children } = props;
20
+ const [, t] = useLanguage();
21
+
22
+ const handleAlert = () =>
23
+ Alert.alert(
24
+ t('ERROR_OPENING_THE_LINK', 'Error opening the link'),
25
+ t('LINK_UNSUPPORTED', 'Link could not be opened or is not supported'),
26
+ [
27
+ {
28
+ text: t('OK', 'Ok'),
29
+ },
30
+ ],
31
+ );
32
+
33
+ const handleOpenUrl = async (breakFunction = false) => {
34
+ if(breakFunction) {
35
+ return
36
+ }
37
+ if (!url) {
38
+ handleAlert();
39
+ return;
40
+ }
41
+
42
+ try {
43
+ const supported = await Linking.canOpenURL(url);
44
+
45
+ if (supported) {
46
+ await Linking.openURL(url);
47
+ } else {
48
+ handleAlert();
49
+ }
50
+ } catch (err) {
51
+ handleAlert();
52
+ }
53
+ };
54
+
55
+ return (
56
+ <Pressable style={PressStyle} onPress={() => handleOpenUrl(hasButton)}>
57
+ {children}
58
+ {!children && (
59
+ hasButton ? (
60
+ <OButton
61
+ onClick={() => handleOpenUrl()}
62
+ text={shorcut} imgRightSrc=''
63
+ textStyle={{color: 'white'}}
64
+ style={{width: '100%', alignSelf: 'center', borderRadius: 10}}
65
+ />
66
+ ) : (
67
+ <OText
68
+ style={TextStyle}
69
+ numberOfLines={1}
70
+ ellipsizeMode="tail"
71
+ color={color}>
72
+ {shorcut}
73
+ </OText>
74
+ )
75
+ )}
76
+ </Pressable>
77
+ );
78
+ };
79
+
80
+ export default OLink;
@@ -7,6 +7,7 @@ import OIconButton from './OIconButton'
7
7
  import OIconText from './OIconText'
8
8
  import OInput from './OInput'
9
9
  import OKeyButton from './OKeyButton'
10
+ import OLink from './OLink'
10
11
  import OModal from './OModal'
11
12
  import OText from './OText'
12
13
  import OTextarea from './OTextarea'
@@ -24,6 +25,7 @@ export {
24
25
  OTextarea,
25
26
  OToggle,
26
27
  OKeyButton,
28
+ OLink,
27
29
  OAlert,
28
30
  OModal,
29
31
  OBottomPopup,
@@ -117,6 +117,7 @@ export interface LanguageSelectorParams {
117
117
  handleChangeLanguage?: any;
118
118
  iconColor?: any;
119
119
  pickerStyle?: any;
120
+ allowLoading?: boolean;
120
121
  }
121
122
  export interface BusinessesListingParams {
122
123
  navigation?: any;
@@ -160,6 +161,7 @@ export interface BusinessProductsListingParams {
160
161
  categorySelected: any;
161
162
  handleSearchRedirect: any;
162
163
  errorQuantityProducts?: boolean;
164
+ isFranchiseApp?: boolean;
163
165
  header?: any;
164
166
  logo?: any;
165
167
  getNextProducts?: any;
@@ -173,6 +175,7 @@ export interface BusinessBasicInformationParams {
173
175
  businessState?: any;
174
176
  openBusinessInformation?: any;
175
177
  isBusinessInfoShow?: boolean;
178
+ isFranchiseApp?: boolean;
176
179
  header?: any;
177
180
  logo?: any;
178
181
  }
@@ -11,7 +11,6 @@ import { NotFoundSource } from '../NotFoundSource'
11
11
  import NavBar from '../NavBar'
12
12
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
13
13
 
14
- const addIcon = require('../../assets/icons/add-circular-outlined-button.png')
15
14
 
16
15
  const AddressListUI = (props: AddressListParams) => {
17
16
  const {
@@ -32,6 +31,7 @@ const AddressListUI = (props: AddressListParams) => {
32
31
  } = props
33
32
 
34
33
  const theme = useTheme()
34
+ const addIcon = theme.general?.images?.addCircularOutlined
35
35
 
36
36
  const styles = StyleSheet.create({
37
37
  address: {
@@ -10,9 +10,6 @@ import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboa
10
10
  import { Header, TitleHeader, Wrapper, QuickMessageContainer } from './styles'
11
11
  import { MessagesParams } from '../../types'
12
12
 
13
- const ImageDummy = require('../../assets/images/image.png')
14
- const paperIcon = require('../../assets/images/paper-plane.png')
15
-
16
13
  const ORDER_STATUS: any = {
17
14
  0: 'ORDER_STATUS_PENDING',
18
15
  1: 'ORDERS_COMPLETED',
@@ -61,8 +58,11 @@ const MessagesUI = (props: MessagesParams) => {
61
58
  const [formattedMessages, setFormattedMessages] = useState<Array<any>>([])
62
59
  const [isKeyboardShow, setIsKeyboardShow] = useState(false)
63
60
  const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
64
- const chatDisabled = previousStatus.includes(order?.status)
65
61
 
62
+ const ImageDummy = theme.images?.general?.ImageDummy
63
+ const paperIcon = theme?.images?.general?.paperIcon
64
+
65
+ const chatDisabled = previousStatus.includes(order?.status)
66
66
  const quickMessageList = [
67
67
  { key: 'customer_message_1', text: t('CUSTOMER_MESSAGE_1', 'customer_message_1') },
68
68
  { key: 'customer_message_2', text: t('CUSTOMER_MESSAGE_2', 'customer_message_2') },
@@ -128,7 +128,6 @@ OButton.defaultProps = {
128
128
  isDisabled: false,
129
129
  indicatorColor: 'white',
130
130
  activeOpacity: 0.5,
131
- imgRightSrc: require('../../assets/icons/arrow_right.png')
132
131
  };
133
132
 
134
133
  export default OButton;
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import styled, { css } from 'styled-components/native'
2
+ import styled, { css, useTheme } from 'styled-components/native'
3
3
  import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'
4
4
  import {
5
5
  ScrollView as CustomScrollView,
@@ -76,6 +76,7 @@ const ODropDown = (props: Props) => {
76
76
  isModal
77
77
  } = props
78
78
 
79
+ const theme = useTheme()
79
80
  const [isOpen, setIsOpen] = useState(false)
80
81
  const defaultOption = options?.find((option: any) => option.value === defaultValue)
81
82
  const [selectedOption, setSelectedOption] = useState<any>(defaultOption)
@@ -114,7 +115,7 @@ const ODropDown = (props: Props) => {
114
115
  <DropIcon
115
116
  textcolor={props.textcolor}
116
117
  secondary={secondary}
117
- source={require('../../assets/icons/drop_down.png')}
118
+ source={theme.images.general.dropDown}
118
119
  />
119
120
  </Selected>
120
121
  {isOpen && options && (
@@ -1,7 +1,7 @@
1
1
 
2
2
  import * as React from 'react'
3
3
  import { ImageStyle } from 'react-native'
4
- import styled from 'styled-components/native'
4
+ import styled, { useTheme } from 'styled-components/native'
5
5
 
6
6
  const Wrapper = styled.View``
7
7
 
@@ -23,10 +23,11 @@ interface Props {
23
23
  }
24
24
 
25
25
  const OImage = (props: Props): React.ReactElement => {
26
+ const theme = useTheme()
26
27
  return (
27
28
  <Wrapper style={{ borderRadius: props.style?.borderRadius, overflow: 'hidden', marginHorizontal: props.style?.marginHorizontal }}>
28
29
  <SImage
29
- source={props.src ? props.src : props.url ? { uri: props.url } : props.dummy ? props.dummy : require('../../assets/icons/lunch.png')}
30
+ source={props.src ? props.src : props.url ? { uri: props.url } : props.dummy ? props.dummy : theme.images.general.lunch}
30
31
  style={{
31
32
  tintColor: props.color,
32
33
  flex: props.isWrap ? 1 : 0,