ordering-ui-react-native 0.17.15-release → 0.17.16-release

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.17.15-release",
3
+ "version": "0.17.16-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -38,9 +38,12 @@ export const OrderEta = (props: any) => {
38
38
  }
39
39
  _estimatedTime = moment.utc(_delivery).add(totalEta, 'minutes')
40
40
  } else {
41
- _estimatedTime = moment.utc(_delivery).add(order?.eta_time, 'minutes')
41
+ let timesToAdd = 0
42
+ if (order?.delivered_in) timesToAdd += order?.delivered_in
43
+ if (order?.prepared_in) timesToAdd += order?.prepared_in
44
+ const _etaTime = order?.eta_time + timesToAdd
45
+ _estimatedTime = moment.utc(_delivery).add(_etaTime, 'minutes')
42
46
  }
43
- if (order?.delivered_in) { _estimatedTime = moment.utc(_delivery).add(order?.delivered_in, 'minutes')}
44
47
  _estimatedTime = outputFormat ? moment(_estimatedTime).local().format(outputFormat) : parseDate(_estimatedTime, { utc: false })
45
48
  setEstimatedDeliveryTime(_estimatedTime)
46
49
  }
@@ -129,7 +129,7 @@ export const OrderHistory = (props: any) => {
129
129
  <OText
130
130
  size={14}
131
131
  weight='bold'
132
- numberOfLines={message.change?.attribute === 'delivered_in' ? 2 : 1}
132
+ numberOfLines={message.change?.attribute.includes(['delivered_in', 'prepared_in']) ? 2 : 1}
133
133
  ellipsizeMode='tail'
134
134
  >
135
135
  {message.change?.attribute === 'logistic_status'
@@ -140,7 +140,12 @@ export const OrderHistory = (props: any) => {
140
140
  {formatSeconds(parseInt(message.change.new, 10))}
141
141
  </>
142
142
  )
143
- : t(ORDER_STATUS[parseInt(message.change.new, 10)])
143
+ : message.change?.attribute === 'prepared_in' ? (
144
+ <>
145
+ {t('TIME_ADDED_BY_BUSINESS', 'Time added by business')}{'\n'}
146
+ {formatSeconds(parseInt(message.change.new, 10))}
147
+ </>
148
+ ) : t(ORDER_STATUS[parseInt(message.change.new, 10)])
144
149
  }
145
150
  </OText>
146
151
  ) : (