ordering-ui-react-native 0.12.14 → 0.12.18
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/src/components/AddressList/index.tsx +3 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +168 -156
- package/themes/business/src/components/NewOrderNotification/index.tsx +14 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -1
- package/themes/business/src/components/OrdersOption/index.tsx +19 -15
- package/themes/business/src/components 2/AcceptOrRejectOrder/index.tsx +389 -0
- package/themes/business/src/components 2/AcceptOrRejectOrder/styles.tsx +36 -0
- package/themes/business/src/components 2/BusinessController/index.tsx +155 -0
- package/themes/business/src/components 2/BusinessController/styles.tsx +19 -0
- package/themes/business/src/components 2/Chat/index.tsx +1152 -0
- package/themes/business/src/components 2/Chat/styles.tsx +12 -0
- package/themes/business/src/components 2/Contacts/index.tsx +299 -0
- package/themes/business/src/components 2/Contacts/styles.tsx +42 -0
- package/themes/business/src/components 2/DriverMap/index.tsx +525 -0
- package/themes/business/src/components 2/FloatingButton/index.tsx +141 -0
- package/themes/business/src/components 2/FloatingButton/styles.tsx +35 -0
- package/themes/business/src/components 2/ForgotPasswordForm/index.tsx +204 -0
- package/themes/business/src/components 2/ForgotPasswordForm/styles.tsx +11 -0
- package/themes/business/src/components 2/GoogleMap/index.tsx +347 -0
- package/themes/business/src/components 2/Home/index.tsx +111 -0
- package/themes/business/src/components 2/Home/styles.tsx +27 -0
- package/themes/business/src/components 2/LanguageSelector/index.tsx +124 -0
- package/themes/business/src/components 2/LanguageSelector/lang_country.json +152 -0
- package/themes/business/src/components 2/LanguageSelector/styles.tsx +17 -0
- package/themes/business/src/components 2/LoginForm/index.tsx +663 -0
- package/themes/business/src/components 2/LoginForm/styles.tsx +48 -0
- package/themes/business/src/components 2/LogoutButton/index.tsx +63 -0
- package/themes/business/src/components 2/MapView/index.tsx +317 -0
- package/themes/business/src/components 2/MessagesOption/index.tsx +337 -0
- package/themes/business/src/components 2/MessagesOption/styles.tsx +27 -0
- package/themes/business/src/components 2/NewOrderNotification/index.tsx +167 -0
- package/themes/business/src/components 2/NewOrderNotification/styles.tsx +8 -0
- package/themes/business/src/components 2/NotFoundSource/index.tsx +52 -0
- package/themes/business/src/components 2/NotFoundSource/styles.tsx +17 -0
- package/themes/business/src/components 2/OrderDetails/Business.tsx +683 -0
- package/themes/business/src/components 2/OrderDetails/Delivery.tsx +454 -0
- package/themes/business/src/components 2/OrderDetails/OrderContentComponent.tsx +391 -0
- package/themes/business/src/components 2/OrderDetails/OrderHeaderComponent.tsx +148 -0
- package/themes/business/src/components 2/OrderDetails/styles.tsx +84 -0
- package/themes/business/src/components 2/OrderMessage/index.tsx +344 -0
- package/themes/business/src/components 2/OrderMessage/styles.tsx +5 -0
- package/themes/business/src/components 2/OrderSummary/index.tsx +700 -0
- package/themes/business/src/components 2/OrderSummary/styles.tsx +61 -0
- package/themes/business/src/components 2/OrdersOption/index.tsx +755 -0
- package/themes/business/src/components 2/OrdersOption/styles.tsx +54 -0
- package/themes/business/src/components 2/OrdersOptionBusiness/index.tsx +51 -0
- package/themes/business/src/components 2/OrdersOptionBusiness/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionCity/index.tsx +52 -0
- package/themes/business/src/components 2/OrdersOptionCity/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionDate/index.tsx +52 -0
- package/themes/business/src/components 2/OrdersOptionDate/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionDelivery/index.tsx +35 -0
- package/themes/business/src/components 2/OrdersOptionDelivery/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionDriver/index.tsx +50 -0
- package/themes/business/src/components 2/OrdersOptionDriver/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionPaymethod/index.tsx +49 -0
- package/themes/business/src/components 2/OrdersOptionPaymethod/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionStatus/index.tsx +46 -0
- package/themes/business/src/components 2/OrdersOptionStatus/styles.tsx +8 -0
- package/themes/business/src/components 2/PhoneInputNumber/index.tsx +160 -0
- package/themes/business/src/components 2/PhoneInputNumber/styles.tsx +3 -0
- package/themes/business/src/components 2/PreviousMessages/index.tsx +304 -0
- package/themes/business/src/components 2/PreviousMessages/styles.tsx +32 -0
- package/themes/business/src/components 2/PreviousOrders/index.tsx +180 -0
- package/themes/business/src/components 2/PreviousOrders/styles.tsx +38 -0
- package/themes/business/src/components 2/ProductItemAccordion/index.tsx +301 -0
- package/themes/business/src/components 2/ProductItemAccordion/styles.tsx +61 -0
- package/themes/business/src/components 2/SearchBar/index.tsx +112 -0
- package/themes/business/src/components 2/SignupForm/index.tsx +530 -0
- package/themes/business/src/components 2/SignupForm/styles.tsx +16 -0
- package/themes/business/src/components 2/StoresList/index.tsx +208 -0
- package/themes/business/src/components 2/StoresList/styles.tsx +26 -0
- package/themes/business/src/components 2/UserFormDetails/index.tsx +513 -0
- package/themes/business/src/components 2/UserFormDetails/styles.tsx +40 -0
- package/themes/business/src/components 2/UserProfileForm/index.tsx +496 -0
- package/themes/business/src/components 2/UserProfileForm/styles.tsx +36 -0
- package/themes/business/src/components 2/VerifyPhone/index.tsx +201 -0
- package/themes/business/src/components 2/VerifyPhone/styles.tsx +43 -0
- package/themes/business/src/components 2/shared/OAlert.tsx +52 -0
- package/themes/business/src/components 2/shared/OButton.tsx +149 -0
- package/themes/business/src/components 2/shared/OChatBubble.tsx +100 -0
- package/themes/business/src/components 2/shared/ODropDown.tsx +195 -0
- package/themes/business/src/components 2/shared/ODropDownCalendar.tsx +328 -0
- package/themes/business/src/components 2/shared/OFab.tsx +54 -0
- package/themes/business/src/components 2/shared/OIcon.tsx +67 -0
- package/themes/business/src/components 2/shared/OIconButton.tsx +127 -0
- package/themes/business/src/components 2/shared/OInput.tsx +144 -0
- package/themes/business/src/components 2/shared/OLink.tsx +76 -0
- package/themes/business/src/components 2/shared/OModal.tsx +275 -0
- package/themes/business/src/components 2/shared/OSegment.tsx +86 -0
- package/themes/business/src/components 2/shared/OText.tsx +55 -0
- package/themes/business/src/components 2/shared/OTextarea.tsx +46 -0
- package/themes/business/src/components 2/shared/OToast.tsx +92 -0
- package/themes/business/src/components 2/shared/index.tsx +27 -0
- package/themes/business/src/types/index.tsx +4 -1
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +128 -83
- package/themes/kiosk/src/components/DrawerView/index.tsx +57 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +30 -0
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +78 -58
- package/themes/kiosk/src/components/OrderDetails/index.tsx +3 -1
- package/themes/kiosk/src/components/ProductForm/index.tsx +129 -127
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +9 -6
- package/themes/original/src/components/OrderProgress/index.tsx +32 -18
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { TouchableOpacity, View, StyleSheet } from 'react-native';
|
|
3
|
+
import CountryPicker, { Flag } from 'react-native-country-picker-modal';
|
|
4
|
+
import { useTheme } from 'styled-components/native';
|
|
5
|
+
import {
|
|
6
|
+
LanguageSelector as LanguageSelectorController,
|
|
7
|
+
useLanguage,
|
|
8
|
+
} from 'ordering-components/native';
|
|
9
|
+
import { Container, LanguageItem } from './styles';
|
|
10
|
+
import langCountries from './lang_country.json';
|
|
11
|
+
import { OText, OIcon } from '../shared';
|
|
12
|
+
import { LanguageSelectorParams } from '../../types';
|
|
13
|
+
|
|
14
|
+
const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
15
|
+
const { languagesState, currentLanguage, handleChangeLanguage } = props;
|
|
16
|
+
|
|
17
|
+
const [, t] = useLanguage();
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
|
|
20
|
+
const [isCountryModalVisible, setCountryModalVisible] = useState(false);
|
|
21
|
+
|
|
22
|
+
const _languages = languagesState?.languages?.map((language: any) => {
|
|
23
|
+
return {
|
|
24
|
+
key: language?.code,
|
|
25
|
+
value: language?.code,
|
|
26
|
+
label: language?.name,
|
|
27
|
+
inputLabel: language?.code.toUpperCase(),
|
|
28
|
+
countryCode: langCountries.find(item => item.value == language?.code)
|
|
29
|
+
?.countryCode,
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
_languages &&
|
|
34
|
+
_languages?.sort((a: any, b: any) =>
|
|
35
|
+
a.content > b.content ? 1 : b.content > a.content ? -1 : 0,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const countryCodes = _languages?.map((item: any) => item.countryCode);
|
|
39
|
+
|
|
40
|
+
const currentLanguageData = _languages?.find(
|
|
41
|
+
(item: any) => item.value == currentLanguage,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
text: {
|
|
46
|
+
fontFamily: 'Poppins',
|
|
47
|
+
fontStyle: 'normal',
|
|
48
|
+
fontWeight: 'normal',
|
|
49
|
+
fontSize: 16,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Container style={{ backgroundColor: theme.colors.inputChat }}>
|
|
55
|
+
{languagesState?.languages && (
|
|
56
|
+
<CountryPicker
|
|
57
|
+
countryCode={currentLanguageData}
|
|
58
|
+
visible={isCountryModalVisible}
|
|
59
|
+
onClose={() => setCountryModalVisible(false)}
|
|
60
|
+
withCountryNameButton
|
|
61
|
+
countryCodes={countryCodes}
|
|
62
|
+
//@ts-ignore
|
|
63
|
+
renderFlagButton={() => (
|
|
64
|
+
<TouchableOpacity onPress={() => setCountryModalVisible(true)}>
|
|
65
|
+
<LanguageItem justifyContent="space-between">
|
|
66
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
67
|
+
<Flag
|
|
68
|
+
withEmoji
|
|
69
|
+
flagSize={24}
|
|
70
|
+
countryCode={currentLanguageData?.countryCode}
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<OText style={styles.text}>
|
|
74
|
+
{currentLanguageData?.label}
|
|
75
|
+
</OText>
|
|
76
|
+
</View>
|
|
77
|
+
|
|
78
|
+
<OIcon
|
|
79
|
+
src={theme?.images?.general?.chevronDown}
|
|
80
|
+
|
|
81
|
+
width={20}
|
|
82
|
+
height={20}
|
|
83
|
+
/>
|
|
84
|
+
</LanguageItem>
|
|
85
|
+
</TouchableOpacity>
|
|
86
|
+
)}
|
|
87
|
+
flatListProps={{
|
|
88
|
+
keyExtractor: (item: any) => item.value,
|
|
89
|
+
data: _languages || [],
|
|
90
|
+
renderItem: ({ item }: any) => (
|
|
91
|
+
<TouchableOpacity
|
|
92
|
+
onPress={() => {
|
|
93
|
+
handleChangeLanguage(item.value);
|
|
94
|
+
setCountryModalVisible(false);
|
|
95
|
+
}}
|
|
96
|
+
activeOpacity={1}>
|
|
97
|
+
<LanguageItem>
|
|
98
|
+
<View />
|
|
99
|
+
|
|
100
|
+
<Flag
|
|
101
|
+
withEmoji
|
|
102
|
+
flagSize={24}
|
|
103
|
+
countryCode={item.countryCode}
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
<OText style={styles.text}>{t(item.code, item.label)}</OText>
|
|
107
|
+
</LanguageItem>
|
|
108
|
+
</TouchableOpacity>
|
|
109
|
+
),
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
</Container>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const LanguageSelector = (props: LanguageSelectorParams) => {
|
|
118
|
+
const LanguageProps = {
|
|
119
|
+
...props,
|
|
120
|
+
UIComponent: LanguageSelectorUI,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return <LanguageSelectorController {...LanguageProps} />;
|
|
124
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputLabel": "EN",
|
|
4
|
+
"label": "English",
|
|
5
|
+
"value": "en",
|
|
6
|
+
"countryCode": "US"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"inputLabel": "DE",
|
|
10
|
+
"label": "German",
|
|
11
|
+
"value": "de",
|
|
12
|
+
"countryCode": "DE"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"inputLabel": "ES",
|
|
16
|
+
"label": "Spanish",
|
|
17
|
+
"value": "es",
|
|
18
|
+
"countryCode": "ES"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"inputLabel": "MX",
|
|
22
|
+
"label": "Spanish",
|
|
23
|
+
"value": "es-419-1",
|
|
24
|
+
"countryCode": "MX"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"inputLabel": "MX",
|
|
28
|
+
"label": "Spanish",
|
|
29
|
+
"value": "es-419-2",
|
|
30
|
+
"countryCode": "GT"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"inputLabel": "DA",
|
|
34
|
+
"label": "Danish",
|
|
35
|
+
"value": "da",
|
|
36
|
+
"countryCode": "DK"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"inputLabel": "NL",
|
|
40
|
+
"label": "Dutch",
|
|
41
|
+
"value": "nl",
|
|
42
|
+
"countryCode": "NL"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"inputLabel": "PT",
|
|
46
|
+
"label": "Portuguese",
|
|
47
|
+
"value": "pt",
|
|
48
|
+
"countryCode": "PT"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"inputLabel": "CA",
|
|
52
|
+
"label": "Catalan",
|
|
53
|
+
"value": "ca",
|
|
54
|
+
"countryCode": "ES"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"inputLabel": "FR",
|
|
58
|
+
"label": "French",
|
|
59
|
+
"value": "fr",
|
|
60
|
+
"countryCode": "FR"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"inputLabel": "TR",
|
|
64
|
+
"label": "Turkish",
|
|
65
|
+
"value": "tr",
|
|
66
|
+
"countryCode": "TR"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"inputLabel": "KM",
|
|
70
|
+
"label": "Cambodian",
|
|
71
|
+
"value": "km",
|
|
72
|
+
"countryCode": "KH"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"inputLabel": "ZH-CN",
|
|
76
|
+
"label": "Chinese Simplified",
|
|
77
|
+
"value": "zh-CN",
|
|
78
|
+
"countryCode": "CN"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"inputLabel": "HI",
|
|
82
|
+
"label": "Hindi",
|
|
83
|
+
"value": "hi",
|
|
84
|
+
"countryCode": "IN"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"inputLabel": "ID",
|
|
88
|
+
"label": "Indonesian",
|
|
89
|
+
"value": "id",
|
|
90
|
+
"countryCode": "ID"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"inputLabel": "KN",
|
|
94
|
+
"label": "Kannad",
|
|
95
|
+
"value": "kn",
|
|
96
|
+
"countryCode": "IN"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"inputLabel": "MS",
|
|
100
|
+
"label": "Malay",
|
|
101
|
+
"value": "ms",
|
|
102
|
+
"countryCode": "MY"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"inputLabel": "TA",
|
|
106
|
+
"label": "Tamil",
|
|
107
|
+
"value": "ta",
|
|
108
|
+
"countryCode": "IN"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"inputLabel": "AR",
|
|
112
|
+
"label": "Arabic",
|
|
113
|
+
"value": "ar",
|
|
114
|
+
"countryCode": "EG"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"inputLabel": "RU",
|
|
118
|
+
"label": "Russian",
|
|
119
|
+
"value": "ru",
|
|
120
|
+
"countryCode": "RU"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"inputLabel": "JA",
|
|
124
|
+
"label": "Japanese",
|
|
125
|
+
"value": "ja",
|
|
126
|
+
"countryCode": "JP"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"inputLabel": "BN",
|
|
130
|
+
"label": "Bengali",
|
|
131
|
+
"value": "bn",
|
|
132
|
+
"countryCode": "BD"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"inputLabel": "IT",
|
|
136
|
+
"label": "Italian",
|
|
137
|
+
"value": "it",
|
|
138
|
+
"countryCode": "IT"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"inputLabel": "EL",
|
|
142
|
+
"label": "Greek",
|
|
143
|
+
"value": "el",
|
|
144
|
+
"countryCode": "GR"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"inputLabel": "BG",
|
|
148
|
+
"label": "Bulgarian Translation",
|
|
149
|
+
"value": "bg",
|
|
150
|
+
"countryCode": "BG"
|
|
151
|
+
}
|
|
152
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled from 'styled-components/native';
|
|
2
|
+
|
|
3
|
+
export const Container = styled.View`
|
|
4
|
+
justify-content: flex-end;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
border-radius: 7.6px;
|
|
7
|
+
margin-bottom: 18px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const LanguageItem = styled.View`
|
|
12
|
+
padding: 8px;
|
|
13
|
+
align-items: center;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
justify-content: ${(props: any) =>
|
|
16
|
+
props?.justifyContent ? props?.justifyContent : 'flex-start'};
|
|
17
|
+
`;
|