ordering-ui-react-native 0.12.7 → 0.12.11

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.
Files changed (26) hide show
  1. package/package.json +2 -1
  2. package/src/assets/images/business_list_banner.jpg +0 -0
  3. package/themes/original/index.tsx +2 -0
  4. package/themes/original/src/components/BusinessesListing/index.tsx +7 -0
  5. package/themes/original/src/components/BusinessesListing/styles.tsx +6 -1
  6. package/themes/original/src/components/OrderProgress/index.tsx +208 -0
  7. package/themes/original/src/components/OrderProgress/styles.tsx +30 -0
  8. package/themes/original/src/components/ProductForm/index.tsx +159 -56
  9. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  10. package/themes/single-business/src/components/ActiveOrders/index.tsx +20 -19
  11. package/themes/single-business/src/components/BusinessProductsListing/index.tsx +4 -4
  12. package/themes/single-business/src/components/Cart/index.tsx +39 -47
  13. package/themes/single-business/src/components/Cart/styles.tsx +1 -0
  14. package/themes/single-business/src/components/LoginForm/index.tsx +147 -89
  15. package/themes/single-business/src/components/LoginForm/styles.tsx +33 -28
  16. package/themes/single-business/src/components/OrderDetails/index.tsx +32 -12
  17. package/themes/single-business/src/components/OrdersOption/index.tsx +50 -50
  18. package/themes/single-business/src/components/OrdersOption/styles.tsx +1 -1
  19. package/themes/single-business/src/components/PreviousOrders/index.tsx +97 -83
  20. package/themes/single-business/src/components/PromotionCard/index.tsx +10 -2
  21. package/themes/single-business/src/components/Promotions/index.tsx +10 -15
  22. package/themes/single-business/src/components/ReviewOrder/index.tsx +299 -274
  23. package/themes/single-business/src/components/ReviewOrder/styles.tsx +23 -26
  24. package/themes/single-business/src/components/UpsellingProducts/index.tsx +230 -189
  25. package/themes/single-business/src/components/UpsellingProducts/styles.tsx +24 -18
  26. package/themes/single-business/src/types/index.tsx +10 -2
@@ -1,306 +1,331 @@
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';
4
- import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
1
+ import React, { useState, useEffect } from 'react'
2
+ import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType } from 'ordering-components/native'
5
3
  import { useForm, Controller } from 'react-hook-form'
4
+ import LinearGradient from 'react-native-linear-gradient'
6
5
 
7
6
  import {
8
- ReviewOrderContainer,
9
- BusinessLogo,
10
- FormReviews,
11
- Category,
12
- Stars,
13
- BlockWrap,
14
- CommentItem
7
+ ReviewOrderContainer,
8
+ BusinessLogo,
9
+ FormReviews,
10
+ CommentsButtonGroup,
11
+ ActionContainer,
12
+ SkipButton,
13
+ RatingBarContainer,
14
+ RatingTextContainer
15
15
  } from './styles'
16
16
  import { OButton, OIcon, OInput, OText } from '../shared'
17
- import { TouchableOpacity, StyleSheet, View } from 'react-native';
17
+ import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
18
18
  import NavBar from '../NavBar'
19
+ import { FloatingBottomContainer } from '../../../../../src/layouts/FloatingBottomContainer'
19
20
  import Spinner from 'react-native-loading-spinner-overlay'
20
21
 
21
22
  import { ReviewOrderParams } from '../../types'
22
- import { ProgressBar } from 'react-native-paper';
23
- import { REVIEW_ORDER_COMMENTS } from '../../config/constants';
24
- import TagSelector from '../TagSelector';
23
+ import { useTheme } from 'styled-components/native'
25
24
 
26
25
  export const ReviewOrderUI = (props: ReviewOrderParams) => {
27
- const {
28
- order,
29
- stars,
30
- handleChangeInput,
31
- handleChangeRating,
32
- handleSendReview,
33
- formState,
34
- navigation,
35
- orderComments
36
- } = props
26
+ const {
27
+ order,
28
+ stars,
29
+ handleSendReview,
30
+ formState,
31
+ navigation,
32
+ setStars,
33
+ onNavigationRedirect,
34
+ handleReviewState,
35
+ setIsReviewed
36
+ } = props
37
37
 
38
- const theme = useTheme();
38
+ const theme = useTheme()
39
39
 
40
- const styles = StyleSheet.create({
41
- inputTextArea: {
42
- borderColor: theme.colors.border,
43
- borderRadius: 7.6,
44
- marginVertical: 10,
45
- height: 100,
46
- alignItems: 'flex-start',
47
- paddingVertical: 12,
48
- fontSize: 10
49
- },
50
- progress: {
51
- borderRadius: 5,
52
- height: 4,
53
- backgroundColor: theme.colors.backgroundGray200,
54
- marginVertical: 9,
55
- },
56
- progressLabel: {
57
- flexDirection: 'row',
58
- justifyContent: 'space-between',
59
- },
60
- })
40
+ const styles = StyleSheet.create({
41
+ logoWrapper: {
42
+ shadowColor: theme.colors.black,
43
+ shadowRadius: 3,
44
+ shadowOffset: {width: 1, height: 4},
45
+ elevation: 3,
46
+ borderRadius: 8,
47
+ shadowOpacity: 0.1,
48
+ overflow: 'hidden'
49
+ },
50
+ inputTextArea: {
51
+ borderColor: theme.colors.lightGray,
52
+ borderRadius: 8,
53
+ marginTop: 10,
54
+ marginBottom: 40,
55
+ height: 100,
56
+ alignItems: 'flex-start'
57
+ },
58
+ statusBar: {
59
+ transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
60
+ height: 10,
61
+ borderRadius: 5,
62
+ marginTop: 5
63
+ },
64
+ ratingItemContainer: {
65
+ position: 'absolute',
66
+ top: -20
67
+ },
68
+ ratingItem: {
69
+ left: '-50%',
70
+ flexDirection: 'column',
71
+ alignItems: 'center'
72
+ },
73
+ ratingLineStyle: {
74
+ height: 10,
75
+ width: 1,
76
+ marginBottom: 10,
77
+ backgroundColor: theme.colors.dusk
78
+ },
79
+ reviewedStyle: {
80
+ flexDirection: 'row',
81
+ justifyContent: 'center',
82
+ marginVertical: 20
83
+ }
84
+ })
61
85
 
62
- const [, t] = useLanguage()
63
- const [, { showToast }] = useToast()
64
- const { handleSubmit, control, errors } = useForm()
65
-
66
- const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
86
+ const [, t] = useLanguage()
87
+ const [, { showToast }] = useToast()
88
+ const { handleSubmit, control, errors } = useForm()
67
89
 
68
- const [curVal, setReviewVal] = useState(-1);
69
- const [curSuggest, setSuggest] = useState(orderComments || REVIEW_ORDER_COMMENTS);
70
- const [selectedSuggest, setSelectedSuggest] = useState([]);
71
- const [comment, setComment] = useState('');
90
+ const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
91
+ const [comments, setComments] = useState<Array<any>>([])
92
+ const [extraComment, setExtraComment] = useState('')
72
93
 
73
- const categories = {
74
- quality: { name: 'quality', show: t('QUALITY', 'Quality of Product') },
75
- punctuality: { name: 'punctiality', show: t('PUNCTUALITY', 'Punctuality') },
76
- service: { name: 'service', show: t('SERVICE', 'Service') },
77
- packaging: { name: 'packaging', show: t('PRODUCT_PACKAGING', 'Product Packaging') }
78
- }
94
+ const onSubmit = () => {
95
+ if (Object.values(stars).some((value: any) => value === 0)) {
96
+ setAlertState({
97
+ open: true,
98
+ content: stars.quality === 0 ? [`${t('REVIEW_QUALIFICATION_REQUIRED', 'Review qualification is required')}`] : []
99
+ })
100
+ return
101
+ }
102
+ handleSendReview()
103
+ handleReviewState && handleReviewState(order?.id)
104
+ setIsReviewed && setIsReviewed(true)
105
+ setAlertState({ ...alertState, success: true })
106
+ }
79
107
 
80
- const scores = [
81
- {
82
- val: 0.5,
83
- color: theme.colors.strength_1,
84
- text: t('REVIEW_TERRIBLE', 'Terrible')
85
- },
86
- {
87
- val: 1.5,
88
- color: theme.colors.strength_2,
89
- text: t('REVIEW_BAD', 'Bad')
90
- },
91
- {
92
- val: 2.5,
93
- color: theme.colors.strength_3,
94
- text: t('REVIEW_OKAY', 'Okay')
95
- },
96
- {
97
- val: 3.7,
98
- color: theme.colors.strength_4,
99
- text: t('REVIEW_GOOD', 'Good')
100
- },
101
- {
102
- val: 5,
103
- color: theme.colors.strength_5,
104
- text: t('REVIEW_GREAT', 'Great')
105
- },
106
- ]
108
+ const qualificationList = [
109
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
110
+ { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
111
+ { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
112
+ { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
113
+ { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
114
+ ]
107
115
 
108
- const getProgColor = () => {
109
- return scores.find(({val}) => val == curVal)?.color || theme.colors.textNormal;
110
- }
116
+ const commentsList = [
117
+ { key: 0, content: t('IT_WASNT_TASTY', "It wasn't tasty") },
118
+ { key: 1, content: t('IT_DOESNT_PACK_WELL', "It doesn't pack well") },
119
+ { key: 2, content: t('IT_ISNT_WORTH_WHAT_IT_COSTS', "It isn't worth what it costs") },
120
+ { key: 3, content: t('TOO_SLOW', 'Too slow') },
121
+ { key: 4, content: t('SUSTAINABLE_PACKAGING_WASNT_USED', "Sustainable packaging wasn't used") },
122
+ { key: 5, content: t('THEY_DID_NOT_FOLLOW_THE_ORDER_NOTES', 'They did not follow the order notes') }
123
+ ]
111
124
 
112
- const onSubmit = () => {
113
- if (Object.values(stars).some(value => value === 0)) {
114
- setAlertState({
115
- open: true,
116
- 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'}` : ' ')
117
- })
118
- return
119
- }
120
- handleSendReview()
121
- setAlertState({ ...alertState, success: true })
122
- }
125
+ const handleChangeStars = (index: number) => {
126
+ switch (index) {
127
+ case 1:
128
+ setStars({ ...stars, quality: 1, punctiality: 1, service: 1, packaging: 1 })
129
+ break
130
+ case 2:
131
+ setStars({ ...stars, quality: 2, punctiality: 2, service: 2, packaging: 2 })
132
+ break
133
+ case 3:
134
+ setStars({ ...stars, quality: 3, punctiality: 3, service: 3, packaging: 3 })
135
+ break
136
+ case 4:
137
+ setStars({ ...stars, quality: 4, punctiality: 4, service: 4, packaging: 4 })
138
+ break
139
+ case 5:
140
+ setStars({ ...stars, quality: 5, punctiality: 5, service: 5, packaging: 5 })
141
+ break
142
+ }
143
+ }
123
144
 
124
- const getStarArr = (rating: number) => {
125
- switch (rating) {
126
- case 0:
127
- return [0, 0, 0, 0, 0];
128
- case 1:
129
- return [1, 0, 0, 0, 0];
130
- case 2:
131
- return [1, 1, 0, 0, 0];
132
- case 3:
133
- return [1, 1, 1, 0, 0];
134
- case 4:
135
- return [1, 1, 1, 1, 0];
136
- case 5:
137
- return [1, 1, 1, 1, 1];
138
- default:
139
- return [0, 0, 0, 0, 0];
140
- }
141
- }
145
+ const handleChangeComment = (commentItem: any) => {
146
+ const found = comments.find((comment: any) => comment?.key === commentItem.key)
147
+ if (found) {
148
+ const _comments = comments.filter((comment: any) => comment?.key !== commentItem.key)
149
+ setComments(_comments)
150
+ } else {
151
+ setComments([...comments, commentItem])
152
+ }
153
+ }
142
154
 
143
- const setReviewStatus = (val: number) => {
155
+ const isSelectedComment = (commentKey: number) => {
156
+ const found = comments.find((comment: any) => comment?.key === commentKey)
157
+ return found
158
+ }
144
159
 
145
- }
160
+ useEffect(() => {
161
+ if (formState.error && !formState?.loading) {
162
+ showToast(ToastType.Error, formState.result)
163
+ }
164
+ if (!formState.loading && !formState.error && alertState.success) {
165
+ showToast(ToastType.Success, t('ORDER_REVIEW_SUCCESS_CONTENT', 'Thank you, Order review successfully submitted!'))
166
+ navigation?.canGoBack() && navigation.goBack()
167
+ }
168
+ }, [formState.result])
146
169
 
147
- const onSuggestUpdate = useCallback((items) => {
148
- if (items.length > 0) {
149
- let selected: Array<never> = [];
150
- items.map(({label, checked}: never) => {
151
- if (checked === true) {
152
- selected.push(label);
153
- }
154
- });
155
- setSelectedSuggest(selected);
170
+ useEffect(() => {
171
+ if (Object.keys(errors).length > 0) {
172
+ // Convert all errors in one string to show in toast provider
173
+ const list = Object.values(errors);
174
+ let stringError = '';
175
+ list.map((item: any, i: number) => {
176
+ stringError +=
177
+ i + 1 === list.length ? `- ${item.message}` : `- ${item.message}\n`;
178
+ });
179
+ showToast(ToastType.Error, stringError);
180
+ }
181
+ }, [errors])
156
182
 
157
- // console.log(selected);
158
- }
159
- }, []);
183
+ useEffect(() => {
184
+ if (alertState.open) {
185
+ alertState.content && showToast(
186
+ ToastType.Error,
187
+ alertState.content
188
+ )
189
+ }
190
+ }, [alertState.content])
160
191
 
161
- useEffect(() => {
162
- if (formState.error && !formState?.loading) {
163
- showToast(ToastType.Error, formState.result)
164
- }
165
- if (!formState.loading && !formState.error && alertState.success) {
166
- showToast(ToastType.Success, t('REVIEW_SUCCESS_CONTENT', 'Thank you, Review successfully submitted!'))
167
- navigation?.canGoBack() && navigation.goBack()
168
- }
169
- }, [formState.result])
192
+ useEffect(() => {
193
+ let _comments = ''
194
+ if (comments.length > 0) {
195
+ comments.map(comment => _comments += comment.content + '. ')
196
+ }
197
+ let _comment
198
+ _comment = _comments + extraComment
199
+ setStars({ ...stars, comments: _comment })
200
+ }, [comments, extraComment])
170
201
 
171
- useEffect(() => {
172
- if (Object.keys(errors).length > 0) {
173
- // Convert all errors in one string to show in toast provider
174
- const list = Object.values(errors);
175
- let stringError = '';
176
- list.map((item: any, i: number) => {
177
- stringError +=
178
- i + 1 === list.length ? `- ${item.message}` : `- ${item.message}\n`;
179
- });
180
- showToast(ToastType.Error, stringError);
181
- }
182
- }, [errors]);
202
+ return (
203
+ <>
204
+ <ReviewOrderContainer>
205
+ <NavBar
206
+ title={t('REVIEW_ORDER', 'Review Order')}
207
+ titleAlign={'center'}
208
+ onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
209
+ showCall={false}
210
+ btnStyle={{ paddingLeft: 0 }}
211
+ paddingTop={0}
212
+ />
213
+ <BusinessLogo>
214
+ <View style={styles.logoWrapper}>
215
+ <OIcon
216
+ url={order?.logo}
217
+ width={80}
218
+ height={80}
219
+ />
220
+ </View>
221
+ </BusinessLogo>
222
+ {order?.review ? (
223
+ <View style={styles.reviewedStyle}>
224
+ <OText color={theme.colors.primary}>{t('ORDER_REVIEWED', 'This order has been already reviewed')}</OText>
225
+ </View>
226
+ ) : (
227
+ <View style={{flex: 1, justifyContent: 'flex-end'}}>
228
+ <FormReviews>
229
+ <OText mBottom={13}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
230
+ <RatingBarContainer>
231
+ <LinearGradient
232
+ start={{ x: 0.0, y: 0.0 }}
233
+ end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
234
+ locations={[.9999, .9999]}
235
+ colors={[theme.colors.primary, theme.colors.backgroundGray200]}
236
+ style={styles.statusBar}
237
+ />
238
+ <RatingTextContainer>
239
+ {qualificationList.map((qualification: any) => (
240
+ <View
241
+ key={qualification.key}
242
+ style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
243
+ >
244
+ <TouchableOpacity
245
+ style={qualification.isInnerStyle && styles.ratingItem}
246
+ onPress={() => handleChangeStars(qualification.key)}
247
+ >
248
+ <View
249
+ style={{
250
+ ...styles.ratingLineStyle,
251
+ backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
252
+ }}
253
+ />
254
+ <OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.lightGray}>{qualification.text}</OText>
255
+ </TouchableOpacity>
256
+ </View>
257
+ ))}
258
+ </RatingTextContainer>
259
+ </RatingBarContainer>
183
260
 
184
- useEffect(() => {
185
- if (alertState.open) {
186
- alertState.content && showToast(
187
- ToastType.Error,
188
- alertState.content
189
- )
190
- }
191
- }, [alertState.content])
261
+ <OText style={{ marginTop: 30 }}>{t('COMMENTS', 'Comments')}</OText>
262
+ <CommentsButtonGroup>
263
+ {commentsList.map(commentItem => (
264
+ <OButton
265
+ key={commentItem.key}
266
+ text={commentItem.content}
267
+ bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
268
+ borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
269
+ textStyle={{
270
+ color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
271
+ fontSize: 13,
272
+ paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
273
+ }}
274
+ style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
275
+ imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
276
+ imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
277
+ onClick={() => handleChangeComment(commentItem) }
278
+ />
279
+ ))}
280
+ </CommentsButtonGroup>
192
281
 
193
-
194
- const getStar = (star: number, index: number, category: string) => {
195
- switch (star) {
196
- case 0:
197
- return (
198
- <TouchableOpacity key={index} onPress={() => handleChangeRating({ target: { name: category, value: index + 1 } })}>
199
- <MaterialCommunityIcon name='star-outline' size={24} color={theme.colors.backgroundDark} />
200
- </TouchableOpacity>
201
- )
202
- case 1:
203
- return (
204
- <TouchableOpacity key={index} onPress={() => handleChangeRating({ target: { name: category, value: index + 1 } })}>
205
- <MaterialCommunityIcon name='star' size={24} color={theme.colors.primary} />
206
- </TouchableOpacity>
207
- )
208
- }
209
- }
210
-
211
- return (
212
- <ReviewOrderContainer>
213
- <NavBar
214
- title={t('REVIEW_ORDER', 'Review Order')}
215
- titleAlign={'center'}
216
- onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
217
- showCall={false}
218
- btnStyle={{ paddingLeft: 0 }}
219
- paddingTop={0}
220
- isVertical
221
- leftImg={theme.images.general.close}
222
- leftImageStyle={{width: 16}}
223
- />
224
- <BusinessLogo>
225
- <OIcon url={order?.logo} width={72} height={72} style={{borderRadius: 7.6}} />
226
- </BusinessLogo>
227
- <View style={{ flex: 1, justifyContent: 'flex-end' }}>
228
- <BlockWrap>
229
- <OText mBottom={10}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
230
- <ProgressBar
231
- progress={curVal / 5}
232
- color={getProgColor()}
233
- style={styles.progress}
234
- />
235
- <View style={styles.progressLabel}>
236
- {scores.map(({ val, text, color }, idx) =>
237
- <TouchableOpacity key={idx} onPress={() => setReviewVal(val)}>
238
- <OText
239
- size={10}
240
- color={
241
- curVal === val
242
- ? color
243
- : theme.colors.backgroundGray400
244
- }>
245
- {text}
246
- </OText>
247
- </TouchableOpacity>
248
- )}
249
- </View>
250
- </BlockWrap>
251
- <BlockWrap>
252
- <OText mBottom={16}>{t('COMMENTS', 'Comments')}</OText>
253
- <View style={{flexShrink: 1}}>
254
- <TagSelector items={curSuggest} activeColor={theme.colors.primary} normalColor={'#E9ECEF'} onUpdated={onSuggestUpdate} />
255
- </View>
256
- </BlockWrap>
257
- <FormReviews>
258
- {/* {Object.values(categories).map(category => (
259
- <Category key={category.name}>
260
- <OText>{category.show}</OText>
261
- <Stars>
262
- {getStarArr(stars[category?.name]).map((star, index) => getStar(star, index, category.name))}
263
- </Stars>
264
- </Category>
265
- ))} */}
266
- <OText mBottom={10}>{t('DO_YOU_WANT_TO_ADD_SOMETHING', 'Do you want to add something?')}</OText>
267
- <Controller
268
- control={control}
269
- defaultValue=''
270
- name='comments'
271
- render={({ onChange }: any) => (
272
- <OInput
273
- name='comments'
274
- placeholder={t('COMMENTS', 'Comments')}
275
- onChange={(val: string) => {
276
- onChange(val)
277
- handleChangeInput(val)
278
- }}
279
- style={styles.inputTextArea}
280
- multiline
281
- inputStyle={{fontSize: 12}}
282
- />
283
- )}
284
- />
285
- </FormReviews>
286
- <OButton
287
- textStyle={{ color: theme.colors.white }}
288
- style={{ marginTop: 20 }}
289
- text={t('SAVE', 'Save')}
290
- imgRightSrc=''
291
- onClick={handleSubmit(onSubmit)}
292
- />
293
- </View>
294
- <Spinner visible={formState.loading} />
295
- </ReviewOrderContainer>
296
- )
282
+ <OText style={{ marginTop: 30 }}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText>
283
+ <Controller
284
+ control={control}
285
+ defaultValue=''
286
+ name='comments'
287
+ render={({ onChange }: any) => (
288
+ <OInput
289
+ name='comments'
290
+ onChange={(val: any) => {
291
+ onChange(val)
292
+ setExtraComment(val.target.value)
293
+ }}
294
+ style={styles.inputTextArea}
295
+ multiline
296
+ />
297
+ )}
298
+ />
299
+ </FormReviews>
300
+ </View>
301
+ )}
302
+ <Spinner visible={formState.loading} />
303
+ </ReviewOrderContainer>
304
+ <FloatingBottomContainer>
305
+ <ActionContainer>
306
+ <SkipButton
307
+ // onPress={() => onNavigationRedirect('ReviewProducts', { order: order })}
308
+ onPress={() => navigation?.canGoBack() && navigation.goBack()}
309
+ >
310
+ <OText weight={700} size={18}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
311
+ </SkipButton>
312
+ <OButton
313
+ textStyle={{ color: theme.colors.white, paddingRight: 10 }}
314
+ text={t('SEND_REVIEW', 'Send Review')}
315
+ style={{ borderRadius: 8 }}
316
+ imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
317
+ onClick={handleSubmit(onSubmit)}
318
+ />
319
+ </ActionContainer>
320
+ </FloatingBottomContainer>
321
+ </>
322
+ )
297
323
  }
298
324
 
299
-
300
325
  export const ReviewOrder = (props: ReviewOrderParams) => {
301
- const reviewOrderProps = {
302
- ...props,
303
- UIComponent: ReviewOrderUI
304
- }
305
- return <ReviewOrderController {...reviewOrderProps} />
326
+ const reviewOrderProps = {
327
+ ...props,
328
+ UIComponent: ReviewOrderUI
329
+ }
330
+ return <ReviewOrderController {...reviewOrderProps} />
306
331
  }