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
@@ -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
  }