ordering-ui-react-native 0.13.2 → 0.13.3
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/DeliveryApp.tsx +19 -2
- package/src/components/BusinessProductsListing/index.tsx +2 -2
- package/themes/kiosk/src/components/BusinessMenu/index.tsx +1 -3
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +108 -55
- package/themes/kiosk/src/components/NavBar/index.tsx +9 -2
- package/themes/kiosk/src/components/OrderTypeSelector/index.tsx +2 -2
- package/themes/kiosk/src/components/shared/OCard.tsx +1 -1
- package/themes/kiosk/src/types/index.d.ts +2 -0
package/package.json
CHANGED
package/src/DeliveryApp.tsx
CHANGED
|
@@ -25,13 +25,30 @@ import AppContainer from './AppContainer';
|
|
|
25
25
|
Sentry.init({
|
|
26
26
|
environment: Platform.OS === 'ios' ? 'ios' : 'android',
|
|
27
27
|
dsn: 'https://90197fffe6a1431b8c3eb79e1e36f0ee@o460529.ingest.sentry.io/5722123',
|
|
28
|
-
release: process.env.npm_package_version ? 'ordering-ui-native@' + process.env.npm_package_version : 'ordering-ui-native@' + '0.0.
|
|
28
|
+
release: process.env.npm_package_version ? 'ordering-ui-native@' + process.env.npm_package_version : 'ordering-ui-native@' + '0.0.4',
|
|
29
29
|
ignoreErrors: [
|
|
30
30
|
'is not defined',
|
|
31
31
|
'is not a function',
|
|
32
32
|
'can\'t find variable',
|
|
33
33
|
'objects are not valid',
|
|
34
|
-
'element type is invalid'
|
|
34
|
+
'element type is invalid',
|
|
35
|
+
'requiring module',
|
|
36
|
+
'has not been registered',
|
|
37
|
+
'failed to connect to debugger!',
|
|
38
|
+
'rendered more hooks than',
|
|
39
|
+
'rendered fewer hooks than',
|
|
40
|
+
'should have a queue',
|
|
41
|
+
'the OS most likely terminated',
|
|
42
|
+
'Connection timed out',
|
|
43
|
+
'java.io.EOFException',
|
|
44
|
+
'Abort',
|
|
45
|
+
'Segfault',
|
|
46
|
+
'Failed to allocate a',
|
|
47
|
+
'Application Not Responding',
|
|
48
|
+
'connection no longer valid',
|
|
49
|
+
'IllegalInstruction',
|
|
50
|
+
'React.Children.only expected to receive a single React element child.',
|
|
51
|
+
'unrecognized selector sent to instance'
|
|
35
52
|
],
|
|
36
53
|
});
|
|
37
54
|
|
|
@@ -191,7 +191,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
191
191
|
<>
|
|
192
192
|
{!(business?.categories?.length === 0) && (
|
|
193
193
|
<BusinessProductsCategories
|
|
194
|
-
categories={[{ id: null, name: t('ALL', 'All') }, { id: 'featured', name: t('FEATURED', 'Featured') }, ...business?.categories
|
|
194
|
+
categories={[{ id: null, name: t('ALL', 'All') }, { id: 'featured', name: t('FEATURED', 'Featured') }, ...business?.categories?.sort((a: any, b: any) => a.rank - b.rank)]}
|
|
195
195
|
categorySelected={categorySelected}
|
|
196
196
|
onClickCategory={handleChangeCategory}
|
|
197
197
|
featured={featuredProducts}
|
|
@@ -203,7 +203,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
203
203
|
categories={[
|
|
204
204
|
{ id: null, name: t('ALL', 'All') },
|
|
205
205
|
{ id: 'featured', name: t('FEATURED', 'Featured') },
|
|
206
|
-
...business?.categories
|
|
206
|
+
...business?.categories?.sort((a: any, b: any) => a.rank - b.rank)
|
|
207
207
|
]}
|
|
208
208
|
category={categorySelected}
|
|
209
209
|
categoryState={categoryState}
|
|
@@ -56,9 +56,7 @@ const BusinessMenu = (props:any): React.ReactElement => {
|
|
|
56
56
|
clearTimeout(timerId.current);
|
|
57
57
|
timerId.current = setTimeout(() => {
|
|
58
58
|
setClearCart(true)
|
|
59
|
-
navigation.
|
|
60
|
-
routes: [{ name: 'Intro' }],
|
|
61
|
-
})
|
|
59
|
+
navigation.navigate('Intro')
|
|
62
60
|
}, 60000*2);
|
|
63
61
|
}, []);
|
|
64
62
|
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { View, StyleSheet } from 'react-native'
|
|
2
|
+
import { View, StyleSheet, ScrollView, TouchableOpacity } from 'react-native'
|
|
3
3
|
import { BusinessAndProductList, useLanguage } from 'ordering-components/native'
|
|
4
|
-
import
|
|
5
|
-
import { BusinessProductsListingParams, Business, Product } from '../../types'
|
|
4
|
+
import { BusinessProductsListingParams, Business } from '../../types'
|
|
6
5
|
import { OCard, OText, OIcon } from '../shared'
|
|
7
6
|
import GridContainer from '../../layouts/GridContainer'
|
|
8
|
-
import PromoCard from '../PromoCard';
|
|
9
7
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
10
8
|
import { LANDSCAPE, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
|
|
11
|
-
import { useTheme } from 'styled-components/native';
|
|
9
|
+
import styled, { useTheme } from 'styled-components/native';
|
|
12
10
|
|
|
13
11
|
const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
14
12
|
const {navigation, businessState, resetInactivityTimeout, clearInactivityTimeout, bottomSheetVisibility } = props;
|
|
@@ -18,6 +16,27 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
18
16
|
const theme = useTheme();
|
|
19
17
|
const [, t] = useLanguage();
|
|
20
18
|
const [orientationState] = useDeviceOrientation();
|
|
19
|
+
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
20
|
+
|
|
21
|
+
const styles = StyleSheet.create({
|
|
22
|
+
logo: {
|
|
23
|
+
width: 500,
|
|
24
|
+
height: 400,
|
|
25
|
+
alignSelf: 'center',
|
|
26
|
+
},
|
|
27
|
+
soldOut: {
|
|
28
|
+
top: 0,
|
|
29
|
+
left: 0,
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
width: WIDTH_SCREEN * 0.15,
|
|
32
|
+
height: 50,
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
backgroundColor: theme.colors.white,
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
borderRadius: 15,
|
|
37
|
+
opacity: 0.8,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
21
40
|
|
|
22
41
|
const _categories: any = business?.original?.categories;
|
|
23
42
|
let _promos: any = [];
|
|
@@ -39,13 +58,30 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
39
58
|
</View>
|
|
40
59
|
);
|
|
41
60
|
|
|
42
|
-
const
|
|
61
|
+
const RenderCategories = ({ item, cardStyle, widthScreen }: any) => {
|
|
62
|
+
const Category = styled.ImageBackground`
|
|
63
|
+
position: relative;
|
|
64
|
+
height: 150px;
|
|
65
|
+
width: ${(props: any) => props.w * 0.45}px;
|
|
66
|
+
border-radius: 10px;
|
|
67
|
+
padding: 10px;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
align-items: center;
|
|
72
|
+
`
|
|
73
|
+
const WrapText = styled.View`
|
|
74
|
+
height: 90px;
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
align-items: center;
|
|
78
|
+
border-radius: 10px;
|
|
79
|
+
`
|
|
80
|
+
|
|
43
81
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
image={{uri: item?.images}}
|
|
48
|
-
isOutOfStock={!item?.inventoried}
|
|
82
|
+
<TouchableOpacity
|
|
83
|
+
key={item.id}
|
|
84
|
+
activeOpacity={1}
|
|
49
85
|
onPress={() => {
|
|
50
86
|
resetInactivityTimeout()
|
|
51
87
|
navigation.navigate('ProductDetails', {
|
|
@@ -54,37 +90,71 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
54
90
|
product: item,
|
|
55
91
|
});
|
|
56
92
|
}}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
93
|
+
>
|
|
94
|
+
<Category
|
|
95
|
+
style={cardStyle}
|
|
96
|
+
source={{uri: item.images}}
|
|
97
|
+
resizeMode="cover"
|
|
98
|
+
w={widthScreen}
|
|
99
|
+
borderRadius={16}
|
|
100
|
+
>
|
|
101
|
+
{item?.inventoried && (
|
|
102
|
+
<View style={styles.soldOut}>
|
|
103
|
+
<OText size={28} color={theme.colors.error}>
|
|
104
|
+
{t('SOLD_OUT', 'SOLD OUT')}
|
|
105
|
+
</OText>
|
|
106
|
+
</View>
|
|
107
|
+
)}
|
|
108
|
+
<WrapText>
|
|
109
|
+
<OText
|
|
110
|
+
color={theme.colors.white}
|
|
111
|
+
mLeft={0}
|
|
112
|
+
size={32}
|
|
113
|
+
numberOfLines={1}
|
|
114
|
+
// mBottom={8}
|
|
115
|
+
style={{...props?.titleStyle}}
|
|
116
|
+
weight="bold"
|
|
117
|
+
>
|
|
118
|
+
{item.name}
|
|
119
|
+
</OText>
|
|
120
|
+
{!!item?.description && (
|
|
121
|
+
<OText
|
|
122
|
+
color={theme.colors.white}
|
|
123
|
+
numberOfLines={1}
|
|
124
|
+
// mBottom={4}
|
|
125
|
+
size={18}
|
|
126
|
+
style={{...props?.descriptionStyle}}
|
|
127
|
+
weight="400"
|
|
128
|
+
>
|
|
129
|
+
{item.description}
|
|
130
|
+
</OText>
|
|
131
|
+
)}
|
|
132
|
+
</WrapText>
|
|
133
|
+
</Category>
|
|
134
|
+
</TouchableOpacity>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
62
137
|
|
|
63
138
|
const _renderPromos = (): React.ReactElement => (
|
|
64
139
|
<>
|
|
65
140
|
{_renderTitle(t('FEATURED', 'Featured'))}
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
inactiveSlideOpacity={1}
|
|
84
|
-
initialScrollIndex={0}
|
|
85
|
-
onScrollToIndexFailed={(_: any) => {}}
|
|
86
|
-
enableMomentum={true}
|
|
87
|
-
/>
|
|
141
|
+
<View style={{ paddingVertical: 20, marginLeft: 20, width: '100%' }}>
|
|
142
|
+
<ScrollView
|
|
143
|
+
horizontal
|
|
144
|
+
showsHorizontalScrollIndicator={false}
|
|
145
|
+
showsVerticalScrollIndicator={false}
|
|
146
|
+
style={{ width: '100%' }}
|
|
147
|
+
>
|
|
148
|
+
{_promos.map((category: any) => (
|
|
149
|
+
<RenderCategories
|
|
150
|
+
key={category.id}
|
|
151
|
+
item={category}
|
|
152
|
+
widthScreen={WIDTH_SCREEN}
|
|
153
|
+
cardStyle={{ marginRight: 20 }}
|
|
154
|
+
/>
|
|
155
|
+
))}
|
|
156
|
+
</ScrollView>
|
|
157
|
+
</View>
|
|
88
158
|
</>
|
|
89
159
|
);
|
|
90
160
|
|
|
@@ -148,23 +218,6 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
148
218
|
);
|
|
149
219
|
};
|
|
150
220
|
|
|
151
|
-
const styles = StyleSheet.create({
|
|
152
|
-
logo: {
|
|
153
|
-
width: 500,
|
|
154
|
-
height: 400,
|
|
155
|
-
alignSelf: 'center',
|
|
156
|
-
},
|
|
157
|
-
wrapper: {
|
|
158
|
-
display: 'flex',
|
|
159
|
-
flex: 1,
|
|
160
|
-
flexDirection: 'column',
|
|
161
|
-
justifyContent: 'center',
|
|
162
|
-
alignItems: 'center',
|
|
163
|
-
height: '100%',
|
|
164
|
-
backgroundColor: 'yellow'
|
|
165
|
-
},
|
|
166
|
-
});
|
|
167
|
-
|
|
168
221
|
export const BusinessProductsListing = (props: any) => {
|
|
169
222
|
const businessProductslistingProps = {
|
|
170
223
|
...props,
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components/native'
|
|
|
3
3
|
import { OIcon, OButton, OText } from '../shared'
|
|
4
4
|
import { ImageStyle, TextStyle, View, Platform } from 'react-native'
|
|
5
5
|
import { OrderTypeSelector } from '../OrderTypeSelector'
|
|
6
|
-
import { useConfig } from 'ordering-components/native'
|
|
6
|
+
import { useConfig, useLanguage } from 'ordering-components/native'
|
|
7
7
|
import { useTheme } from 'styled-components/native'
|
|
8
8
|
|
|
9
9
|
const Wrapper = styled.View`
|
|
@@ -60,6 +60,7 @@ interface Props {
|
|
|
60
60
|
const NavBar = (props: Props) => {
|
|
61
61
|
const theme = useTheme();
|
|
62
62
|
const [{ configs }] = useConfig();
|
|
63
|
+
const [, t] = useLanguage();
|
|
63
64
|
const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || [];
|
|
64
65
|
|
|
65
66
|
return (
|
|
@@ -113,7 +114,13 @@ const NavBar = (props: Props) => {
|
|
|
113
114
|
</TitleTopWrapper>
|
|
114
115
|
|
|
115
116
|
{props?.includeOrderTypeSelector && (
|
|
116
|
-
<View
|
|
117
|
+
<View
|
|
118
|
+
style={{
|
|
119
|
+
paddingHorizontal: props.rightComponent ? 4 : 20,
|
|
120
|
+
flexDirection: 'row'
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
<OText style={{ paddingRight: 5 }}>{t('THIS_ORDER_IS_TO', 'This order is to')}</OText>
|
|
117
124
|
<OrderTypeSelector configTypes={configTypes} />
|
|
118
125
|
</View>
|
|
119
126
|
)}
|
|
@@ -85,11 +85,11 @@ export const OrderTypeSelector = (props: any) => {
|
|
|
85
85
|
orderTypes: props.orderType || [
|
|
86
86
|
{
|
|
87
87
|
value: 2,
|
|
88
|
-
content:
|
|
88
|
+
content: t('TAKE_OUT', 'Take out')
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
value: 3,
|
|
92
|
-
content:
|
|
92
|
+
content: t('EAT_IN', 'Eat in')
|
|
93
93
|
},
|
|
94
94
|
]
|
|
95
95
|
}
|