ordering-ui-react-native 0.11.54 → 0.11.58
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/OrderCreating/index.tsx +8 -4
- package/src/config.json +1 -1
- package/themes/instacart/index.tsx +4 -0
- package/themes/instacart/src/components/BusinessItemAccordion/index.tsx +16 -41
- package/themes/instacart/src/components/BusinessItemAccordion/styles.tsx +4 -6
- package/themes/instacart/src/components/BusinessesListing/index.tsx +2 -2
- package/themes/instacart/src/components/Cart/index.tsx +8 -5
- package/themes/instacart/src/components/Cart/styles.tsx +11 -0
- package/themes/instacart/src/components/CartContent/index.tsx +2 -1
- package/themes/instacart/src/components/NavBar/index.tsx +4 -2
- package/themes/instacart/src/components/PreviousOrders/index.tsx +1 -1
- package/themes/instacart/src/components/ReviewDriver/index.tsx +221 -0
- package/themes/instacart/src/components/ReviewDriver/styles.tsx +46 -0
- package/themes/instacart/src/components/ReviewOrder/index.tsx +304 -185
- package/themes/instacart/src/components/ReviewOrder/styles.tsx +18 -3
- package/themes/instacart/src/components/ReviewProduct/index.tsx +275 -0
- package/themes/instacart/src/components/ReviewProduct/styles.tsx +53 -0
- package/themes/instacart/src/components/SingleProductCard/index.tsx +8 -8
- package/themes/instacart/src/components/SingleProductCard/styles.tsx +4 -5
- package/themes/instacart/src/components/TagSelector/index.tsx +94 -0
- package/themes/instacart/src/components/TagSelector/styles.ts +0 -0
- package/themes/instacart/src/components/shared/OBottomStickBar.tsx +62 -0
- package/themes/instacart/src/config/constants.tsx +25 -1
- package/themes/instacart/src/types/index.tsx +25 -2
- package/themes/original/src/components/AddressForm/index.tsx +6 -2
- package/themes/original/src/components/FloatingButton/index.tsx +3 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +2 -2
- package/themes/original/src/components/LoginForm/index.tsx +7 -2
- package/themes/original/src/components/ProductForm/index.tsx +5 -1
- package/themes/original/src/components/ProductForm/styles.tsx +3 -1
- package/themes/original/src/components/SignupForm/index.tsx +7 -2
- package/themes/original/src/components/UserDetails/index.tsx +3 -2
- package/themes/original/src/components/UserFormDetails/styles.tsx +0 -1
- package/themes/original/src/components/shared/OInput.tsx +1 -0
- package/themes/original/src/layouts/Container.tsx +4 -1
- package/themes/single-business/src/components/Checkout/index.tsx +2 -2
- package/themes/single-business/src/components/ForgotPasswordForm/index.tsx +2 -2
- package/themes/single-business/src/components/LastOrder/index.tsx +1 -1
- package/themes/single-business/src/components/LoginForm/index.tsx +1 -1
- package/themes/single-business/src/components/ReviewOrder/index.tsx +1 -1
- package/themes/single-business/src/components/SignupForm/index.tsx +1 -1
- package/themes/single-business/src/components/StripeRedirectForm/index.tsx +1 -1
- package/themes/single-business/src/components/UserFormDetails/index.tsx +1 -1
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
- package/themes/single-business/src/components/UserProfileForm/index.tsx +1 -1
- package/themes/single-business/src/components/shared/OToast.tsx +1 -1
|
@@ -1,206 +1,325 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { OrderReview as ReviewOrderController, useLanguage,
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react'
|
|
2
|
+
import { OrderReview as ReviewOrderController, useLanguage, ToastType, useToast } from 'ordering-components/native'
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
3
4
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
4
5
|
import { useForm, Controller } from 'react-hook-form'
|
|
5
6
|
|
|
6
7
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
ReviewOrderContainer,
|
|
9
|
+
BusinessLogo,
|
|
10
|
+
FormReviews,
|
|
11
|
+
Category,
|
|
12
|
+
Stars,
|
|
13
|
+
BlockWrap,
|
|
14
|
+
CommentItem
|
|
12
15
|
} from './styles'
|
|
13
16
|
import { OButton, OIcon, OInput, OText } from '../shared'
|
|
14
|
-
import { TouchableOpacity, StyleSheet,View } from 'react-native';
|
|
17
|
+
import { TouchableOpacity, StyleSheet, View } from 'react-native';
|
|
15
18
|
import NavBar from '../NavBar'
|
|
16
19
|
import Spinner from 'react-native-loading-spinner-overlay'
|
|
17
20
|
|
|
18
21
|
import { ReviewOrderParams } from '../../types'
|
|
19
|
-
import {
|
|
22
|
+
import { ProgressBar } from 'react-native-paper';
|
|
23
|
+
import { REVIEW_ORDER_COMMENTS } from '../../config/constants';
|
|
24
|
+
import TagSelector from '../TagSelector';
|
|
25
|
+
import OBottomStickBar from '../shared/OBottomStickBar';
|
|
26
|
+
import { Container } from '../../..';
|
|
20
27
|
|
|
21
28
|
export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const styles = StyleSheet.create({
|
|
35
|
-
inputTextArea: {
|
|
36
|
-
borderColor: theme.colors.secundaryContrast,
|
|
37
|
-
borderRadius: 10,
|
|
38
|
-
marginVertical: 20,
|
|
39
|
-
height: 100,
|
|
40
|
-
alignItems: 'flex-start'
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const [, t] = useLanguage()
|
|
45
|
-
const [, { showToast }] = useToast()
|
|
46
|
-
const { handleSubmit, control, errors } = useForm()
|
|
47
|
-
|
|
48
|
-
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
49
|
-
|
|
50
|
-
const categories = {
|
|
51
|
-
quality: { name: 'quality', show: t('QUALITY', 'Quality of Product') },
|
|
52
|
-
punctuality: { name: 'punctiality', show: t('PUNCTUALITY', 'Punctuality') },
|
|
53
|
-
service: { name: 'service', show: t('SERVICE', 'Service') },
|
|
54
|
-
packaging: { name: 'packaging', show: t('PRODUCT_PACKAGING', 'Product Packaging') }
|
|
55
|
-
}
|
|
29
|
+
const {
|
|
30
|
+
order,
|
|
31
|
+
stars,
|
|
32
|
+
handleChangeInput,
|
|
33
|
+
handleChangeRating,
|
|
34
|
+
handleSendReview,
|
|
35
|
+
formState,
|
|
36
|
+
navigation,
|
|
37
|
+
orderComments,
|
|
38
|
+
setStars,
|
|
39
|
+
} = props
|
|
56
40
|
|
|
57
|
-
|
|
58
|
-
if (Object.values(stars).some((value: any) => value === 0)) {
|
|
59
|
-
setAlertState({
|
|
60
|
-
open: true,
|
|
61
|
-
content: Object.values(categories).map((category: any, i: any) => stars[category.name] === 0 ? `- ${t('CATEGORY_ATLEAST_ONE', `${category.show} must be at least one point`).replace('CATEGORY', category.name.toUpperCase())} ${i !== 3 && '\n'}` : ' ')
|
|
62
|
-
})
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
handleSendReview()
|
|
66
|
-
setAlertState({ ...alertState, success: true })
|
|
67
|
-
}
|
|
41
|
+
const theme = useTheme();
|
|
68
42
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
43
|
+
const styles = StyleSheet.create({
|
|
44
|
+
inputTextArea: {
|
|
45
|
+
borderColor: theme.colors.border,
|
|
46
|
+
borderRadius: 7.6,
|
|
47
|
+
marginVertical: 10,
|
|
48
|
+
height: 100,
|
|
49
|
+
alignItems: 'flex-start',
|
|
50
|
+
paddingVertical: 12,
|
|
51
|
+
fontSize: 10,
|
|
52
|
+
marginBottom: 30
|
|
53
|
+
},
|
|
54
|
+
progress: {
|
|
55
|
+
borderRadius: 5,
|
|
56
|
+
height: 4,
|
|
57
|
+
backgroundColor: theme.colors.backgroundGray200,
|
|
58
|
+
marginVertical: 9,
|
|
59
|
+
},
|
|
60
|
+
progressLabel: {
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
justifyContent: 'space-between',
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const [, t] = useLanguage()
|
|
67
|
+
const [, { showToast }] = useToast()
|
|
68
|
+
const { handleSubmit, control, errors } = useForm()
|
|
69
|
+
|
|
70
|
+
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
71
|
+
|
|
72
|
+
const [curVal, setReviewVal] = useState(-1);
|
|
73
|
+
const [curSuggest, setSuggest] = useState(orderComments?.map(({key, value}: any) => t(key, value)) || REVIEW_ORDER_COMMENTS?.map(({key, value}) => t(key, value)));
|
|
74
|
+
const [selectedSuggest, setSelectedSuggest] = useState([]);
|
|
75
|
+
const [comment, setComment] = useState('');
|
|
76
|
+
|
|
77
|
+
const categories = {
|
|
78
|
+
quality: { name: 'quality', show: t('QUALITY', 'Quality of Product') },
|
|
79
|
+
punctuality: { name: 'punctiality', show: t('PUNCTUALITY', 'Punctuality') },
|
|
80
|
+
service: { name: 'service', show: t('SERVICE', 'Service') },
|
|
81
|
+
packaging: { name: 'packaging', show: t('PRODUCT_PACKAGING', 'Product Packaging') }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const scores = [
|
|
85
|
+
{
|
|
86
|
+
val: 0.5,
|
|
87
|
+
color: theme.colors.strength_1,
|
|
88
|
+
text: t('REVIEW_TERRIBLE', 'Terrible')
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
val: 1.5,
|
|
92
|
+
color: theme.colors.strength_2,
|
|
93
|
+
text: t('REVIEW_BAD', 'Bad')
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
val: 2.5,
|
|
97
|
+
color: theme.colors.strength_3,
|
|
98
|
+
text: t('REVIEW_OKAY', 'Okay')
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
val: 3.7,
|
|
102
|
+
color: theme.colors.strength_4,
|
|
103
|
+
text: t('REVIEW_GOOD', 'Good')
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
val: 5,
|
|
107
|
+
color: theme.colors.strength_5,
|
|
108
|
+
text: t('REVIEW_GREAT', 'Great')
|
|
109
|
+
},
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
const getProgColor = () => {
|
|
113
|
+
return scores.find(({val}) => val == curVal)?.color || theme.colors.textNormal;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const onSubmit = () => {
|
|
117
|
+
if (Object.values(stars).some(value => value === 0)) {
|
|
118
|
+
setAlertState({
|
|
119
|
+
open: true,
|
|
120
|
+
content: Object.values(categories).map((category, i) => stars[category.name] === 0 ? `- ${t('CATEGORY_ATLEAST_ONE', `${category.show} must be at least one point`).replace('CATEGORY', category.name.toUpperCase())} ${i !== 3 && '\n'}` : ' ')
|
|
121
|
+
})
|
|
122
|
+
return
|
|
123
|
+
}
|
|
124
|
+
handleSendReview()
|
|
125
|
+
setAlertState({ ...alertState, success: true })
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
const timer = (ms: number) => new Promise(res => setTimeout(res, ms))
|
|
87
130
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
if (alertState.open) {
|
|
113
|
-
alertState.content && showToast(
|
|
114
|
-
ToastType.Error,
|
|
115
|
-
alertState.content
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
}, [alertState.content])
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const getStar = (star: number, index: number, category: string) => {
|
|
122
|
-
switch (star) {
|
|
123
|
-
case 0:
|
|
124
|
-
return (
|
|
125
|
-
<TouchableOpacity key={index} onPress={() => handleChangeRating({ target: { name: category, value: index + 1 } })}>
|
|
126
|
-
<MaterialCommunityIcon name='star-outline' size={24} color={theme.colors.backgroundDark} />
|
|
127
|
-
</TouchableOpacity>
|
|
128
|
-
)
|
|
129
|
-
case 1:
|
|
130
|
-
return (
|
|
131
|
-
<TouchableOpacity key={index} onPress={() => handleChangeRating({ target: { name: category, value: index + 1 } })}>
|
|
132
|
-
<MaterialCommunityIcon name='star' size={24} color={theme.colors.primary} />
|
|
133
|
-
</TouchableOpacity>
|
|
134
|
-
)
|
|
135
|
-
}
|
|
131
|
+
const setStar = async (val: number) => { // We need to wrap the loop into an async function for this to work
|
|
132
|
+
setReviewVal(val);
|
|
133
|
+
const cats = Object.values(categories);
|
|
134
|
+
for (var i = 0; i < cats.length; i++) {
|
|
135
|
+
handleChangeRating({ target: { name: cats[i].name, value: val } });
|
|
136
|
+
// console.log(`Index: ${i} ---- Value: ${val} --- Category: ${cats[i].name}`);
|
|
137
|
+
await timer(1000);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const handleChangeStars = async (val: number) => {
|
|
142
|
+
if (val) {
|
|
143
|
+
setStars({
|
|
144
|
+
...stars,
|
|
145
|
+
quality: parseInt(val.toString()),
|
|
146
|
+
punctiality: parseInt(val.toString()),
|
|
147
|
+
service: parseInt(val.toString()),
|
|
148
|
+
packaging: parseInt(val.toString())
|
|
149
|
+
})
|
|
150
|
+
setReviewVal(val);
|
|
151
|
+
// await setStar(val);
|
|
152
|
+
}
|
|
136
153
|
}
|
|
137
154
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
155
|
+
const onSuggestUpdate = useCallback((items) => {
|
|
156
|
+
if (items.length > 0) {
|
|
157
|
+
let selected: Array<never> = [];
|
|
158
|
+
items.map(({label, checked}: never) => {
|
|
159
|
+
if (checked === true) {
|
|
160
|
+
selected.push(label);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
setSelectedSuggest(selected);
|
|
164
|
+
}
|
|
165
|
+
}, []);
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
*
|
|
169
|
+
* @param type next type as 0: skip,1: continue
|
|
170
|
+
*/
|
|
171
|
+
const handleNext = (type: number) => {
|
|
172
|
+
if (type === 1) handleSubmit(onSubmit);
|
|
173
|
+
navigation?.navigate('ReviewProduct', { order: order });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
if (formState.error && !formState?.loading) {
|
|
178
|
+
showToast(ToastType.Error, formState.result)
|
|
179
|
+
}
|
|
180
|
+
if (!formState.loading && !formState.error && alertState.success) {
|
|
181
|
+
showToast(ToastType.Success, t('REVIEW_SUCCESS_CONTENT', 'Thank you, Review successfully submitted!'))
|
|
182
|
+
navigation?.navigate('ReviewProduct', { order: order });
|
|
183
|
+
}
|
|
184
|
+
}, [formState.result])
|
|
185
|
+
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
if (Object.keys(errors).length > 0) {
|
|
188
|
+
// Convert all errors in one string to show in toast provider
|
|
189
|
+
const list = Object.values(errors);
|
|
190
|
+
let stringError = '';
|
|
191
|
+
list.map((item: any, i: number) => {
|
|
192
|
+
stringError +=
|
|
193
|
+
i + 1 === list.length ? `- ${item.message}` : `- ${item.message}\n`;
|
|
194
|
+
});
|
|
195
|
+
showToast(ToastType.Error, stringError);
|
|
196
|
+
}
|
|
197
|
+
}, [errors]);
|
|
198
|
+
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
if (alertState.open) {
|
|
201
|
+
alertState.content && showToast(
|
|
202
|
+
ToastType.Error,
|
|
203
|
+
alertState.content
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
}, [alertState.content])
|
|
207
|
+
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
setStars({
|
|
210
|
+
...stars,
|
|
211
|
+
quality: 0,
|
|
212
|
+
punctiality: 0,
|
|
213
|
+
service: 0,
|
|
214
|
+
packaging: 0
|
|
215
|
+
})
|
|
216
|
+
}, [])
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
const getStar = (star: number, index: number, category: string) => {
|
|
220
|
+
switch (star) {
|
|
221
|
+
case 0:
|
|
222
|
+
return (
|
|
223
|
+
<TouchableOpacity key={index} onPress={() => handleChangeRating({ target: { name: category, value: index + 1 } })}>
|
|
224
|
+
<MaterialCommunityIcon name='star-outline' size={24} color={theme.colors.backgroundDark} />
|
|
225
|
+
</TouchableOpacity>
|
|
226
|
+
)
|
|
227
|
+
case 1:
|
|
228
|
+
return (
|
|
229
|
+
<TouchableOpacity key={index} onPress={() => handleChangeRating({ target: { name: category, value: index + 1 } })}>
|
|
230
|
+
<MaterialCommunityIcon name='star' size={24} color={theme.colors.primary} />
|
|
231
|
+
</TouchableOpacity>
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return (
|
|
237
|
+
<>
|
|
238
|
+
<Container>
|
|
239
|
+
<ReviewOrderContainer>
|
|
240
|
+
<NavBar
|
|
241
|
+
title={t('REVIEW_ORDER', 'Review Order')}
|
|
242
|
+
titleAlign={'center'}
|
|
243
|
+
onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
|
|
244
|
+
showCall={false}
|
|
245
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
246
|
+
paddingTop={0}
|
|
247
|
+
isVertical
|
|
248
|
+
leftImg={theme.images.general.close}
|
|
249
|
+
leftImageStyle={{width: 16}}
|
|
250
|
+
/>
|
|
251
|
+
<BusinessLogo>
|
|
252
|
+
<OIcon url={order?.logo} width={72} height={72} style={{borderRadius: 7.6}} />
|
|
253
|
+
</BusinessLogo>
|
|
254
|
+
<View style={{ paddingBottom: 30 }}>
|
|
255
|
+
<BlockWrap>
|
|
256
|
+
<OText mBottom={10}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
|
|
257
|
+
<ProgressBar
|
|
258
|
+
progress={curVal / 5}
|
|
259
|
+
color={getProgColor()}
|
|
260
|
+
style={styles.progress}
|
|
261
|
+
/>
|
|
262
|
+
<View style={styles.progressLabel}>
|
|
263
|
+
{scores.map(({ val, text, color }, idx) =>
|
|
264
|
+
<TouchableOpacity key={idx} onPress={() => handleChangeStars(val)}>
|
|
265
|
+
<OText
|
|
266
|
+
size={10}
|
|
267
|
+
color={
|
|
268
|
+
curVal === val
|
|
269
|
+
? color
|
|
270
|
+
: theme.colors.backgroundGray400
|
|
271
|
+
}>
|
|
272
|
+
{text}
|
|
273
|
+
</OText>
|
|
274
|
+
</TouchableOpacity>
|
|
275
|
+
)}
|
|
276
|
+
</View>
|
|
277
|
+
</BlockWrap>
|
|
278
|
+
<BlockWrap>
|
|
279
|
+
<OText mBottom={16}>{t('COMMENTS', 'Comments')}</OText>
|
|
280
|
+
<View style={{flexShrink: 1}}>
|
|
281
|
+
<TagSelector items={curSuggest} activeColor={theme.colors.primary} normalColor={'#E9ECEF'} onUpdated={onSuggestUpdate} />
|
|
282
|
+
</View>
|
|
283
|
+
</BlockWrap>
|
|
284
|
+
<FormReviews>
|
|
285
|
+
<OText mBottom={10}>{t('DO_YOU_WANT_TO_ADD_SOMETHING', 'Do you want to add something?')}</OText>
|
|
286
|
+
<Controller
|
|
287
|
+
control={control}
|
|
288
|
+
defaultValue=''
|
|
289
|
+
name='comments'
|
|
290
|
+
render={({ onChange }: any) => (
|
|
291
|
+
<OInput
|
|
292
|
+
name='comments'
|
|
293
|
+
placeholder={t('COMMENTS', 'Comments')}
|
|
294
|
+
onChange={(val: string) => {
|
|
295
|
+
onChange(val)
|
|
296
|
+
handleChangeInput(val)
|
|
297
|
+
}}
|
|
298
|
+
style={styles.inputTextArea}
|
|
299
|
+
multiline
|
|
300
|
+
inputStyle={{fontSize: 12}}
|
|
301
|
+
/>
|
|
302
|
+
)}
|
|
303
|
+
/>
|
|
304
|
+
</FormReviews>
|
|
305
|
+
</View>
|
|
306
|
+
<Spinner visible={formState.loading} />
|
|
307
|
+
</ReviewOrderContainer>
|
|
308
|
+
</Container>
|
|
309
|
+
<OBottomStickBar
|
|
310
|
+
rightBtnStyle={{borderRadius: 7.6, height: 44}}
|
|
311
|
+
rightAction={() => handleNext(0)}
|
|
312
|
+
leftAction={() => handleNext(1)}
|
|
313
|
+
/>
|
|
314
|
+
</>
|
|
315
|
+
)
|
|
198
316
|
}
|
|
199
317
|
|
|
318
|
+
|
|
200
319
|
export const ReviewOrder = (props: ReviewOrderParams) => {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
320
|
+
const reviewOrderProps = {
|
|
321
|
+
...props,
|
|
322
|
+
UIComponent: ReviewOrderUI
|
|
323
|
+
}
|
|
324
|
+
return <ReviewOrderController {...reviewOrderProps} />
|
|
206
325
|
}
|
|
@@ -4,22 +4,26 @@ export const ReviewOrderContainer = styled.View`
|
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex: 1;
|
|
6
6
|
`
|
|
7
|
-
export const ReviewOrderTitle = styled.View
|
|
7
|
+
export const ReviewOrderTitle = styled.View`
|
|
8
|
+
|
|
9
|
+
`
|
|
8
10
|
|
|
9
11
|
export const BusinessLogo = styled.View`
|
|
10
12
|
margin-vertical: 5px;
|
|
11
13
|
align-items: center;
|
|
14
|
+
box-shadow: 0 1px 2px #ddd;
|
|
15
|
+
border-radius: 7.6px;
|
|
16
|
+
margin-bottom: 20px;
|
|
12
17
|
`
|
|
13
18
|
|
|
14
19
|
export const FormReviews = styled.View`
|
|
15
20
|
flex: 1;
|
|
16
|
-
height: 100%;
|
|
17
21
|
`
|
|
18
22
|
|
|
19
23
|
export const Category = styled.View`
|
|
20
24
|
padding: 10px;
|
|
21
25
|
border-width: 1px;
|
|
22
|
-
border-color: ${(
|
|
26
|
+
border-color: ${(props: any) => props.theme.colors.secundaryContrast};
|
|
23
27
|
flex-direction: row;
|
|
24
28
|
justify-content: space-between;
|
|
25
29
|
margin-vertical: 5px;
|
|
@@ -29,3 +33,14 @@ export const Category = styled.View`
|
|
|
29
33
|
export const Stars = styled.View`
|
|
30
34
|
flex-direction: row;
|
|
31
35
|
`
|
|
36
|
+
|
|
37
|
+
export const BlockWrap = styled.View`
|
|
38
|
+
margin-vertical: 16px;
|
|
39
|
+
padding-bottom: 20px;
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export const CommentItem = styled.TouchableOpacity`
|
|
43
|
+
padding: 3px 10px;
|
|
44
|
+
border-radius: 20px;
|
|
45
|
+
min-height: 24px;
|
|
46
|
+
`;
|