ordering-ui-react-native 0.12.57 → 0.12.61
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/AppleLogin/index.tsx +14 -8
- package/themes/doordash/src/components/Cart/index.tsx +1 -0
- package/themes/doordash/src/components/LastOrders/index.tsx +1 -1
- package/themes/doordash/src/components/OrderSummary/index.tsx +1 -0
- package/themes/instacart/src/components/OrderDetails/index.tsx +2 -2
- package/themes/single-business/src/components/Cart/index.tsx +127 -16
- package/themes/single-business/src/components/Cart/styles.tsx +39 -0
- package/themes/single-business/src/components/CartContent/index.tsx +56 -52
- package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
- package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
- package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
- package/themes/franchises/index.tsx +0 -111
- package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
- package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
- package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
- package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
- package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
- package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
- package/themes/franchises/src/components/AddressList/index.tsx +0 -338
- package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
- package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
- package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
- package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
- package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
- package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
- package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
- package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
- package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
- package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
- package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
- package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
- package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
- package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
- package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
- package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
- package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
- package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
- package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
- package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
- package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
- package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
- package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
- package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
- package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
- package/themes/franchises/src/components/Cart/index.tsx +0 -332
- package/themes/franchises/src/components/Cart/styles.tsx +0 -28
- package/themes/franchises/src/components/CartContent/index.tsx +0 -60
- package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
- package/themes/franchises/src/components/Checkout/index.tsx +0 -664
- package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
- package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
- package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
- package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
- package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
- package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
- package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
- package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
- package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
- package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
- package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
- package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
- package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
- package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
- package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
- package/themes/franchises/src/components/Help/index.tsx +0 -56
- package/themes/franchises/src/components/Help/styles.tsx +0 -11
- package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
- package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
- package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
- package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
- package/themes/franchises/src/components/Home/index.tsx +0 -102
- package/themes/franchises/src/components/Home/styles.tsx +0 -18
- package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
- package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
- package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
- package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
- package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
- package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
- package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
- package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
- package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
- package/themes/franchises/src/components/Messages/index.tsx +0 -359
- package/themes/franchises/src/components/Messages/styles.tsx +0 -20
- package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
- package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
- package/themes/franchises/src/components/NavBar/index.tsx +0 -129
- package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
- package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
- package/themes/franchises/src/components/Notifications/index.tsx +0 -120
- package/themes/franchises/src/components/Notifications/styles.ts +0 -21
- package/themes/franchises/src/components/OrderDetails/index.tsx +0 -828
- package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
- package/themes/franchises/src/components/OrderSummary/index.tsx +0 -266
- package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
- package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
- package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
- package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
- package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
- package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
- package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
- package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
- package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
- package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
- package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
- package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
- package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
- package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
- package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
- package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
- package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
- package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
- package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
- package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
- package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
- package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
- package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
- package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
- package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
- package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
- package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
- package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
- package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
- package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
- package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
- package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
- package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
- package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
- package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
- package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
- package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
- package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
- package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
- package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
- package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
- package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
- package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
- package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
- package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
- package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
- package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
- package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
- package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
- package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
- package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
- package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
- package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
- package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
- package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
- package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
- package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
- package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
- package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
- package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
- package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
- package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
- package/themes/franchises/src/components/shared/OButton.tsx +0 -132
- package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
- package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
- package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
- package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
- package/themes/franchises/src/components/shared/OInput.tsx +0 -113
- package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
- package/themes/franchises/src/components/shared/OModal.tsx +0 -172
- package/themes/franchises/src/components/shared/OText.tsx +0 -52
- package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
- package/themes/franchises/src/components/shared/OToast.tsx +0 -93
- package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
- package/themes/franchises/src/components/shared/index.tsx +0 -29
- package/themes/franchises/src/config/constants.tsx +0 -57
- package/themes/franchises/src/layouts/Container.tsx +0 -23
- package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
- package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
- package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
- package/themes/franchises/src/types/index.tsx +0 -445
- package/themes/franchises/src/utils/index.tsx +0 -222
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
BusinessReviews as BusinessReviewController,
|
|
4
|
-
useLanguage,
|
|
5
|
-
useOrder,
|
|
6
|
-
} from 'ordering-components/native';
|
|
7
|
-
import { useTheme } from 'styled-components/native';
|
|
8
|
-
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
9
|
-
import { View, StyleSheet } from 'react-native';
|
|
10
|
-
import { OIcon, OInput, OText } from '../shared';
|
|
11
|
-
import {
|
|
12
|
-
BusinessReviewsContainer,
|
|
13
|
-
ScoreView,
|
|
14
|
-
BusinessReviewContent,
|
|
15
|
-
WrapCustomerReview,
|
|
16
|
-
WrapCustomerReviewTotal,
|
|
17
|
-
StarPointsView,
|
|
18
|
-
ReviewSearchView,
|
|
19
|
-
ReviewProgressView,
|
|
20
|
-
PrincipalWrapView,
|
|
21
|
-
} from './styles';
|
|
22
|
-
import { BusinessReviewsParams } from '../../types';
|
|
23
|
-
import { ProgressBar, TouchableRipple } from 'react-native-paper';
|
|
24
|
-
import moment from 'moment';
|
|
25
|
-
|
|
26
|
-
const BusinessReviewsUI = (props: BusinessReviewsParams) => {
|
|
27
|
-
const { businessState, reviewsList } = props;
|
|
28
|
-
const [, t] = useLanguage();
|
|
29
|
-
const theme = useTheme();
|
|
30
|
-
const [orderState] = useOrder();
|
|
31
|
-
|
|
32
|
-
const styles = StyleSheet.create({
|
|
33
|
-
starIcon: {
|
|
34
|
-
marginRight: 5,
|
|
35
|
-
},
|
|
36
|
-
reviewScoreStyle: {
|
|
37
|
-
flexDirection: 'row',
|
|
38
|
-
alignItems: 'center',
|
|
39
|
-
justifyContent: 'center',
|
|
40
|
-
},
|
|
41
|
-
wrapTotalScoresStyle: {
|
|
42
|
-
maxHeight: 80,
|
|
43
|
-
height: 80,
|
|
44
|
-
marginBottom: 20,
|
|
45
|
-
},
|
|
46
|
-
progress: {
|
|
47
|
-
borderRadius: 5,
|
|
48
|
-
height: 4,
|
|
49
|
-
backgroundColor: theme.colors.backgroundGray200,
|
|
50
|
-
marginVertical: 9,
|
|
51
|
-
},
|
|
52
|
-
progressLabel: {
|
|
53
|
-
flexDirection: 'row',
|
|
54
|
-
justifyContent: 'space-between',
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const Score = ({ star, text }: any) => (
|
|
59
|
-
<ScoreView>
|
|
60
|
-
<View style={styles.reviewScoreStyle}>
|
|
61
|
-
<IconAntDesign
|
|
62
|
-
name="star"
|
|
63
|
-
color={theme.colors.primary}
|
|
64
|
-
size={16}
|
|
65
|
-
style={styles.starIcon}
|
|
66
|
-
/>
|
|
67
|
-
<OText>{star}</OText>
|
|
68
|
-
</View>
|
|
69
|
-
<OText>{text}</OText>
|
|
70
|
-
</ScoreView>
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
const PrincipalComments = ({ comments }: any) => (
|
|
74
|
-
<View style={{ flexWrap: 'wrap', flexDirection: 'row', marginTop: 10 }}>
|
|
75
|
-
{comments.map((txt: string, idx: number) => (
|
|
76
|
-
<TouchableRipple
|
|
77
|
-
key={`princ_id_${idx}`}
|
|
78
|
-
style={{
|
|
79
|
-
backgroundColor: theme.colors.primaryContrast,
|
|
80
|
-
paddingHorizontal: 10,
|
|
81
|
-
paddingVertical: 4,
|
|
82
|
-
borderRadius: 50,
|
|
83
|
-
marginEnd: 7,
|
|
84
|
-
marginBottom: 15,
|
|
85
|
-
}}>
|
|
86
|
-
<OText size={10}>{txt}</OText>
|
|
87
|
-
</TouchableRipple>
|
|
88
|
-
))}
|
|
89
|
-
</View>
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
const ReviewItem = ({ comment, created_at, total, customer }: any) => (
|
|
93
|
-
<View style={{ marginBottom: 30 }}>
|
|
94
|
-
<View
|
|
95
|
-
style={{ flexDirection: 'row', marginBottom: 19, alignItems: 'center' }}>
|
|
96
|
-
<OIcon
|
|
97
|
-
url={theme.images.dummies.customerPhoto}
|
|
98
|
-
width={38}
|
|
99
|
-
height={38}
|
|
100
|
-
style={{
|
|
101
|
-
borderRadius: 7.6,
|
|
102
|
-
borderWidth: 1,
|
|
103
|
-
borderColor: theme.colors.border,
|
|
104
|
-
marginEnd: 9,
|
|
105
|
-
}}
|
|
106
|
-
/>
|
|
107
|
-
<View>
|
|
108
|
-
<OText size={12} color={theme.colors.textNormal} weight={'500'}>
|
|
109
|
-
{customer?.name || 'Jane Cooper'}
|
|
110
|
-
</OText>
|
|
111
|
-
<OText size={10} color={theme.colors.textSecondary}>
|
|
112
|
-
{moment(created_at).format('MMMM d, yyyy • hh:mm')}
|
|
113
|
-
</OText>
|
|
114
|
-
</View>
|
|
115
|
-
</View>
|
|
116
|
-
<OText size={10} color={theme.colors.textNormal}>
|
|
117
|
-
{comment}
|
|
118
|
-
</OText>
|
|
119
|
-
</View>
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<BusinessReviewsContainer>
|
|
124
|
-
<BusinessReviewContent
|
|
125
|
-
contentContainerStyle={{ paddingHorizontal: 40, paddingVertical: 27 }}>
|
|
126
|
-
{reviewsList.error ? (
|
|
127
|
-
<OText size={16}>{t('ERROR_UNKNOWN', 'An error has ocurred')}</OText>
|
|
128
|
-
) : (
|
|
129
|
-
<>
|
|
130
|
-
<StarPointsView>
|
|
131
|
-
<OIcon
|
|
132
|
-
src={theme.images.general.star}
|
|
133
|
-
width={32}
|
|
134
|
-
style={{ marginEnd: 10, marginBottom: 2, marginStart: -2 }}
|
|
135
|
-
color={
|
|
136
|
-
reviewsList?.reviews?.length > 0
|
|
137
|
-
? theme.colors.primary
|
|
138
|
-
: theme.colors.disabled
|
|
139
|
-
}
|
|
140
|
-
/>
|
|
141
|
-
<OText size={20} weight={'600'}>{`${businessState?.business?.reviews?.total || 0
|
|
142
|
-
} (${reviewsList?.reviews?.length || 0} ${t(
|
|
143
|
-
'REVIEWS',
|
|
144
|
-
'reviews',
|
|
145
|
-
)})`}</OText>
|
|
146
|
-
</StarPointsView>
|
|
147
|
-
|
|
148
|
-
<ReviewSearchView>
|
|
149
|
-
<OInput
|
|
150
|
-
icon={theme.images.general.search}
|
|
151
|
-
inputStyle={{ fontSize: 14 }}
|
|
152
|
-
placeholder={t('SEARCH_REVIEWS', 'Search reviews')}
|
|
153
|
-
style={{ paddingStart: 0 }}></OInput>
|
|
154
|
-
</ReviewSearchView>
|
|
155
|
-
<ReviewProgressView>
|
|
156
|
-
<OText style={{ marginBottom: 6 }}>
|
|
157
|
-
{t('REVIEW_ORDER', 'Review order')}
|
|
158
|
-
</OText>
|
|
159
|
-
<ProgressBar
|
|
160
|
-
progress={(businessState?.business?.reviews?.total || 0) / 5}
|
|
161
|
-
color={theme.colors.textNormal}
|
|
162
|
-
style={styles.progress}
|
|
163
|
-
/>
|
|
164
|
-
<View style={styles.progressLabel}>
|
|
165
|
-
<OText
|
|
166
|
-
size={10}
|
|
167
|
-
color={
|
|
168
|
-
businessState?.business?.reviews?.total < 1.5
|
|
169
|
-
? theme.colors.textNormal
|
|
170
|
-
: theme.colors.backgroundGray400
|
|
171
|
-
}>
|
|
172
|
-
{t('REVIEW_TERRIBLE', 'Terrible')}
|
|
173
|
-
</OText>
|
|
174
|
-
<OText
|
|
175
|
-
size={10}
|
|
176
|
-
color={
|
|
177
|
-
businessState?.business?.reviews?.total < 2.5
|
|
178
|
-
? theme.colors.textNormal
|
|
179
|
-
: theme.colors.backgroundGray400
|
|
180
|
-
}>
|
|
181
|
-
{t('REVIEW_BAD', 'Bad')}
|
|
182
|
-
</OText>
|
|
183
|
-
<OText
|
|
184
|
-
size={10}
|
|
185
|
-
color={
|
|
186
|
-
businessState?.business?.reviews?.total < 3.5
|
|
187
|
-
? theme.colors.textNormal
|
|
188
|
-
: theme.colors.backgroundGray400
|
|
189
|
-
}>
|
|
190
|
-
{t('REVIEW_OKAY', 'Okay')}
|
|
191
|
-
</OText>
|
|
192
|
-
<OText
|
|
193
|
-
size={10}
|
|
194
|
-
color={
|
|
195
|
-
businessState?.business?.reviews?.total < 4.5
|
|
196
|
-
? theme.colors.textNormal
|
|
197
|
-
: theme.colors.backgroundGray400
|
|
198
|
-
}>
|
|
199
|
-
{t('REVIEW_GOOD', 'Good')}
|
|
200
|
-
</OText>
|
|
201
|
-
<OText
|
|
202
|
-
size={10}
|
|
203
|
-
color={
|
|
204
|
-
businessState?.business?.reviews?.total >= 4.5
|
|
205
|
-
? theme.colors.textNormal
|
|
206
|
-
: theme.colors.backgroundGray400
|
|
207
|
-
}>
|
|
208
|
-
{t('REVIEW_GREAT', 'Great')}
|
|
209
|
-
</OText>
|
|
210
|
-
</View>
|
|
211
|
-
</ReviewProgressView>
|
|
212
|
-
<PrincipalWrapView>
|
|
213
|
-
<OText style={{ marginBottom: 6 }}>
|
|
214
|
-
{t('PRINCIPAL_COMMENTS', 'Principal comments')}
|
|
215
|
-
</OText>
|
|
216
|
-
<PrincipalComments
|
|
217
|
-
comments={[
|
|
218
|
-
'It wasn’t tasty',
|
|
219
|
-
'It doesn’t pack well',
|
|
220
|
-
'Too slow',
|
|
221
|
-
'It isn’t worth what it costs',
|
|
222
|
-
]}
|
|
223
|
-
/>
|
|
224
|
-
</PrincipalWrapView>
|
|
225
|
-
|
|
226
|
-
{reviewsList?.reviews.map((review: any) => (
|
|
227
|
-
<ReviewItem
|
|
228
|
-
key={`review_key_${review.id}`}
|
|
229
|
-
comment={review?.comment}
|
|
230
|
-
created_at={review?.created_at}
|
|
231
|
-
/>
|
|
232
|
-
))}
|
|
233
|
-
</>
|
|
234
|
-
)}
|
|
235
|
-
{!reviewsList.loading && reviewsList?.reviews.length === 0 && (
|
|
236
|
-
<OText>{t('REVIEWS_NOT_FOUND', 'Reviews Not Found')}</OText>
|
|
237
|
-
)}
|
|
238
|
-
</BusinessReviewContent>
|
|
239
|
-
</BusinessReviewsContainer>
|
|
240
|
-
);
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export const BusinessReviews = (props: any) => {
|
|
244
|
-
const BusinessReviewProps = {
|
|
245
|
-
...props,
|
|
246
|
-
UIComponent: BusinessReviewsUI,
|
|
247
|
-
};
|
|
248
|
-
return <BusinessReviewController {...BusinessReviewProps} />;
|
|
249
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native';
|
|
2
|
-
|
|
3
|
-
export const BusinessReviewsContainer = styled.View`
|
|
4
|
-
margin-top: 12px;
|
|
5
|
-
`;
|
|
6
|
-
|
|
7
|
-
export const ScoreView = styled.View`
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
border-width: 1px;
|
|
13
|
-
border-color: ${(props: any) => props.theme.colors.lightGray};
|
|
14
|
-
border-radius: 10px;
|
|
15
|
-
padding: 10px;
|
|
16
|
-
width: 170px;
|
|
17
|
-
margin-right: 15px;
|
|
18
|
-
`;
|
|
19
|
-
export const BusinessReviewContent = styled.ScrollView`
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
margin-top: 24px;
|
|
23
|
-
`;
|
|
24
|
-
export const WrapCustomerReview = styled.View`
|
|
25
|
-
padding: 20px 0;
|
|
26
|
-
border-bottom-width: 1px;
|
|
27
|
-
border-color: ${(props: any) => props.theme.colors.lightGray};
|
|
28
|
-
`;
|
|
29
|
-
export const WrapCustomerReviewTotal = styled.View`
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: row;
|
|
32
|
-
align-items: center;
|
|
33
|
-
margin-bottom: 10px;
|
|
34
|
-
`;
|
|
35
|
-
export const StarPointsView = styled.View`
|
|
36
|
-
flex-direction: row;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: flex-start;
|
|
39
|
-
padding-vertical: 4px;
|
|
40
|
-
`;
|
|
41
|
-
export const ReviewSearchView = styled.View`
|
|
42
|
-
flex-direction: row;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: flex-start;
|
|
45
|
-
padding-top: 10px;
|
|
46
|
-
padding-bottom: 0px;
|
|
47
|
-
border-bottom-width: 1px;
|
|
48
|
-
border-bottom-color: ${(props: any) => props.theme.colors.border};
|
|
49
|
-
margin-bottom: 12px;
|
|
50
|
-
`;
|
|
51
|
-
export const ReviewProgressView = styled.View`
|
|
52
|
-
padding-top: 10px;
|
|
53
|
-
padding-bottom: 0px;
|
|
54
|
-
margin-bottom: 12px;
|
|
55
|
-
`;
|
|
56
|
-
export const PrincipalWrapView = styled.View`
|
|
57
|
-
padding-vertical: 17px;
|
|
58
|
-
margin-bottom: 12px;
|
|
59
|
-
`;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
FlatList,
|
|
5
|
-
View,
|
|
6
|
-
ScrollView,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
10
|
-
import {
|
|
11
|
-
BusinessTypeFilter as BusinessTypeFilterController,
|
|
12
|
-
useLanguage,
|
|
13
|
-
} from 'ordering-components/native';
|
|
14
|
-
import { useTheme } from 'styled-components/native';
|
|
15
|
-
import {
|
|
16
|
-
BusinessCategoriesTitle,
|
|
17
|
-
BusinessCategories,
|
|
18
|
-
Category,
|
|
19
|
-
BCContainer,
|
|
20
|
-
} from './styles';
|
|
21
|
-
import { OIcon, OText } from '../shared';
|
|
22
|
-
import { BusinessTypeFilterParams } from '../../types';
|
|
23
|
-
|
|
24
|
-
export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
25
|
-
const { typesState, currentTypeSelected, handleChangeBusinessType } = props;
|
|
26
|
-
|
|
27
|
-
const [, t] = useLanguage();
|
|
28
|
-
|
|
29
|
-
const theme = useTheme();
|
|
30
|
-
|
|
31
|
-
const renderTypes = ({ item }: any) => {
|
|
32
|
-
return (
|
|
33
|
-
<TouchableOpacity
|
|
34
|
-
key={item.id}
|
|
35
|
-
onPress={() => handleChangeBusinessType(item.id)}
|
|
36
|
-
style={{
|
|
37
|
-
height: 34,
|
|
38
|
-
justifyContent: 'center',
|
|
39
|
-
borderBottomWidth: 1,
|
|
40
|
-
borderBottomColor: currentTypeSelected === item.id ? theme.colors.textNormal : theme.colors.border,
|
|
41
|
-
}}>
|
|
42
|
-
<OText
|
|
43
|
-
style={{ textAlign: 'center', paddingHorizontal: 5 }}
|
|
44
|
-
size={currentTypeSelected === item.id ? 14 : 12}
|
|
45
|
-
weight={currentTypeSelected === item.id ? 'bold' : 'normal'}
|
|
46
|
-
color={
|
|
47
|
-
currentTypeSelected === item.id
|
|
48
|
-
? theme.colors.textNormal
|
|
49
|
-
: theme.colors.textSecondary
|
|
50
|
-
}>
|
|
51
|
-
{t(
|
|
52
|
-
`BUSINESS_TYPE_${item.name.replace(/\s/g, '_').toUpperCase()}`,
|
|
53
|
-
item.name,
|
|
54
|
-
)}
|
|
55
|
-
</OText>
|
|
56
|
-
</TouchableOpacity>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<BCContainer>
|
|
62
|
-
{typesState?.loading && (
|
|
63
|
-
<View>
|
|
64
|
-
<Placeholder style={{ marginVertical: 10 }} Animation={Fade}>
|
|
65
|
-
<ScrollView
|
|
66
|
-
horizontal
|
|
67
|
-
showsVerticalScrollIndicator={false}
|
|
68
|
-
showsHorizontalScrollIndicator={false}>
|
|
69
|
-
{[...Array(4)].map((_, i) => (
|
|
70
|
-
<View
|
|
71
|
-
key={i}
|
|
72
|
-
style={{ width: 80, borderRadius: 10, marginRight: 15 }}>
|
|
73
|
-
<PlaceholderLine height={80} noMargin />
|
|
74
|
-
</View>
|
|
75
|
-
))}
|
|
76
|
-
</ScrollView>
|
|
77
|
-
</Placeholder>
|
|
78
|
-
</View>
|
|
79
|
-
)}
|
|
80
|
-
{!typesState?.loading &&
|
|
81
|
-
!typesState?.error &&
|
|
82
|
-
typesState?.types &&
|
|
83
|
-
typesState?.types.length > 0 && (
|
|
84
|
-
<>
|
|
85
|
-
<BusinessCategoriesTitle>
|
|
86
|
-
|
|
87
|
-
</BusinessCategoriesTitle>
|
|
88
|
-
<BusinessCategories>
|
|
89
|
-
<FlatList
|
|
90
|
-
horizontal
|
|
91
|
-
showsHorizontalScrollIndicator={false}
|
|
92
|
-
data={typesState?.types}
|
|
93
|
-
renderItem={renderTypes}
|
|
94
|
-
keyExtractor={(type) => type.name}
|
|
95
|
-
/>
|
|
96
|
-
</BusinessCategories>
|
|
97
|
-
</>
|
|
98
|
-
)}
|
|
99
|
-
</BCContainer>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const styles = StyleSheet.create({
|
|
104
|
-
icons: {
|
|
105
|
-
padding: 10,
|
|
106
|
-
},
|
|
107
|
-
logo: {
|
|
108
|
-
width: 75,
|
|
109
|
-
height: 75,
|
|
110
|
-
marginBottom: 15,
|
|
111
|
-
borderRadius: 25,
|
|
112
|
-
justifyContent: 'center',
|
|
113
|
-
alignItems: 'center',
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
export const BusinessTypeFilter = (props: BusinessTypeFilterParams) => {
|
|
118
|
-
const businessTypeFilterProps = {
|
|
119
|
-
...props,
|
|
120
|
-
UIComponent: BusinessTypeFilterUI,
|
|
121
|
-
businessTypes: props.businessTypes,
|
|
122
|
-
defaultBusinessType: props.defaultBusinessType || null,
|
|
123
|
-
onChangeBusinessType: props.handleChangeBusinessType,
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
return <BusinessTypeFilterController {...businessTypeFilterProps} />;
|
|
127
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native'
|
|
2
|
-
|
|
3
|
-
export const BCContainer = styled.View`
|
|
4
|
-
display: flex;
|
|
5
|
-
width: 100%;
|
|
6
|
-
justify-content: flex-start;
|
|
7
|
-
text-align: center;
|
|
8
|
-
`
|
|
9
|
-
|
|
10
|
-
export const BusinessCategoriesTitle = styled.View`
|
|
11
|
-
flex: 1;
|
|
12
|
-
`
|
|
13
|
-
|
|
14
|
-
export const BusinessCategories = styled.View`
|
|
15
|
-
flex: 1;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: row;
|
|
18
|
-
justify-content: space-between;
|
|
19
|
-
margin: 10px 0px;
|
|
20
|
-
width: 100%;
|
|
21
|
-
`
|
|
22
|
-
export const Category = styled.View`
|
|
23
|
-
height: 150px;
|
|
24
|
-
min-width: 90px;
|
|
25
|
-
margin-right: 15px;
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
align-items: center;
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
export const IconContainer = styled.View`
|
|
33
|
-
border-width: 1px;
|
|
34
|
-
display: flex;
|
|
35
|
-
border-color: ${(props: any) => props.theme.colors.backgroundGray};
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
border-radius: 10px;
|
|
39
|
-
height: 60px;
|
|
40
|
-
`
|