ordering-ui-react-native 0.23.15 → 0.23.17

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.23.15",
3
+ "version": "0.23.17",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -61,9 +61,14 @@ export const OrderItem = React.memo((props: any) => {
61
61
  const styles = StyleSheet.create({
62
62
  cardButton: {
63
63
  flex: 1,
64
- paddingVertical: (isIpad || isTablet) ? 20 : 0,
64
+ paddingVertical: (isIpad || isTablet) ? 20 : 5,
65
65
  marginBottom: IS_PORTRAIT ? 25 : 0,
66
66
  marginLeft: 3,
67
+ backgroundColor: order?.time_status === 'delayed'
68
+ ? theme.colors.danger100
69
+ : order?.time_status === 'at_risk'
70
+ ? theme.colors.warning100
71
+ : theme.colors.primaryContrast
67
72
  },
68
73
  icon: {
69
74
  borderRadius: 7.6,
@@ -239,7 +244,7 @@ export const OrderItem = React.memo((props: any) => {
239
244
  : parseDate(order?.delivery_datetime, { utc: false })}`)}
240
245
  </OText>
241
246
  )}
242
- {((currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && allowColumns?.timer) && (
247
+ {((currentTabSelected === 'pending' || currentTabSelected === 'inProgress' || currentTabSelected === 'active') && allowColumns?.timer) && (
243
248
  <>
244
249
  <OText
245
250
  style={styles.date}
@@ -321,7 +321,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
321
321
  }
322
322
  }))
323
323
  }
324
- }, [dateSelected, JSON.stringify(hoursList), JSON.stringify(datesWhitelist), cateringPreorder, JSON.stringify(business)])
324
+ }, [dateSelected, JSON.stringify(hoursList), JSON.stringify(datesWhitelist), JSON.stringify(business)])
325
325
 
326
326
  useEffect(() => {
327
327
  setLocalMoment(moment, t)
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { useTheme } from 'styled-components/native'
3
3
  import { ScrollView, StyleSheet, View } from 'react-native'
4
- import { useLanguage, useUtils } from 'ordering-components/native'
4
+ import { useLanguage, useUtils, useConfig } from 'ordering-components/native'
5
5
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
6
6
  import { OText, OButton } from '../shared'
7
7
  import { formatSeconds } from '../../utils'
@@ -17,7 +17,9 @@ export const OrderHistory = (props: any) => {
17
17
 
18
18
  const [, t] = useLanguage()
19
19
  const [{ parseDate }] = useUtils()
20
+ const [{ configs }] = useConfig();
20
21
  const theme = useTheme()
22
+ const changeIdToExternalId = configs?.change_order_id?.value === '1'
21
23
 
22
24
  const styles = StyleSheet.create({
23
25
  historyItem: {
@@ -93,7 +95,7 @@ export const OrderHistory = (props: any) => {
93
95
  return (
94
96
  <ScrollView contentContainerStyle={styles.container}>
95
97
  <OText size={20} style={{ alignSelf: 'center', textAlign: 'center' }} mBottom={10}>
96
- {t('DETAILS_OF_ORDER', 'Details of Order_NUMBER_').replace('_NUMBER_', ` # ${order?.id}`)}
98
+ {t('DETAILS_OF_ORDER', 'Details of Order_NUMBER_').replace('_NUMBER_', (changeIdToExternalId && order?.external_id) || `# ${order?.id}`)}
97
99
  </OText>
98
100
  {!messages?.loading && order && (
99
101
  <View style={styles.historyItem}>
@@ -149,6 +149,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
149
149
  const hideDriverMessages = theme?.confirmation?.components?.driver?.components?.messages?.hidden
150
150
  const hideCustomerPhone = theme?.confirmation?.components?.customer?.components?.phone?.hidden
151
151
  const hideCustomerAddress = theme?.confirmation?.components?.customer?.components?.address?.hidden
152
+ const changeIdToExternalId = configs?.change_order_id?.value === '1'
153
+
152
154
  const progressBarObjt = isPickup ? getOrderStatuPickUp : getOrderStatus
153
155
  const walletName: any = {
154
156
  cash: {
@@ -386,7 +388,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
386
388
  numberOfLines={2}
387
389
  ellipsizeMode='tail'
388
390
  >
389
- {`${t('ORDER', 'Order')} #${order?.id}`}
391
+ {`${t('ORDER', 'Order')} ${(changeIdToExternalId && order?.external_id) || `#${order?.id}`}`}
390
392
  </OText>
391
393
  )}
392
394
  </>
@@ -460,7 +462,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
460
462
  <Header>
461
463
  <NavBar
462
464
  hideArrowLeft
463
- title={`${t('ORDER', 'Order')} #${order?.id}`}
465
+ title={`${t('ORDER', 'Order')} ${(changeIdToExternalId && order?.external_id) || `#${order?.id}`}`}
464
466
  titleAlign={'left'}
465
467
  showCall={false}
466
468
  btnStyle={{ paddingLeft: 0 }}
@@ -3,7 +3,8 @@ import {
3
3
  SingleOrderCard as SingleOrderCardController,
4
4
  useUtils,
5
5
  useOrder,
6
- useLanguage
6
+ useLanguage,
7
+ useConfig
7
8
  } from 'ordering-components/native';
8
9
  import FastImage from 'react-native-fast-image'
9
10
  import { StyleSheet, TouchableOpacity, View } from 'react-native';
@@ -45,6 +46,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
45
46
  const [{ parsePrice, optimizeImage, parseDate }] = useUtils();
46
47
  const [, t] = useLanguage();
47
48
  const [{ carts }] = useOrder()
49
+ const [{ configs }] = useConfig()
48
50
  const theme = useTheme();
49
51
  const isFocused = useIsFocused();
50
52
 
@@ -54,6 +56,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
54
56
 
55
57
  const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12, 15];
56
58
  const isGiftCardOrder = !order?.business_id
59
+ const changeIdToExternalId = configs?.change_order_id?.value === '1'
57
60
 
58
61
  const styles = StyleSheet.create({
59
62
  container: {
@@ -333,7 +336,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
333
336
  lineHeight={15}
334
337
  numberOfLines={1}
335
338
  >
336
- {order?.business?.length > 1 ? order?.business?.length : (t('ORDER_NO', 'Order No') + '.')}
339
+ {order?.business?.length > 1 ? order?.business?.length : !(changeIdToExternalId && order?.external_id) && (t('ORDER_NO', 'Order No') + '.')}
337
340
  </OText>
338
341
  <OText
339
342
  size={10}
@@ -342,7 +345,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
342
345
  lineHeight={15}
343
346
  numberOfLines={1}
344
347
  >
345
- {order?.business?.length > 1 ? t('ORDERS', 'orders') + ' \u2022 ' : order.id + ` \u2022 `}
348
+ {order?.business?.length > 1 ? t('ORDERS', 'orders') + ' \u2022 ' : ((changeIdToExternalId && order?.external_id) || order.id) + ` \u2022 `}
346
349
  </OText>
347
350
  </>
348
351
  )}