ordering-ui-react-native 0.16.96 → 0.16.98

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.16.96",
3
+ "version": "0.16.98",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -44,33 +44,6 @@ import { USER_TYPE } from '../../config/constants';
44
44
 
45
45
  import SignatureScreen from 'react-native-signature-canvas';
46
46
 
47
- const ORDER_STATUS: any = {
48
- 0: 'ORDER_STATUS_PENDING',
49
- 1: 'ORDERS_COMPLETED',
50
- 2: 'ORDER_REJECTED',
51
- 3: 'ORDER_STATUS_IN_BUSINESS',
52
- 4: 'ORDER_READY',
53
- 5: 'ORDER_REJECTED_RESTAURANT',
54
- 6: 'ORDER_STATUS_CANCELLEDBYDRIVER',
55
- 7: 'ORDER_STATUS_ACCEPTEDBYRESTAURANT',
56
- 8: 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER',
57
- 9: 'ORDER_PICKUP_COMPLETED_BY_DRIVER',
58
- 10: 'ORDER_PICKUP_FAILED_BY_DRIVER',
59
- 11: 'ORDER_DELIVERY_COMPLETED_BY_DRIVER',
60
- 12: 'ORDER_DELIVERY_FAILED_BY_DRIVER',
61
- 13: 'PREORDER',
62
- 14: 'ORDER_NOT_READY',
63
- 15: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
64
- 16: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER',
65
- 17: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
66
- 18: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS',
67
- 19: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER',
68
- 20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
69
- 21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
70
- 22: 'ORDER_LOOKING_FOR_DRIVER',
71
- 23: 'ORDER_DRIVER_ON_WAY'
72
- }
73
-
74
47
  const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
75
48
 
76
49
  const ChatUI = (props: MessagesParams) => {
@@ -97,6 +70,33 @@ const ChatUI = (props: MessagesParams) => {
97
70
  const theme = useTheme();
98
71
  const [messageList, setMessageList] = useState<any>([])
99
72
 
73
+ const ORDER_STATUS: any = {
74
+ 0: t('ORDER_STATUS_PENDING', 'Order status pending'),
75
+ 1: t('ORDERS_COMPLETED', 'Order completed'),
76
+ 2: t('ORDER_REJECTED', 'Order rejected'),
77
+ 3: t('ORDER_STATUS_IN_BUSINESS', 'Order status in business'),
78
+ 4: t('ORDER_READY', 'Order ready'),
79
+ 5: t('ORDER_REJECTED_RESTAURANT', 'Order rejected by restaurant'),
80
+ 6: t('ORDER_STATUS_CANCELLEDBYDRIVER', 'Order status cancelled by driver'),
81
+ 7: t('ORDER_STATUS_ACCEPTEDBYRESTAURANT', 'Order status accepted by restaurant'),
82
+ 8: t('ORDER_CONFIRMED_ACCEPTED_BY_DRIVER', 'Order confirmed accepted by driver'),
83
+ 9: t('ORDER_PICKUP_COMPLETED_BY_DRIVER', 'Order pickup completed by driver'),
84
+ 10: t('ORDER_PICKUP_FAILED_BY_DRIVER', 'Order pickup failed by driver'),
85
+ 11: t('ORDER_DELIVERY_COMPLETED_BY_DRIVER', 'Order delivery completed by driver'),
86
+ 12: t('ORDER_DELIVERY_FAILED_BY_DRIVER', 'Order delivery failed by driver'),
87
+ 13: t('PREORDER', 'Preorder'),
88
+ 14: t('ORDER_NOT_READY', 'Order not ready'),
89
+ 15: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Order picked up completed by customer'),
90
+ 16: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', 'Order status cancelled by customer'),
91
+ 17: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer'),
92
+ 18: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', 'Order driver almost arrived to business'),
93
+ 19: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', 'Order driver almost arrived to customer'),
94
+ 20: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Order customer almost arrived to business'),
95
+ 21: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Order customer arrived to business'),
96
+ 22: t('ORDER_LOOKING_FOR_DRIVER', 'Order looking for driver'),
97
+ 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
98
+ }
99
+
100
100
  const storeMessageList: any = [
101
101
  { key: 'store_message_1', text: t('STORE_MESSAGE_1', 'store_message_1') },
102
102
  { key: 'store_message_2', text: t('STORE_MESSAGE_2', 'store_message_2') },
@@ -377,7 +377,7 @@ const ChatUI = (props: MessagesParams) => {
377
377
  ?
378
378
  `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute) ?
379
379
  `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
380
- `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
380
+ `${message.change.old !== null && ORDER_STATUS[parseInt(message.change.old, 10)]} ${t('TO', 'to')} ${ORDER_STATUS[parseInt(message.change.new, 10)]}`
381
381
  }`
382
382
  : message.change.new
383
383
  ?
@@ -476,8 +476,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
476
476
  style={styles.arrowDistance}
477
477
  />
478
478
  <OText size={12} numberOfLines={3}>{`${(
479
- distancesFromTwoPlacesKm * 3280.84
480
- ).toFixed(0)} ${t('FT', 'Ft')}`}</OText>
479
+ distancesFromTwoPlacesKm
480
+ ).toFixed(2)} ${t('KM', 'KM')}`}</OText>
481
481
  </View>
482
482
  <View style={{ width: '75%', paddingRight: 20 }}>
483
483
  <OText
@@ -179,6 +179,7 @@ const LoginFormUI = (props: LoginParams) => {
179
179
  'An error occurred while trying to pay by PayPal',
180
180
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY:
181
181
  'Error adding product, very far for delivery',
182
+ ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation'
182
183
  };
183
184
 
184
185
  return keyList[key] ? t(key, keyList[key]) : t(key);
@@ -280,7 +280,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
280
280
  }}
281
281
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
282
282
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
283
- imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
283
+ imgRightStyle={{ right: 5, margin: 5 }}
284
284
  onClick={() => handleChangeComment(commentItem) }
285
285
  />
286
286
  ))}
@@ -38,6 +38,8 @@ export const getTraduction = (key: string, t: any) => {
38
38
  ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
39
39
  ERROR_USER_UPDATE_YOU_HAVE_ASSIGNED_ORDERS:
40
40
  "You can't because you have assigned orders",
41
+ ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
42
+ ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation'
41
43
  };
42
44
 
43
45
  return keyList[key] ? t(key, keyList[key]) : t(key);
@@ -527,7 +527,7 @@ export const ProductOptionsUI = (props: any) => {
527
527
  style={styles.slide1}
528
528
  key={i}
529
529
  >
530
- {img.includes('image') ? (
530
+ {String(img).includes('image') ? (
531
531
  <FastImage
532
532
  style={{ height: '100%', opacity: isSoldOut ? 0.5 : 1 }}
533
533
  source={{
@@ -569,7 +569,7 @@ export const ProductOptionsUI = (props: any) => {
569
569
  opacity: index === thumbsSwiper ? 1 : 0.8
570
570
  }}
571
571
  >
572
- {img.includes('image') ? (
572
+ {String(img).includes('image') ? (
573
573
  <OIcon
574
574
  url={img}
575
575
  style={{