ordering-ui-react-native 0.14.95 → 0.14.97-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 +6 -3
- package/src/DeliveryApp.tsx +32 -1
- package/src/components/BusinessTypeFilter/index.tsx +9 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Cart/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/Home/index.tsx +3 -5
- package/src/components/LanguageSelector/index.tsx +65 -97
- package/src/components/LanguageSelector/styles.tsx +4 -17
- package/src/components/Messages/index.tsx +38 -30
- package/src/components/MomentOption/index.tsx +3 -1
- package/src/components/OrderDetails/index.tsx +26 -5
- package/src/components/PaymentOptions/index.tsx +7 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/ProductForm/styles.tsx +1 -0
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UserProfileForm/index.tsx +35 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/pages/Checkout.tsx +1 -1
- package/src/types/index.tsx +2 -9
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/Chat/index.tsx +32 -31
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
- package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +70 -116
- package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
- package/themes/business/src/components/PreviousOrders/index.tsx +80 -23
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
- package/themes/kiosk/src/components/Cart/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/original/index.tsx +28 -2
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +27 -1
- package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +100 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
- package/themes/original/src/components/BusinessController/index.tsx +36 -22
- package/themes/original/src/components/BusinessMenuList/index.tsx +14 -5
- package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +52 -8
- package/themes/original/src/components/BusinessProductsListing/index.tsx +21 -15
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +2 -13
- package/themes/original/src/components/BusinessesListing/index.tsx +41 -58
- package/themes/original/src/components/Cart/index.tsx +41 -8
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +56 -32
- package/themes/original/src/components/Checkout/styles.tsx +7 -0
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/DriverTips/index.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +105 -90
- package/themes/original/src/components/LoginForm/index.tsx +83 -68
- package/themes/original/src/components/Messages/index.tsx +52 -45
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +127 -152
- package/themes/original/src/components/MomentOption/styles.tsx +42 -18
- package/themes/original/src/components/OrderDetails/index.tsx +103 -124
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +5 -6
- package/themes/original/src/components/OrderSummary/index.tsx +34 -1
- package/themes/original/src/components/OrdersOption/index.tsx +15 -46
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
- package/themes/original/src/components/PaymentOptions/index.tsx +24 -25
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
- package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
- package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
- package/themes/original/src/components/ProductForm/index.tsx +153 -104
- package/themes/original/src/components/ProductForm/styles.tsx +5 -3
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/SearchBar/index.tsx +4 -10
- package/themes/original/src/components/SignupForm/index.tsx +173 -154
- package/themes/original/src/components/SingleProductCard/index.tsx +7 -22
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
- package/themes/original/src/components/UserProfile/index.tsx +16 -11
- package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/shared/HeaderTitle.tsx +20 -0
- package/themes/original/src/components/shared/OInput.tsx +1 -2
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/types/index.tsx +25 -28
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -163
- package/themes/original/src/components/BusinessListingSearch/index.tsx +0 -469
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -76
|
@@ -1,110 +1,144 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TextStyle,
|
|
2
|
+
import { TextStyle, ImageBackground, StyleSheet } from 'react-native';
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import FastImage from 'react-native-fast-image'
|
|
4
5
|
|
|
5
|
-
import styled from 'styled-components/native';
|
|
6
|
-
import OImage from './OImage';
|
|
6
|
+
import styled, { css } from 'styled-components/native';
|
|
7
7
|
import OText from './OText';
|
|
8
8
|
|
|
9
9
|
const CardContainer = styled.TouchableOpacity`
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
position: relative;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
border-radius: 10px;
|
|
13
|
+
position: relative;
|
|
14
|
+
margin: 0 30px 30px 0;
|
|
15
|
+
align-self: flex-start;
|
|
13
16
|
`
|
|
14
17
|
|
|
15
|
-
const
|
|
16
|
-
|
|
18
|
+
const WrapPrice = styled.View`
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
margin-top: 10px;
|
|
17
23
|
`
|
|
18
24
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const WrapImage = styled.View`
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 120px;
|
|
28
|
+
`
|
|
29
|
+
|
|
30
|
+
const WrapContent = styled.View`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
${(props: any) => props.isCentered && css`
|
|
34
|
+
align-items: center;
|
|
35
|
+
`}
|
|
28
36
|
`
|
|
29
37
|
|
|
30
38
|
const OCard = (props: Props): React.ReactElement => {
|
|
31
39
|
const theme = useTheme()
|
|
32
40
|
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
textStyle: {
|
|
43
|
+
marginTop: 10
|
|
44
|
+
},
|
|
45
|
+
image: {
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '100%',
|
|
48
|
+
borderBottomLeftRadius: 0,
|
|
49
|
+
borderBottomRightRadius: 0,
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
33
53
|
return (
|
|
34
54
|
<CardContainer
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{props?.description && (
|
|
63
|
-
<OText
|
|
64
|
-
color={theme.colors.mediumGray}
|
|
65
|
-
numberOfLines={3}
|
|
66
|
-
mBottom={8}
|
|
67
|
-
style={{...props?.descriptionStyle}}
|
|
68
|
-
>
|
|
69
|
-
{props.description}
|
|
70
|
-
</OText>
|
|
55
|
+
activeOpacity={1}
|
|
56
|
+
style={props.style}
|
|
57
|
+
onPress={props?.onPress}
|
|
58
|
+
disabled={!props?.onPress}
|
|
59
|
+
>
|
|
60
|
+
<WrapImage>
|
|
61
|
+
{props.isUri ? (
|
|
62
|
+
<FastImage
|
|
63
|
+
style={[styles.image, props.style]}
|
|
64
|
+
source={{
|
|
65
|
+
uri: props.image?.uri,
|
|
66
|
+
priority: FastImage.priority.normal,
|
|
67
|
+
// cache:FastImage.cacheControl.web
|
|
68
|
+
}}
|
|
69
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
70
|
+
/>
|
|
71
|
+
) : (
|
|
72
|
+
<ImageBackground
|
|
73
|
+
style={[styles.image, props.style]}
|
|
74
|
+
source={props.image}
|
|
75
|
+
imageStyle={{
|
|
76
|
+
borderBottomLeftRadius: 0,
|
|
77
|
+
borderBottomRightRadius: 0,
|
|
78
|
+
borderRadius: 10
|
|
79
|
+
}}
|
|
80
|
+
resizeMode='cover'
|
|
81
|
+
/>
|
|
71
82
|
)}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
</WrapImage>
|
|
84
|
+
<WrapContent isCentered={props.isCentered}>
|
|
85
|
+
<OText
|
|
86
|
+
size={18}
|
|
87
|
+
numberOfLines={1}
|
|
88
|
+
ellipsizeMode='tail'
|
|
89
|
+
style={styles.textStyle}
|
|
90
|
+
>
|
|
91
|
+
{props.title}
|
|
92
|
+
</OText>
|
|
93
|
+
{!!props?.description && (
|
|
94
|
+
<OText
|
|
95
|
+
color={theme.colors.mediumGray}
|
|
96
|
+
size={18}
|
|
97
|
+
numberOfLines={3}
|
|
98
|
+
ellipsizeMode='tail'
|
|
99
|
+
style={styles.textStyle}
|
|
100
|
+
>
|
|
101
|
+
{props?.description}
|
|
102
|
+
</OText>
|
|
103
|
+
)}
|
|
104
|
+
<WrapPrice>
|
|
105
|
+
<OText
|
|
106
|
+
size={18}
|
|
107
|
+
>
|
|
108
|
+
{props.price}
|
|
109
|
+
</OText>
|
|
110
|
+
{props?.prevPrice && (
|
|
111
|
+
<OText
|
|
112
|
+
size={18}
|
|
113
|
+
color={theme.colors.mediumGray}
|
|
114
|
+
style={{
|
|
115
|
+
textDecorationLine: 'line-through',
|
|
116
|
+
textDecorationStyle: 'solid',
|
|
117
|
+
marginLeft: 20,
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{props?.prevPrice}
|
|
121
|
+
</OText>
|
|
122
|
+
)}
|
|
123
|
+
</WrapPrice>
|
|
124
|
+
</WrapContent>
|
|
125
|
+
</CardContainer>
|
|
126
|
+
)
|
|
95
127
|
}
|
|
96
128
|
|
|
97
129
|
interface Props {
|
|
98
130
|
badgeText?: string;
|
|
131
|
+
isUri?: boolean;
|
|
99
132
|
onPress?(): void;
|
|
100
|
-
image:
|
|
133
|
+
image: any;
|
|
134
|
+
isCentered?: any;
|
|
101
135
|
title: string;
|
|
102
136
|
titleStyle?: TextStyle;
|
|
103
137
|
description?: string;
|
|
104
138
|
descriptionStyle?: TextStyle;
|
|
105
139
|
price?: string;
|
|
106
140
|
prevPrice?: string;
|
|
107
|
-
style?:
|
|
141
|
+
style?: any;
|
|
108
142
|
}
|
|
109
143
|
|
|
110
144
|
export default OCard;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { AddressForm } from './src/components/AddressForm';
|
|
2
2
|
import { AddressDetails } from './src/components/AddressDetails';
|
|
3
|
+
import { AnalyticsSegment } from './src/components/AnalyticsSegment';
|
|
3
4
|
import { Home } from './src/components/Home';
|
|
4
5
|
import { LoginForm } from './src/components/LoginForm';
|
|
5
6
|
import { SignupForm } from './src/components/SignupForm';
|
|
6
7
|
import { ActiveOrders } from './src/components/ActiveOrders';
|
|
7
8
|
import { AddressList } from './src/components/AddressList';
|
|
8
9
|
import { AppleLogin } from './src/components/AppleLogin';
|
|
10
|
+
import { BusinessBasicInformation } from './src/components/BusinessBasicInformation';
|
|
11
|
+
import { BusinessProductsCategories } from './src/components/BusinessProductsCategories';
|
|
12
|
+
import { BusinessProductsList } from './src/components/BusinessProductsList';
|
|
9
13
|
import { BusinessesListing } from './src/components/BusinessesListing';
|
|
10
14
|
import { BusinessProductsListing } from './src/components/BusinessProductsListing';
|
|
11
15
|
import { CartContent } from './src/components/CartContent';
|
|
12
16
|
import { BusinessCart } from './src/components/BusinessCart';
|
|
13
17
|
import { Checkout } from './src/components/Checkout';
|
|
18
|
+
import { FloatingButton } from './src/components/FloatingButton';
|
|
14
19
|
import { ForgotPasswordForm } from './src/components/ForgotPasswordForm';
|
|
15
20
|
import { MomentOption } from './src/components/MomentOption';
|
|
16
21
|
import { OrdersOption } from './src/components/OrdersOption';
|
|
@@ -24,6 +29,7 @@ import { ReviewProducts } from './src/components/ReviewProducts';
|
|
|
24
29
|
import { ReviewDriver } from './src/components/ReviewDriver';
|
|
25
30
|
import { UserProfile } from './src/components/UserProfile';
|
|
26
31
|
import { MessageListing } from './src/components/MessageListing';
|
|
32
|
+
import { Messages } from './src/components/Messages';
|
|
27
33
|
import { Help } from './src/components/Help';
|
|
28
34
|
import { HelpAccountAndPayment } from './src/components/HelpAccountAndPayment';
|
|
29
35
|
import { HelpGuide } from './src/components/HelpGuide';
|
|
@@ -31,12 +37,18 @@ import { HelpOrder } from './src/components/HelpOrder';
|
|
|
31
37
|
import { NetworkError } from './src/components/NetworkError';
|
|
32
38
|
import { NotFoundSource } from './src/components/NotFoundSource';
|
|
33
39
|
import { OrderTypeSelector } from './src/components/OrderTypeSelector';
|
|
40
|
+
import { SearchBar } from './src/components/SearchBar';
|
|
34
41
|
import { Wallets } from './src/components/Wallets';
|
|
35
42
|
import { PaymentOptionWallet } from './src/components/PaymentOptionWallet';
|
|
36
43
|
import { ProductForm } from './src/components/ProductForm';
|
|
37
44
|
import { UpsellingProducts } from './src/components/UpsellingProducts';
|
|
38
45
|
import { UserVerification } from './src/components/UserVerification';
|
|
39
|
-
import {
|
|
46
|
+
import { LastOrders } from './src/components/LastOrders';
|
|
47
|
+
import NavBar from './src/components/NavBar';
|
|
48
|
+
import { BusinessTypeFilter } from './src/components/BusinessTypeFilter';
|
|
49
|
+
import { BusinessController } from './src/components/BusinessController';
|
|
50
|
+
import { BusinessFeaturedController } from './src/components/BusinessFeaturedController';
|
|
51
|
+
import { HighestRatedBusinesses } from './src/components/HighestRatedBusinesses';
|
|
40
52
|
|
|
41
53
|
import { Toast } from './src/components/shared/OToast';
|
|
42
54
|
import {
|
|
@@ -53,6 +65,7 @@ import {
|
|
|
53
65
|
OAlert,
|
|
54
66
|
OModal,
|
|
55
67
|
OBottomPopup,
|
|
68
|
+
HeaderTitle
|
|
56
69
|
} from './src/components/shared';
|
|
57
70
|
|
|
58
71
|
import { Container } from './src/layouts/Container';
|
|
@@ -67,6 +80,7 @@ import {
|
|
|
67
80
|
export {
|
|
68
81
|
AddressForm,
|
|
69
82
|
AddressDetails,
|
|
83
|
+
AnalyticsSegment,
|
|
70
84
|
Home as HomeView,
|
|
71
85
|
SignupForm,
|
|
72
86
|
LoginForm,
|
|
@@ -91,6 +105,7 @@ export {
|
|
|
91
105
|
BusinessMenuList,
|
|
92
106
|
UserProfile,
|
|
93
107
|
MessageListing,
|
|
108
|
+
Messages,
|
|
94
109
|
Help,
|
|
95
110
|
HelpAccountAndPayment,
|
|
96
111
|
HelpGuide,
|
|
@@ -103,7 +118,16 @@ export {
|
|
|
103
118
|
ProductForm,
|
|
104
119
|
UpsellingProducts,
|
|
105
120
|
UserVerification,
|
|
106
|
-
|
|
121
|
+
BusinessBasicInformation,
|
|
122
|
+
BusinessProductsCategories,
|
|
123
|
+
BusinessProductsList,
|
|
124
|
+
FloatingButton,
|
|
125
|
+
SearchBar,
|
|
126
|
+
LastOrders,
|
|
127
|
+
BusinessTypeFilter,
|
|
128
|
+
BusinessController,
|
|
129
|
+
BusinessFeaturedController,
|
|
130
|
+
HighestRatedBusinesses,
|
|
107
131
|
|
|
108
132
|
// OComponents
|
|
109
133
|
Toast,
|
|
@@ -120,10 +144,12 @@ export {
|
|
|
120
144
|
OAlert,
|
|
121
145
|
OModal,
|
|
122
146
|
OBottomPopup,
|
|
147
|
+
HeaderTitle,
|
|
123
148
|
|
|
124
149
|
// layout
|
|
125
150
|
Container,
|
|
126
151
|
SafeAreaContainer,
|
|
152
|
+
NavBar,
|
|
127
153
|
|
|
128
154
|
// utils
|
|
129
155
|
_retrieveStoreData,
|
|
@@ -108,6 +108,9 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
108
108
|
top: 12,
|
|
109
109
|
zIndex: 1002,
|
|
110
110
|
},
|
|
111
|
+
wrapperNavbar: Platform.OS === 'ios'
|
|
112
|
+
? { paddingVertical: 0, paddingHorizontal: 40 }
|
|
113
|
+
: { paddingVertical: 20, paddingHorizontal: 40 }
|
|
111
114
|
});
|
|
112
115
|
|
|
113
116
|
const [, t] = useLanguage();
|
|
@@ -500,16 +503,18 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
500
503
|
keyboardShouldPersistTaps='always'
|
|
501
504
|
listViewDisplayed={false}
|
|
502
505
|
>
|
|
503
|
-
<
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
506
|
+
<View style={styles.wrapperNavbar}>
|
|
507
|
+
<NavBar
|
|
508
|
+
title={t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?')}
|
|
509
|
+
titleAlign={'center'}
|
|
510
|
+
onActionLeft={goToBack}
|
|
511
|
+
showCall={false}
|
|
512
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
513
|
+
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
514
|
+
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
515
|
+
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
516
|
+
/>
|
|
517
|
+
</View>
|
|
513
518
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
514
519
|
<AddressFormContainer style={{ height: 600, overflow: 'scroll' }}>
|
|
515
520
|
<View>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { AddressList as AddressListController, useLanguage, useOrder, useSession } from 'ordering-components/native'
|
|
3
3
|
import { AddressListContainer, AddressItem } from './styles'
|
|
4
|
-
import { StyleSheet, View } from 'react-native'
|
|
4
|
+
import { Platform, StyleSheet, View } from 'react-native'
|
|
5
5
|
import { OButton, OText, OAlert, OModal, OIcon } from '../shared'
|
|
6
6
|
import { Container } from '../../layouts/Container'
|
|
7
7
|
import { AddressListParams } from '../../types'
|
|
@@ -261,6 +261,32 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
261
261
|
)}
|
|
262
262
|
{!addressList.loading && !addressList.error && (
|
|
263
263
|
<>
|
|
264
|
+
{addressList?.addresses?.length === 0 && (
|
|
265
|
+
<View
|
|
266
|
+
style={{
|
|
267
|
+
flexDirection: 'column',
|
|
268
|
+
paddingHorizontal: 10,
|
|
269
|
+
paddingTop: 20
|
|
270
|
+
}}
|
|
271
|
+
>
|
|
272
|
+
<OText
|
|
273
|
+
size={24}
|
|
274
|
+
lineHeight={36}
|
|
275
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
276
|
+
style={{
|
|
277
|
+
textAlign: 'center',
|
|
278
|
+
marginRight: 40,
|
|
279
|
+
color: theme.colors.textNormal,
|
|
280
|
+
paddingHorizontal: 0,
|
|
281
|
+
width: '100%',
|
|
282
|
+
marginLeft: 0
|
|
283
|
+
}}
|
|
284
|
+
>
|
|
285
|
+
{t('ADDRESS_LIST', 'Address List')}
|
|
286
|
+
</OText>
|
|
287
|
+
</View>
|
|
288
|
+
)}
|
|
289
|
+
|
|
264
290
|
<OButton
|
|
265
291
|
text={t('ADD_NEW_ADDRESS', 'Add new Address')}
|
|
266
292
|
imgRightSrc=''
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { createClient, AnalyticsProvider } from '@segment/analytics-react-native';
|
|
3
|
+
import { useEvent, useConfig } from 'ordering-components/native';
|
|
4
|
+
|
|
5
|
+
export const AnalyticsSegment = (props: any) => {
|
|
6
|
+
const { children } = props
|
|
7
|
+
|
|
8
|
+
const [events] = useEvent()
|
|
9
|
+
const [configState] = useConfig()
|
|
10
|
+
const [segmentClient, setSegmentClient] = useState<any>({})
|
|
11
|
+
|
|
12
|
+
const handleClickProduct = (product: any) => {
|
|
13
|
+
segmentClient.track('Product Clicked', {
|
|
14
|
+
id: product.id,
|
|
15
|
+
name: product.name,
|
|
16
|
+
category: product.category_id,
|
|
17
|
+
price: product.price
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const handleProductAdded = (product: any) => {
|
|
22
|
+
segmentClient.track('Product Added', {
|
|
23
|
+
id: product.id,
|
|
24
|
+
name: product.name,
|
|
25
|
+
category: product.category_id,
|
|
26
|
+
price: product.price,
|
|
27
|
+
quantity: product.quantity
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const handleProductRemoved = (product: any) => {
|
|
32
|
+
segmentClient.track('Product Removed', {
|
|
33
|
+
id: product.id,
|
|
34
|
+
name: product.name,
|
|
35
|
+
category: product.category_id,
|
|
36
|
+
price: product.price,
|
|
37
|
+
quantity: product.quantity
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const handleOrderPlaced = (order: any) => {
|
|
42
|
+
segmentClient.track('Order Placed', {
|
|
43
|
+
id: order.id,
|
|
44
|
+
affiliation: order.business?.name,
|
|
45
|
+
revenue: order.total,
|
|
46
|
+
tax: order.tax_total,
|
|
47
|
+
shipping: order.delivery_zone_price
|
|
48
|
+
})
|
|
49
|
+
segmentClient.track('Payment Info Entered', {
|
|
50
|
+
order: order.id,
|
|
51
|
+
business: order.business?.name,
|
|
52
|
+
business_id: order.business_id,
|
|
53
|
+
total: order.total,
|
|
54
|
+
tax: order.tax_total,
|
|
55
|
+
delivery: order.delivery_zone_price,
|
|
56
|
+
paymethod: order.paymethod
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const handleUpdateOrder = (order: any) => {
|
|
61
|
+
segmentClient.track('Order Updated', {
|
|
62
|
+
id: order.id,
|
|
63
|
+
affiliation: order.business?.name,
|
|
64
|
+
revenue: order.total,
|
|
65
|
+
tax: order.tax_total,
|
|
66
|
+
shipping: order.delivery_zone_price
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const handleAddOrder = (order: any) => {
|
|
71
|
+
segmentClient.track('Order Added', {
|
|
72
|
+
id: order.id,
|
|
73
|
+
affiliation: order.business?.name,
|
|
74
|
+
revenue: order.total,
|
|
75
|
+
tax: order.tax_total,
|
|
76
|
+
shipping: order.delivery_zone_price
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const handleLogin = (data: any) => {
|
|
81
|
+
segmentClient.identify(data.id, {
|
|
82
|
+
email: data.email,
|
|
83
|
+
name: data.name
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (segmentClient?.config?.writeKey) {
|
|
89
|
+
events.on('product_clicked', handleClickProduct)
|
|
90
|
+
events.on('userLogin', handleLogin)
|
|
91
|
+
events.on('product_added', handleProductAdded)
|
|
92
|
+
events.on('order_placed', handleOrderPlaced)
|
|
93
|
+
events.on('order_updated', handleUpdateOrder)
|
|
94
|
+
events.on('order_added', handleAddOrder)
|
|
95
|
+
events.on('cart_product_removed', handleProductRemoved)
|
|
96
|
+
}
|
|
97
|
+
return () => {
|
|
98
|
+
if (segmentClient?.config?.writeKey) {
|
|
99
|
+
events.off('product_clicked', handleClickProduct)
|
|
100
|
+
events.off('userLogin', handleLogin)
|
|
101
|
+
events.off('product_added', handleProductAdded)
|
|
102
|
+
events.off('order_placed', handleOrderPlaced)
|
|
103
|
+
events.off('order_updated', handleUpdateOrder)
|
|
104
|
+
events.off('order_added', handleAddOrder)
|
|
105
|
+
events.off('cart_product_removed', handleProductRemoved)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, [segmentClient])
|
|
109
|
+
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (configState?.configs?.segment_track_id?.value) {
|
|
112
|
+
const _segmentClient: any = createClient({
|
|
113
|
+
writeKey: configState?.configs?.segment_track_id?.value
|
|
114
|
+
});
|
|
115
|
+
setSegmentClient(_segmentClient)
|
|
116
|
+
}
|
|
117
|
+
}, [configState])
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
<AnalyticsProvider client={segmentClient}>
|
|
122
|
+
{children}
|
|
123
|
+
</AnalyticsProvider>
|
|
124
|
+
</>
|
|
125
|
+
|
|
126
|
+
)
|
|
127
|
+
}
|