ordering-ui-react-native 0.16.97 → 0.16.99

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.97",
3
+ "version": "0.16.99",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -67,11 +67,11 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
67
67
  shadowColor: '#000',
68
68
  shadowOffset: {
69
69
  width: 0,
70
- height: 1.5,
70
+ height: business?.logo ? 1.5 : 0,
71
71
  },
72
72
  shadowOpacity: 0.21,
73
73
  shadowRadius: 3,
74
- elevation: 7,
74
+ elevation: business?.logo ? 7 : 0,
75
75
  },
76
76
  header: {
77
77
  flexDirection: 'row',
@@ -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
  ?
@@ -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);
@@ -28,7 +28,7 @@ export const OrdersOptionBusinessUI = (props: any) => {
28
28
  }, [businessesList?.businesses])
29
29
 
30
30
  const handleClear = () => {
31
- onSearch({ ...search, option: '' })
31
+ onSearch({ ...search, business: '' })
32
32
  }
33
33
 
34
34
  const handleOpenSelect = () => {
@@ -176,17 +176,17 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
176
176
  slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
177
177
  percentage: 95,
178
178
  },
179
- {
180
- key: 22,
181
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
182
- slug: 'ORDER_LOOKING_FOR_DRIVER',
179
+ {
180
+ key: 22,
181
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
182
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
183
183
  percentage: 35
184
184
  },
185
- {
186
- key: 23,
187
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
188
- slug: 'ORDER_DRIVER_ON_WAY',
189
- percentage: 45
185
+ {
186
+ key: 23,
187
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
188
+ slug: 'ORDER_DRIVER_ON_WAY',
189
+ percentage: 45
190
190
  }
191
191
  ];
192
192
 
@@ -266,15 +266,13 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
266
266
  style={styles.cardButton}
267
267
  activeOpacity={1}>
268
268
  <Card key={order?.id}>
269
- {!!order?.business?.logo && (
270
- <Logo style={styles.logo}>
271
- <OIcon
272
- url={optimizeImage(order?.business?.logo, 'h_300,c_limit')}
273
- style={styles.icon}
274
- />
275
- </Logo>
276
- )}
277
-
269
+ <Logo style={styles.logo}>
270
+ <OIcon
271
+ url={optimizeImage(order?.business?.logo, 'h_300,c_limit')}
272
+ src={!order?.business?.logo && theme?.images?.dummies?.businessLogo}
273
+ style={styles.icon}
274
+ />
275
+ </Logo>
278
276
  <Information>
279
277
  <Header>
280
278
  <OText numberOfLines={1} style={styles.title}>
@@ -181,18 +181,16 @@ export const PreviousOrders = (props: any) => {
181
181
  {allowColumns?.slaBar && (
182
182
  <Timestatus style={{ backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time' ? '#00D27A' : getStatusClassName(getDelayMinutes(order)) === 'at_risk' ? '#FFC700' : getStatusClassName(getDelayMinutes(order)) === 'delayed' ? '#E63757' : '' }} />
183
183
  )}
184
- {
185
- !!order.business?.logo && (
186
- <Logo style={styles.logo}>
187
- <OIcon
188
- url={optimizeImage(
189
- order.business?.logo,
190
- 'h_300,c_limit',
191
- )}
192
- style={styles.icon}
193
- />
194
- </Logo>
195
- )}
184
+ <Logo style={styles.logo}>
185
+ <OIcon
186
+ url={optimizeImage(
187
+ order.business?.logo,
188
+ 'h_300,c_limit',
189
+ )}
190
+ src={!order?.business?.logo && theme?.images?.dummies?.businessLogo}
191
+ style={styles.icon}
192
+ />
193
+ </Logo>
196
194
  <Information>
197
195
  {!!order?.order_group_id && (
198
196
  <OText>
@@ -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);