ordering-ui-react-native 0.12.34 → 0.12.38
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.
- package/package.json +1 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +6 -5
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -4
- package/themes/business/src/components/OrderDetails/Delivery.tsx +111 -108
- package/themes/business/src/types/index.tsx +3 -3
- package/themes/single-business/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/single-business/src/components/BusinessProductsListing/index.tsx +9 -8
- package/themes/single-business/src/components/BusinessesListing/index.tsx +307 -296
- package/themes/single-business/src/components/BusinessesListing/styles.tsx +41 -14
- package/themes/single-business/src/components/HelpAccountAndPayment/index.tsx +7 -6
- package/themes/single-business/src/components/HelpGuide/index.tsx +7 -6
- package/themes/single-business/src/components/HelpOrder/index.tsx +7 -6
- package/themes/single-business/src/components/LanguageSelector/index.tsx +87 -70
- package/themes/single-business/src/components/LoginForm/index.tsx +2 -2
- package/themes/single-business/src/components/OrderDetails/index.tsx +21 -21
- package/themes/single-business/src/components/ProductForm/index.tsx +682 -656
- package/themes/single-business/src/components/ProductForm/styles.tsx +1 -1
- package/themes/single-business/src/components/UserProfile/index.tsx +2 -2
- package/themes/single-business/src/components/shared/OIconButton.tsx +2 -2
- package/themes/single-business/src/components/shared/OInput.tsx +1 -0
- package/themes/single-business/src/components/shared/OLink.tsx +80 -0
- package/themes/single-business/src/components/shared/index.tsx +2 -0
- package/themes/single-business/src/types/index.tsx +3 -0
|
@@ -130,7 +130,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
return (
|
|
133
|
-
<View style={{ flex: 1, height: height - top - bottom -
|
|
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>
|
|
@@ -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
|
}
|