ordering-ui-react-native 0.17.73-release → 0.17.74-release
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/original/src/components/OrderDetails/index.tsx +12 -19
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
package/src/pages/Help.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Container } from '../layouts/Container'
|
|
3
|
-
import { Help as HelpController } from '../components/Help'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
navigation: any;
|
|
8
|
-
route: any;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Help = (props: Props) => {
|
|
12
|
-
const helpProps = {
|
|
13
|
-
...props
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Container>
|
|
18
|
-
<HelpController {...helpProps} />
|
|
19
|
-
</Container>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default Help
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Container } from '../layouts/Container'
|
|
3
|
-
import { HelpAccountAndPayment as HelpAccountAndPaymentController } from '../components/HelpAccountAndPayment'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
navigation: any;
|
|
8
|
-
route: any;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const HelpAccountAndPayment = (props: Props) => {
|
|
12
|
-
const helpAccountAndPaymentProps = {
|
|
13
|
-
...props
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Container>
|
|
18
|
-
<HelpAccountAndPaymentController {...helpAccountAndPaymentProps} />
|
|
19
|
-
</Container>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default HelpAccountAndPayment
|
package/src/pages/HelpGuide.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Container } from '../layouts/Container'
|
|
3
|
-
import { HelpGuide as HelpGuideController } from '../components/HelpGuide'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
navigation: any;
|
|
8
|
-
route: any;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const HelpGuide = (props: Props) => {
|
|
12
|
-
const helpGuideProps = {
|
|
13
|
-
...props
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Container>
|
|
18
|
-
<HelpGuideController {...helpGuideProps} />
|
|
19
|
-
</Container>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default HelpGuide
|
package/src/pages/HelpOrder.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Container } from '../layouts/Container'
|
|
3
|
-
import { HelpOrder as HelpOrderController } from '../components/HelpOrder'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
navigation: any;
|
|
8
|
-
route: any;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const HelpOrder = (props: Props) => {
|
|
12
|
-
const helpOrderProps = {
|
|
13
|
-
...props
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Container>
|
|
18
|
-
<HelpOrderController {...helpOrderProps} />
|
|
19
|
-
</Container>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default HelpOrder
|
package/src/pages/Home.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSheet, SafeAreaView } from 'react-native';
|
|
3
|
-
import { Home as HomePage } from '../components/Home';
|
|
4
|
-
import { useTheme } from 'styled-components/native';
|
|
5
|
-
|
|
6
|
-
export const Home = (props: any) => {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
|
|
9
|
-
const homeProps = {
|
|
10
|
-
...props,
|
|
11
|
-
onNavigationRedirect: (page: string, params: any) => {
|
|
12
|
-
if (!page) return
|
|
13
|
-
props.navigation.navigate(page, params);
|
|
14
|
-
},
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const styles = StyleSheet.create({
|
|
18
|
-
wrapper: {
|
|
19
|
-
flex: 1,
|
|
20
|
-
display: 'flex',
|
|
21
|
-
flexDirection: 'column',
|
|
22
|
-
justifyContent: 'center',
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
height: '100%',
|
|
25
|
-
backgroundColor: theme.colors.backgroundPage,
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<SafeAreaView style={styles.wrapper}>
|
|
31
|
-
<HomePage {...homeProps} />
|
|
32
|
-
</SafeAreaView>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default Home;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {View, Text, Image, StyleSheet, StatusBar} from 'react-native';
|
|
3
|
-
import AppIntroSlider from 'react-native-app-intro-slider';
|
|
4
|
-
import { _setStoreData } from '../providers/StoreUtil';
|
|
5
|
-
import { useTheme } from 'styled-components/native';
|
|
6
|
-
import { useLanguage } from 'ordering-components/native';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const IntroductoryTutorial = ({ navigation, route }: any) => {
|
|
10
|
-
const [, t] = useLanguage();
|
|
11
|
-
const theme = useTheme()
|
|
12
|
-
const setTutorial = route?.params?.setTutorial
|
|
13
|
-
const data = [
|
|
14
|
-
{
|
|
15
|
-
title: t('DELIVERY_BY_ADDRESS', 'Delivery by Address'),
|
|
16
|
-
text: t('DELIVERY_BY_ADDRESS_INST', 'DELIVERY_BY_ADDRESS_INST'),
|
|
17
|
-
image: theme.images.tutorials.slide1,
|
|
18
|
-
bg: theme.colors.primaryContrast
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
title: t('SELECT_A_BUSINESS', 'SELECT_A_BUSINESS'),
|
|
22
|
-
text: t('SELECT_A_BUSINESS_INST', 'SELECT_A_BUSINESS_INST'),
|
|
23
|
-
image: theme.images.tutorials.slide2,
|
|
24
|
-
bg: theme.colors.primaryContrast
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
title: t('BUSINESS_MENU', 'BUSINESS_MENU'),
|
|
28
|
-
text: t('BUSINESS_MENU_INST', 'BUSINESS_MENU_INST'),
|
|
29
|
-
image: theme.images.tutorials.slide3,
|
|
30
|
-
bg: theme.colors.primaryContrast
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
title: t('PRODUCT_LIST', 'PRODUCT_LIST'),
|
|
34
|
-
text: t('PRODUCT_LIST_INST', 'PRODUCT_LIST_INST'),
|
|
35
|
-
image: theme.images.tutorials.slide4,
|
|
36
|
-
bg: theme.colors.primaryContrast
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
title: t('CHECKOUT_SCREEN', 'CHECKOUT_SCREEN'),
|
|
40
|
-
text: t('CHECKOUT_SCREEN_INST', 'CHECKOUT_SCREEN_INST'),
|
|
41
|
-
image: theme.images.tutorials.slide5,
|
|
42
|
-
bg: theme.colors.primaryContrast
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
title: t('TUTORIAL_ORDER_COMPLETED', 'TUTORIAL_ORDER_COMPLETED'),
|
|
46
|
-
text: t('TUTORIAL_ORDER_COMPLETED_INST', 'TUTORIAL_ORDER_COMPLETED_INST'),
|
|
47
|
-
image: theme.images.tutorials.slide6,
|
|
48
|
-
bg: theme.colors.primaryContrast
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
type Item = typeof data[0];
|
|
52
|
-
const styles = StyleSheet.create({
|
|
53
|
-
slide: {
|
|
54
|
-
flex: 1,
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
justifyContent: 'center',
|
|
57
|
-
paddingBottom: 80,
|
|
58
|
-
},
|
|
59
|
-
image: {
|
|
60
|
-
flex: 0,
|
|
61
|
-
top: 30,
|
|
62
|
-
width: '100%',
|
|
63
|
-
height: '75%',
|
|
64
|
-
resizeMode: 'contain',
|
|
65
|
-
},
|
|
66
|
-
text: {
|
|
67
|
-
color: theme.colors.colorTextTutorial,
|
|
68
|
-
textAlign: 'center',
|
|
69
|
-
fontSize: 17,
|
|
70
|
-
paddingRight: '2%',
|
|
71
|
-
paddingLeft: '2%',
|
|
72
|
-
top: '4%',
|
|
73
|
-
},
|
|
74
|
-
title: {
|
|
75
|
-
top: '2%',
|
|
76
|
-
fontSize: 25,
|
|
77
|
-
color: theme.colors.colorTextTutorial,
|
|
78
|
-
textAlign: 'center',
|
|
79
|
-
},
|
|
80
|
-
buttonCircle: {
|
|
81
|
-
top: '15%',
|
|
82
|
-
width: 50,
|
|
83
|
-
height: 40,
|
|
84
|
-
justifyContent: 'center',
|
|
85
|
-
alignItems: 'center',
|
|
86
|
-
position:'relative'
|
|
87
|
-
},
|
|
88
|
-
tutorialText: {
|
|
89
|
-
fontSize: 18,
|
|
90
|
-
fontWeight: '300',
|
|
91
|
-
color: theme.colors.primary
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const _renderItem = ({item}: {item: Item}) => {
|
|
96
|
-
return (
|
|
97
|
-
<View
|
|
98
|
-
style={[
|
|
99
|
-
styles.slide,
|
|
100
|
-
{
|
|
101
|
-
backgroundColor: item.bg,
|
|
102
|
-
},
|
|
103
|
-
]}>
|
|
104
|
-
<Text style={styles.title}>{item.title}</Text>
|
|
105
|
-
<Text style={styles.text}>{item.text}</Text>
|
|
106
|
-
<Image source={item.image} style={styles.image} />
|
|
107
|
-
</View>
|
|
108
|
-
);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const RenderNextButton = () => {
|
|
112
|
-
return (
|
|
113
|
-
<View style={styles.buttonCircle}>
|
|
114
|
-
<Text style={styles.tutorialText}>{t('TUTORIAL_NEXT', 'Next')}</Text>
|
|
115
|
-
</View>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const RenderSkipButton = () => {
|
|
120
|
-
return (
|
|
121
|
-
<View style={styles.buttonCircle}>
|
|
122
|
-
<Text style={styles.tutorialText}>{t('TUTORIAL_SKIP', 'Skip')}</Text>
|
|
123
|
-
</View>
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const RenderPrevButton = () => {
|
|
128
|
-
return (
|
|
129
|
-
<View style={styles.buttonCircle}>
|
|
130
|
-
<Text style={styles.tutorialText}>{t('TUTORIAL_BACK', 'Back')}</Text>
|
|
131
|
-
</View>
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const RenderDoneButton = () => {
|
|
136
|
-
return (
|
|
137
|
-
<View style={styles.buttonCircle}>
|
|
138
|
-
<Text style={styles.tutorialText}>{t('TUTORIAL_DONE', 'Done')}</Text>
|
|
139
|
-
</View>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const _onDone = () => {
|
|
144
|
-
setTutorial(false)
|
|
145
|
-
_setStoreData('isTutorial', false)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const _keyExtractor = (item: Item) => item.title;
|
|
149
|
-
|
|
150
|
-
return (
|
|
151
|
-
<View style={{flex: 1}}>
|
|
152
|
-
<StatusBar translucent backgroundColor="transparent" />
|
|
153
|
-
<AppIntroSlider
|
|
154
|
-
keyExtractor={_keyExtractor}
|
|
155
|
-
renderItem={_renderItem}
|
|
156
|
-
data={data}
|
|
157
|
-
onDone={_onDone}
|
|
158
|
-
activeDotStyle= {{backgroundColor: theme.colors.primary}}
|
|
159
|
-
renderDoneButton={RenderDoneButton}
|
|
160
|
-
renderNextButton={RenderNextButton}
|
|
161
|
-
renderSkipButton={RenderSkipButton}
|
|
162
|
-
renderPrevButton={RenderPrevButton}
|
|
163
|
-
showSkipButton
|
|
164
|
-
showPrevButton
|
|
165
|
-
/>
|
|
166
|
-
</View>
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
export default IntroductoryTutorial;
|
package/src/pages/Login.tsx
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
import styled from 'styled-components/native';
|
|
4
|
-
import { LoginForm } from '../components/LoginForm';
|
|
5
|
-
import { Container } from '../layouts/Container';
|
|
6
|
-
|
|
7
|
-
import { useLanguage } from 'ordering-components/native';
|
|
8
|
-
import { _setStoreData } from '../providers/StoreUtil';
|
|
9
|
-
import { useTheme } from 'styled-components/native';
|
|
10
|
-
|
|
11
|
-
const KeyboardView = styled.KeyboardAvoidingView`
|
|
12
|
-
flex: 1;
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
export const Login = ({ navigation, route }: any) => {
|
|
16
|
-
const [, t] = useLanguage()
|
|
17
|
-
const theme = useTheme()
|
|
18
|
-
|
|
19
|
-
const loginProps = {
|
|
20
|
-
navigation,
|
|
21
|
-
useLoginByCellphone: true,
|
|
22
|
-
loginButtonText: t('LOGIN', 'Login'),
|
|
23
|
-
loginButtonBackground: theme.colors.primary,
|
|
24
|
-
forgotButtonText: t('FORGOT_YOUR_PASSWORD', 'Forgot your password?'),
|
|
25
|
-
registerButtonText: t('SIGNUP', 'Signup'),
|
|
26
|
-
onNavigationRedirect: (page: string) => {
|
|
27
|
-
if (!page) return
|
|
28
|
-
navigation.navigate(page);
|
|
29
|
-
},
|
|
30
|
-
notificationState: route?.params?.notification_state
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
_setStoreData('notification_state', route?.params?.notification_state);
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<KeyboardView
|
|
37
|
-
enabled
|
|
38
|
-
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
39
|
-
>
|
|
40
|
-
<Container>
|
|
41
|
-
<LoginForm {...loginProps} />
|
|
42
|
-
</Container>
|
|
43
|
-
</KeyboardView>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default Login;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { useConfig } from 'ordering-components/native'
|
|
3
|
-
import { MomentOption as MomentOptionController } from '../components/MomentOption'
|
|
4
|
-
|
|
5
|
-
const MomentOption = ({ navigation, props }: any) => {
|
|
6
|
-
const [{ configs }] = useConfig()
|
|
7
|
-
const limitDays = configs?.max_days_preorder?.value
|
|
8
|
-
const currentDate = new Date()
|
|
9
|
-
const time = limitDays > 1
|
|
10
|
-
? currentDate.getTime() + ((limitDays - 1) * 24 * 60 * 60 * 1000)
|
|
11
|
-
: limitDays === 1 ? currentDate.getTime() : currentDate.getTime() + (6 * 24 * 60 * 60 * 1000)
|
|
12
|
-
|
|
13
|
-
currentDate.setTime(time)
|
|
14
|
-
currentDate.setHours(23)
|
|
15
|
-
currentDate.setMinutes(59)
|
|
16
|
-
const momentOptionProps = {
|
|
17
|
-
...props,
|
|
18
|
-
navigation: navigation,
|
|
19
|
-
maxDate: currentDate
|
|
20
|
-
}
|
|
21
|
-
return (
|
|
22
|
-
<>
|
|
23
|
-
{currentDate && (
|
|
24
|
-
<MomentOptionController {...momentOptionProps} />
|
|
25
|
-
)}
|
|
26
|
-
</>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default MomentOption
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Platform, KeyboardAvoidingView, StyleSheet } from 'react-native'
|
|
3
|
-
import { MultiCheckout as MultiCheckoutController } from '../../themes/original/src/components/MultiCheckout'
|
|
4
|
-
|
|
5
|
-
const MultiCheckout = (props: any) => {
|
|
6
|
-
const multiCheckoutProps = {
|
|
7
|
-
...props,
|
|
8
|
-
onPlaceOrderClick: (orderUuids: any) => {
|
|
9
|
-
props.navigation.navigate('MultiOrdersDetails', { orderUuids: orderUuids, isFromMultiCheckout: true })
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<KeyboardAvoidingView
|
|
15
|
-
enabled
|
|
16
|
-
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
17
|
-
style={styles.container}
|
|
18
|
-
>
|
|
19
|
-
<MultiCheckoutController {...multiCheckoutProps} />
|
|
20
|
-
</KeyboardAvoidingView>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const styles = StyleSheet.create({
|
|
25
|
-
container: {
|
|
26
|
-
flexGrow: 1,
|
|
27
|
-
paddingBottom: 70,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export default MultiCheckout
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Platform } from 'react-native'
|
|
3
|
-
import { MultiOrdersDetails as MultiOrdersDetailsController } from '../../themes/original/src/components/MultiOrdersDetails'
|
|
4
|
-
import styled from 'styled-components/native';
|
|
5
|
-
|
|
6
|
-
const SafeAreaContainer = styled.SafeAreaView`
|
|
7
|
-
flex: 1;
|
|
8
|
-
background-color: ${(props: any) => props.theme.colors.backgroundPage};
|
|
9
|
-
padding-top: ${Platform.OS === 'ios' ? '0px' : '24px'};
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
const MultiOrdersDetails = ({ navigation, route }: any) => {
|
|
13
|
-
const multiOrdersDetailsProps = {
|
|
14
|
-
navigation,
|
|
15
|
-
orderUuids: route.params?.orderUuids || [],
|
|
16
|
-
isFromMultiCheckout: route.params?.isFromMultiCheckout,
|
|
17
|
-
onRedirectPage: () => navigation.navigate('BusinessList')
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<SafeAreaContainer>
|
|
22
|
-
<MultiOrdersDetailsController {...multiOrdersDetailsProps} />
|
|
23
|
-
</SafeAreaContainer>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default MultiOrdersDetails
|
package/src/pages/MyOrders.tsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react'
|
|
2
|
-
import { useLanguage } from 'ordering-components/native'
|
|
3
|
-
import { OrdersOption } from '../components/OrdersOption'
|
|
4
|
-
import { OText } from '../components/shared'
|
|
5
|
-
import { Container } from '../layouts/Container'
|
|
6
|
-
|
|
7
|
-
const MyOrders = ({ navigation }: any) => {
|
|
8
|
-
|
|
9
|
-
const [, t] = useLanguage()
|
|
10
|
-
const [ordersLength,setOrdersLength] = useState({activeOrdersLength: 0, previousOrdersLength: 0})
|
|
11
|
-
const myOrderProps = {
|
|
12
|
-
navigation,
|
|
13
|
-
onNavigationRedirect: (page: string, params: any) => {
|
|
14
|
-
if (!page) return
|
|
15
|
-
navigation.navigate(page, params);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Container>
|
|
22
|
-
<OText size={24} mBottom={20}>
|
|
23
|
-
{t('MY_ORDERS', 'My Orders')}
|
|
24
|
-
</OText>
|
|
25
|
-
<OrdersOption
|
|
26
|
-
{...myOrderProps}
|
|
27
|
-
activeOrders
|
|
28
|
-
ordersLength={ordersLength}
|
|
29
|
-
setOrdersLength={setOrdersLength}
|
|
30
|
-
/>
|
|
31
|
-
<OrdersOption
|
|
32
|
-
{...myOrderProps}
|
|
33
|
-
ordersLength={ordersLength}
|
|
34
|
-
setOrdersLength={setOrdersLength}
|
|
35
|
-
/>
|
|
36
|
-
</Container>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default MyOrders;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
NotFoundSource,
|
|
4
|
-
} from '../components/NotFoundSource';
|
|
5
|
-
import { useTheme } from 'styled-components/native';
|
|
6
|
-
import { useLanguage } from 'ordering-components/native';
|
|
7
|
-
import { SafeAreaContainer } from '../layouts/SafeAreaContainer'
|
|
8
|
-
|
|
9
|
-
const NetworkError = () => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
const [, t] = useLanguage();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<SafeAreaContainer style={{ backgroundColor: theme.colors.white }}>
|
|
15
|
-
<NotFoundSource
|
|
16
|
-
content={t('NETWORK_ERROR', 'Network Error')}
|
|
17
|
-
image={theme.images.general.notFound}
|
|
18
|
-
conditioned={false}
|
|
19
|
-
/>
|
|
20
|
-
</SafeAreaContainer>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default NetworkError;
|
package/src/pages/NotFound.tsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { NotFoundSource } from '../components/NotFoundSource'
|
|
3
|
-
import { Container } from '../layouts/Container'
|
|
4
|
-
import {useSession, useLanguage} from 'ordering-components/native'
|
|
5
|
-
|
|
6
|
-
const NotFound = ({navigation} : any) => {
|
|
7
|
-
const [{auth}] = useSession()
|
|
8
|
-
const [ ,t] = useLanguage()
|
|
9
|
-
|
|
10
|
-
const btnTitle = !auth ? t('GO_TO_HOMEPAGE', 'Go to homepage') : t('GO_TO_BUSINESSLIST', 'Go to business list')
|
|
11
|
-
|
|
12
|
-
const handleNavigate = () => {
|
|
13
|
-
auth ? navigation.navigate('BusinessList') : navigation.navigate('Home')
|
|
14
|
-
}
|
|
15
|
-
return (
|
|
16
|
-
<Container>
|
|
17
|
-
<NotFoundSource btnTitle={btnTitle} content={t('PAGE_NOT_FOUND' , 'Page not found')} onClickButton={handleNavigate}/>
|
|
18
|
-
</Container>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default NotFound
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { OrderDetails as OrderDetailsController } from '../components/OrderDetails'
|
|
3
|
-
import { SafeAreaContainer } from '../layouts/SafeAreaContainer'
|
|
4
|
-
|
|
5
|
-
const OrderDetails = ({ navigation, route }: any) => {
|
|
6
|
-
const orderDetailsProps = {
|
|
7
|
-
navigation,
|
|
8
|
-
orderId: route.params?.orderId,
|
|
9
|
-
isFromCheckout: route.params?.isFromCheckout,
|
|
10
|
-
isFromRoot: route.params?.isFromRoot,
|
|
11
|
-
goToBusinessList: route?.params?.goToBusinessList,
|
|
12
|
-
onNavigationRedirect: (page: string, params: any) => {
|
|
13
|
-
if (!page) return
|
|
14
|
-
navigation.navigate(page, params);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<SafeAreaContainer>
|
|
20
|
-
<OrderDetailsController {...orderDetailsProps} />
|
|
21
|
-
</SafeAreaContainer>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default OrderDetails;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled, { useTheme } from 'styled-components/native';
|
|
3
|
-
import { Platform } from 'react-native';
|
|
4
|
-
import { ProductForm as ProductFormController } from '../components/ProductForm';
|
|
5
|
-
interface Props {
|
|
6
|
-
navigation: any;
|
|
7
|
-
route: any;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const ProductDetails = (props: Props) => {
|
|
11
|
-
const theme = useTheme()
|
|
12
|
-
|
|
13
|
-
const productProps = {
|
|
14
|
-
...props,
|
|
15
|
-
isCartProduct: props.route.params?.isCartProduct,
|
|
16
|
-
isFromCheckout: props.route.params?.isFromCheckout,
|
|
17
|
-
productCart: props.route.params?.productCart,
|
|
18
|
-
product: props.route.params?.product,
|
|
19
|
-
businessSlug: props.route.params?.businessSlug,
|
|
20
|
-
businessId: props.route.params?.businessId,
|
|
21
|
-
categoryId: props.route.params?.categoryId,
|
|
22
|
-
productId: props.route.params?.productId,
|
|
23
|
-
onSave: props?.navigation?.canGoBack()
|
|
24
|
-
? () => { props.route.params?.onAction && props.route.params?.onAction(); props?.navigation?.goBack(); }
|
|
25
|
-
: () => { props.route.params?.onAction && props.route.params?.onAction(); props?.navigation?.navigate('BottomTab') }
|
|
26
|
-
,
|
|
27
|
-
handleGoBack: props?.navigation?.canGoBack()
|
|
28
|
-
? () => {
|
|
29
|
-
props.route.params?.onAction &&
|
|
30
|
-
props.route.params?.onAction();
|
|
31
|
-
props?.navigation?.goBack();
|
|
32
|
-
}
|
|
33
|
-
: (businessSlug: any) => {
|
|
34
|
-
props.route.params?.onAction &&
|
|
35
|
-
props.route.params?.onAction();
|
|
36
|
-
businessSlug
|
|
37
|
-
? props?.navigation.navigate('Business', { store: businessSlug })
|
|
38
|
-
: props?.navigation.navigate('BottomTab')
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const BusinessProductsListView = styled.SafeAreaView`
|
|
43
|
-
flex: 1;
|
|
44
|
-
background-color: ${theme.colors.backgroundPage};
|
|
45
|
-
padding-top: ${Platform.OS === 'ios' ? '0px' : '20px'};
|
|
46
|
-
`;
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<BusinessProductsListView>
|
|
50
|
-
<ProductFormController {...productProps} />
|
|
51
|
-
</BusinessProductsListView>
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default ProductDetails;
|
package/src/pages/Profile.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled from 'styled-components/native';
|
|
3
|
-
import { Platform } from 'react-native';
|
|
4
|
-
import { UserProfileForm as ProfileController } from '../components/UserProfileForm';
|
|
5
|
-
import { SafeAreaContainer } from '../layouts/SafeAreaContainer'
|
|
6
|
-
|
|
7
|
-
const KeyboardView = styled.KeyboardAvoidingView`
|
|
8
|
-
flex-grow: 1;
|
|
9
|
-
`;
|
|
10
|
-
interface Props {
|
|
11
|
-
navigation: any;
|
|
12
|
-
route: any;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Profile = (props: Props) => {
|
|
16
|
-
const profileProps = {
|
|
17
|
-
...props,
|
|
18
|
-
goToBack: () => props.navigation?.canGoBack() && props.navigation.goBack(),
|
|
19
|
-
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<>
|
|
24
|
-
<KeyboardView
|
|
25
|
-
enabled
|
|
26
|
-
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
27
|
-
>
|
|
28
|
-
<SafeAreaContainer>
|
|
29
|
-
<ProfileController {...profileProps} />
|
|
30
|
-
</SafeAreaContainer>
|
|
31
|
-
</KeyboardView>
|
|
32
|
-
</>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default Profile;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
import styled from 'styled-components/native';
|
|
4
|
-
import { ReviewDriver as ReviewDriverController } from '../components/ReviewDriver'
|
|
5
|
-
import { SafeAreaContainer } from '../layouts/SafeAreaContainer';
|
|
6
|
-
|
|
7
|
-
const KeyboardView = styled.KeyboardAvoidingView`
|
|
8
|
-
flex: 1;
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
const ReviewDriver = ({ navigation, route }: any) => {
|
|
12
|
-
const reviewDriverProps = {
|
|
13
|
-
navigation,
|
|
14
|
-
order: route?.params?.order,
|
|
15
|
-
onNavigationRedirect: (route: string, params: any) => navigation.navigate(route, params)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<KeyboardView
|
|
20
|
-
enabled
|
|
21
|
-
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
22
|
-
>
|
|
23
|
-
<SafeAreaContainer>
|
|
24
|
-
<ReviewDriverController {...reviewDriverProps} />
|
|
25
|
-
</SafeAreaContainer>
|
|
26
|
-
</KeyboardView>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default ReviewDriver
|