ordering-ui-react-native 0.14.86 → 0.14.89
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/utils/index.tsx +194 -0
- package/themes/business/src/components/OrdersOption/index.tsx +400 -58
- package/themes/business/src/components/OrdersOption/styles.tsx +98 -7
- package/themes/business/src/components/PreviousOrders/index.tsx +34 -38
- package/themes/business/src/components/PreviousOrders/styles.tsx +5 -10
- package/themes/business/src/components/ReviewCustomer/index.tsx +6 -7
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +314 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +38 -0
- package/themes/original/src/components/ReviewOrder/index.tsx +322 -186
- package/themes/original/src/components/ReviewOrder/styles.tsx +24 -13
- package/themes/original/src/components/ReviewProducts/index.tsx +116 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +16 -0
- package/themes/original/src/components/SingleProductReview/index.tsx +162 -0
- package/themes/original/src/components/SingleProductReview/styles.tsx +27 -0
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +26 -0
- package/themes/original/src/types/index.tsx +29 -2
package/package.json
CHANGED
package/src/utils/index.tsx
CHANGED
|
@@ -191,3 +191,197 @@ export const transformCountryCode = (countryCode : number) => {
|
|
|
191
191
|
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
|
|
192
192
|
return R * c
|
|
193
193
|
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* function to manage review comment list
|
|
197
|
+
* @param {number} param0 type of reviews to return
|
|
198
|
+
* @returns object with reviews dictionary
|
|
199
|
+
*/
|
|
200
|
+
export const reviewCommentList = (type: string) => {
|
|
201
|
+
const [, t] = useLanguage()
|
|
202
|
+
|
|
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
|
+
},
|
|
260
|
+
customer: {
|
|
261
|
+
1: {
|
|
262
|
+
title: t('CUSTOMER_QUICK_COMMENT_TITLE_1', "What went wrong?"),
|
|
263
|
+
list: [
|
|
264
|
+
{ key: 0, content: t('CUSTOMER_QUICK_COMMENT_1_0', "Poor communication") },
|
|
265
|
+
{ key: 1, content: t('CUSTOMER_QUICK_COMMENT_1_1', "Wrong address") },
|
|
266
|
+
{ key: 2, content: t('CUSTOMER_QUICK_COMMENT_1_2', "COVID-19 issue") },
|
|
267
|
+
{ key: 3, content: t('CUSTOMER_QUICK_COMMENT_1_3', "Didn't follow instructions") },
|
|
268
|
+
{ key: 4, content: t('CUSTOMER_QUICK_COMMENT_1_4', "Rude") },
|
|
269
|
+
{ key: 5, content: t('CUSTOMER_QUICK_COMMENT_1_5', "Not on-time") },
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
2: {
|
|
273
|
+
title: t('CUSTOMER_QUICK_COMMENT_TITLE_2', "What went wrong?"),
|
|
274
|
+
list: [
|
|
275
|
+
{ key: 0, content: t('CUSTOMER_QUICK_COMMENT_2_0', "Poor communication") },
|
|
276
|
+
{ key: 1, content: t('CUSTOMER_QUICK_COMMENT_2_1', "Wrong address") },
|
|
277
|
+
{ key: 2, content: t('CUSTOMER_QUICK_COMMENT_2_2', "COVID-19 issue") },
|
|
278
|
+
{ key: 3, content: t('CUSTOMER_QUICK_COMMENT_2_3', "Didn't follow instructions") },
|
|
279
|
+
{ key: 4, content: t('CUSTOMER_QUICK_COMMENT_2_4', "Rude") },
|
|
280
|
+
{ key: 5, content: t('CUSTOMER_QUICK_COMMENT_2_5', "Not on-time") },
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
3: {
|
|
284
|
+
title: t('CUSTOMER_QUICK_COMMENT_TITLE_3', "What could have been better?"),
|
|
285
|
+
list: [
|
|
286
|
+
{ key: 0, content: t('CUSTOMER_QUICK_COMMENT_3_0', "Poor communication") },
|
|
287
|
+
{ key: 1, content: t('CUSTOMER_QUICK_COMMENT_3_1', "Wrong address") },
|
|
288
|
+
{ key: 2, content: t('CUSTOMER_QUICK_COMMENT_3_2', "COVID-19 issue") },
|
|
289
|
+
{ key: 3, content: t('CUSTOMER_QUICK_COMMENT_3_3', "Didn't follow instructions") },
|
|
290
|
+
{ key: 4, content: t('CUSTOMER_QUICK_COMMENT_3_4', "Rude") },
|
|
291
|
+
{ key: 5, content: t('CUSTOMER_QUICK_COMMENT_3_5', "Not on-time") },
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
4: {
|
|
295
|
+
title: t('CUSTOMER_QUICK_COMMENT_TITLE_4', " Tell us more"),
|
|
296
|
+
list: [
|
|
297
|
+
{ key: 0, content: t('CUSTOMER_QUICK_COMMENT_4_0', "Poor communication") },
|
|
298
|
+
{ key: 1, content: t('CUSTOMER_QUICK_COMMENT_4_1', "Wrong address") },
|
|
299
|
+
{ key: 2, content: t('CUSTOMER_QUICK_COMMENT_4_2', "COVID-19 issue") },
|
|
300
|
+
{ key: 3, content: t('CUSTOMER_QUICK_COMMENT_4_3', "Didn't follow instructions") },
|
|
301
|
+
{ key: 4, content: t('CUSTOMER_QUICK_COMMENT_4_4', "Rude") },
|
|
302
|
+
{ key: 5, content: t('CUSTOMER_QUICK_COMMENT_4_5', "Not on-time") },
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
5: {
|
|
306
|
+
title: t('CUSTOMER_QUICK_COMMENT_TITLE_5', "What went well?"),
|
|
307
|
+
list: [
|
|
308
|
+
{ key: 0, content: t('CUSTOMER_QUICK_COMMENT_5_0', "Good communication") },
|
|
309
|
+
{ key: 1, content: t('CUSTOMER_QUICK_COMMENT_5_1', "Friendly") },
|
|
310
|
+
{ key: 2, content: t('CUSTOMER_QUICK_COMMENT_5_2', "Above and beyond") },
|
|
311
|
+
]
|
|
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
|
+
]
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return reviews[type]
|
|
387
|
+
}
|