ordering-ui-react-native 0.14.87 → 0.14.88

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.14.87",
3
+ "version": "0.14.88",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -201,6 +201,62 @@ export const transformCountryCode = (countryCode : number) => {
201
201
  const [, t] = useLanguage()
202
202
 
203
203
  const reviews: any = {
204
+ order: {
205
+ 1: {
206
+ title: t('QUICK_COMMENT_TITLE_1', "What went wrong?"),
207
+ list: [
208
+ { key: 0, content: t('QUICK_COMMENT_1_0', "Not handled with care") },
209
+ { key: 1, content: t('QUICK_COMMENT_1_1', "Poor communication") },
210
+ { key: 2, content: t('QUICK_COMMENT_1_2', "COVID-19 issue") },
211
+ { key: 3, content: t('QUICK_COMMENT_1_3', "Didn't follow instructions") },
212
+ { key: 4, content: t('QUICK_COMMENT_1_4', "Rude") },
213
+ { key: 5, content: t('QUICK_COMMENT_1_5', "Not on-time") },
214
+ ]
215
+ },
216
+ 2: {
217
+ title: t('QUICK_COMMENT_TITLE_2', "What went wrong?"),
218
+ list: [
219
+ { key: 0, content: t('QUICK_COMMENT_2_0', "Not handled with care") },
220
+ { key: 1, content: t('QUICK_COMMENT_2_1', "Poor communication") },
221
+ { key: 2, content: t('QUICK_COMMENT_2_2', "COVID-19 issue") },
222
+ { key: 3, content: t('QUICK_COMMENT_2_3', "Didn't follow instructions") },
223
+ { key: 4, content: t('QUICK_COMMENT_2_4', "Rude") },
224
+ { key: 5, content: t('QUICK_COMMENT_2_5', "Not on-time") },
225
+ ]
226
+ },
227
+ 3: {
228
+ title: t('QUICK_COMMENT_TITLE_3', "What could have been better?"),
229
+ list: [
230
+ { key: 0, content: t('QUICK_COMMENT_3_0', "Not handled with care") },
231
+ { key: 1, content: t('QUICK_COMMENT_3_1', "Poor communication") },
232
+ { key: 2, content: t('QUICK_COMMENT_3_2', "COVID-19 issue") },
233
+ { key: 3, content: t('QUICK_COMMENT_3_3', "Didn't follow instructions") },
234
+ { key: 4, content: t('QUICK_COMMENT_3_4', "Rude") },
235
+ { key: 5, content: t('QUICK_COMMENT_3_5', "Not on-time") },
236
+ ]
237
+ },
238
+ 4: {
239
+ title: t('QUICK_COMMENT_TITLE_4', " Tell us more"),
240
+ list: [
241
+ { key: 0, content: t('QUICK_COMMENT_4_0', "Not handled with care") },
242
+ { key: 1, content: t('QUICK_COMMENT_4_1', "Poor communication") },
243
+ { key: 2, content: t('QUICK_COMMENT_4_2', "COVID-19 issue") },
244
+ { key: 3, content: t('QUICK_COMMENT_4_3', "Didn't follow instructions") },
245
+ { key: 4, content: t('QUICK_COMMENT_4_4', "Rude") },
246
+ { key: 5, content: t('QUICK_COMMENT_4_5', "Not on-time") },
247
+ ]
248
+ },
249
+ 5: {
250
+ title: t('QUICK_COMMENT_TITLE_5', "What went well?"),
251
+ list: [
252
+ { key: 0, content: t('QUICK_COMMENT_5_0', "Good communication") },
253
+ { key: 1, content: t('QUICK_COMMENT_5_1', "Followed instructions") },
254
+ { key: 2, content: t('QUICK_COMMENT_5_2', "Friendly") },
255
+ { key: 3, content: t('QUICK_COMMENT_5_3', 'Handled with care') },
256
+ { key: 4, content: t('QUICK_COMMENT_5_4', "Above and beyond") },
257
+ ]
258
+ },
259
+ },
204
260
  customer: {
205
261
  1: {
206
262
  title: t('CUSTOMER_QUICK_COMMENT_TITLE_1', "What went wrong?"),
@@ -254,6 +310,76 @@ export const transformCountryCode = (countryCode : number) => {
254
310
  { key: 2, content: t('CUSTOMER_QUICK_COMMENT_5_2', "Above and beyond") },
255
311
  ]
256
312
  },
313
+ },
314
+ driver: {
315
+ 1: {
316
+ title: t('DRIVER_QUICK_COMMENT_TITLE_1', "What went wrong?"),
317
+ list: [
318
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_1_0', "Not handled with care") },
319
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_1_1', "Poor communication") },
320
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_1_2', "COVID-19 issue") },
321
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_1_3', "Didn't follow instructions") },
322
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_1_4', "Rude") },
323
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_1_5', "Not on-time") },
324
+ ]
325
+ },
326
+ 2: {
327
+ title: t('DRIVER_QUICK_COMMENT_TITLE_2', "What went wrong?"),
328
+ list: [
329
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_2_0', "Not handled with care") },
330
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_2_1', "Poor communication") },
331
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_2_2', "COVID-19 issue") },
332
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_2_3', "Didn't follow instructions") },
333
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_2_4', "Rude") },
334
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_2_5', "Not on-time") },
335
+ ]
336
+ },
337
+ 3: {
338
+ title: t('DRIVER_QUICK_COMMENT_TITLE_3', "What could have been better?"),
339
+ list: [
340
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_3_0', "Not handled with care") },
341
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_3_1', "Poor communication") },
342
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_3_2', "COVID-19 issue") },
343
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_3_3', "Didn't follow instructions") },
344
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_3_4', "Rude") },
345
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_3_5', "Not on-time") },
346
+ ]
347
+ },
348
+ 4: {
349
+ title: t('DRIVER_QUICK_COMMENT_TITLE_4', " Tell us more"),
350
+ list: [
351
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_4_0', "Not handled with care") },
352
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_4_1', "Poor communication") },
353
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_4_2', "COVID-19 issue") },
354
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_4_3', "Didn't follow instructions") },
355
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_4_4', "Rude") },
356
+ { key: 5, content: t('DRIVER_QUICK_COMMENT_4_5', "Not on-time") },
357
+ ]
358
+ },
359
+ 5: {
360
+ title: t('DRIVER_QUICK_COMMENT_TITLE_5', "What went well?"),
361
+ list: [
362
+ { key: 0, content: t('DRIVER_QUICK_COMMENT_5_0', "Good communication") },
363
+ { key: 1, content: t('DRIVER_QUICK_COMMENT_5_1', "Followed instructions") },
364
+ { key: 2, content: t('DRIVER_QUICK_COMMENT_5_2', "Friendly") },
365
+ { key: 3, content: t('DRIVER_QUICK_COMMENT_5_3', 'Handled with care') },
366
+ { key: 4, content: t('DRIVER_QUICK_COMMENT_5_4', "Above and beyond") },
367
+ ]
368
+ },
369
+ },
370
+ product: {
371
+ like: [
372
+ { key: 0, content: t('QUICK_COMMENT_LIKE_0', "Tasty") },
373
+ { key: 1, content: t('QUICK_COMMENT_LIKE_1', "Good price") },
374
+ { key: 2, content: t('QUICK_COMMENT_LIKE_2', "Good portion size") },
375
+ { key: 3, content: t('QUICK_COMMENT_LIKE_3', "Packed well") },
376
+ ],
377
+ dislike: [
378
+ { key: 0, content: t('QUICK_COMMENT_DISLIKE_0', "Not tasty") },
379
+ { key: 1, content: t('QUICK_COMMENT_DISLIKE_1', "High price") },
380
+ { key: 2, content: t('QUICK_COMMENT_DISLIKE_2', "Bad portion size") },
381
+ { key: 3, content: t('QUICK_COMMENT_DISLIKE_3', "Not packed well") },
382
+ ]
257
383
  }
258
384
  }
259
385
 
@@ -10,6 +10,8 @@ import LinearGradient from 'react-native-linear-gradient'
10
10
  import { FloatingBottomContainer } from '../../layouts/FloatingBottomContainer'
11
11
  import Spinner from 'react-native-loading-spinner-overlay'
12
12
 
13
+ import { reviewCommentList } from '../../../../../src/utils'
14
+
13
15
  import {
14
16
  ReviewDriverContainer,
15
17
  DriverPhotoContainer,
@@ -91,12 +93,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
91
93
  { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
92
94
  ]
93
95
 
94
- const commentsList = [
95
- { key: 0, content: t('FAST_AND_EFFICIENT', "Fast and efficient") },
96
- { key: 1, content: t('DELIVERY_PERFECT', "Delivery perfect") },
97
- { key: 2, content: t('EXCELLENT_COMMUNICATION', "Excellent communication") },
98
- { key: 3, content: t('CORDIAL_SERVICE', 'Cordial service') }
99
- ]
96
+ const commentsList = reviewCommentList('driver')
100
97
 
101
98
  const onSubmit = () => {
102
99
  if (dirverReviews?.qualification === 0) {
@@ -248,9 +245,11 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
248
245
  </RatingTextContainer>
249
246
  </RatingBarContainer>
250
247
 
251
- <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('COMMENTS', 'Comments')}</OText>
248
+ <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
249
+ {commentsList[dirverReviews?.qualification || 1]?.title}
250
+ </OText>
252
251
  <CommentsButtonGroup>
253
- {commentsList.map(commentItem => (
252
+ {commentsList[dirverReviews?.qualification || 1]?.list?.map(commentItem => (
254
253
  <OButton
255
254
  key={commentItem.key}
256
255
  text={commentItem.content}
@@ -22,6 +22,8 @@ import Spinner from 'react-native-loading-spinner-overlay'
22
22
  import { ReviewOrderParams } from '../../types'
23
23
  import { useTheme } from 'styled-components/native'
24
24
 
25
+ import { reviewCommentList } from '../../../../../src/utils'
26
+
25
27
  export const ReviewOrderUI = (props: ReviewOrderParams) => {
26
28
  const {
27
29
  order,
@@ -113,14 +115,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
113
115
  { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
114
116
  ]
115
117
 
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
- ]
118
+ const commentsList = reviewCommentList('order')
124
119
 
125
120
  const handleChangeStars = (index: number) => {
126
121
  switch (index) {
@@ -268,9 +263,11 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
268
263
  </RatingTextContainer>
269
264
  </RatingBarContainer>
270
265
 
271
- <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('COMMENTS', 'Comments')}</OText>
266
+ <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
267
+ {commentsList[stars?.quality || 1]?.title}
268
+ </OText>
272
269
  <CommentsButtonGroup>
273
- {commentsList.map(commentItem => (
270
+ {commentsList[stars?.quality || 1]?.list?.map(commentItem => (
274
271
  <OButton
275
272
  key={commentItem.key}
276
273
  text={commentItem.content}
@@ -6,6 +6,8 @@ import AntDesignIcons from 'react-native-vector-icons/AntDesign'
6
6
  import { useTheme } from 'styled-components/native'
7
7
  import { SingleProductReviewParams } from '../../types'
8
8
 
9
+ import { reviewCommentList } from '../../../../../src/utils'
10
+
9
11
  import {
10
12
  ProductContainer,
11
13
  ProductHeader,
@@ -45,13 +47,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
45
47
  const [isShowTextArea, setIsShowTextArea] = useState(false)
46
48
  const [qualification, setQualification] = useState(5)
47
49
 
48
- const commentsList = [
49
- { key: 0, content: t('IT_WASNT_TASTY', "It wasn't tasty") },
50
- { key: 1, content: t('SMALL_PORTION', 'Small portion') },
51
- { key: 2, content: t('WET_OR_LEAKY', 'Wet or leaky') },
52
- { key: 3, content: t('SLOPPY_PRESENTATION', 'Sloppy presentation') },
53
- { key: 4, content: t('COLD_OR_MELTED', 'Cold or melted') }
54
- ]
50
+ const commentsList = reviewCommentList('product')
55
51
 
56
52
  const isSelectedComment = (commentKey: number) => {
57
53
  const found = comments.find((comment: any) => comment?.key === commentKey)
@@ -115,7 +111,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
115
111
  </LikeHandsActionContainer>
116
112
  </ProductHeader>
117
113
  <CommentsButtonGroup>
118
- {commentsList.map(commentItem => (
114
+ {commentsList[qualification === 5 ? 'like' : 'dislike']?.map(commentItem => (
119
115
  <OButton
120
116
  key={commentItem.key}
121
117
  text={commentItem.content}