ordering-ui-react-native 0.22.26 → 0.22.27

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.22.26",
3
+ "version": "0.22.27",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -47,6 +47,7 @@ export const OrderItem = React.memo((props: any) => {
47
47
  timer: configState?.configs?.order_deadlines_enabled?.value === '1',
48
48
  slaBar: configState?.configs?.order_deadlines_enabled?.value === '1',
49
49
  })
50
+ const showExternalId = configState?.configs?.change_order_id?.value === '1'
50
51
 
51
52
  const IS_PORTRAIT = orientationState.orientation === PORTRAIT
52
53
  const platformIOS = Platform as PlatformIOSStatic
@@ -76,7 +77,7 @@ export const OrderItem = React.memo((props: any) => {
76
77
  marginLeft: 3,
77
78
  },
78
79
  title: {
79
- marginBottom: 6,
80
+ marginBottom: showExternalId ? 0 : 6,
80
81
  fontFamily: 'Poppins',
81
82
  fontStyle: 'normal',
82
83
  fontWeight: '600',
@@ -84,7 +85,7 @@ export const OrderItem = React.memo((props: any) => {
84
85
  color: theme.colors.textGray,
85
86
  },
86
87
  date: {
87
- marginBottom: 6,
88
+ marginBottom: showExternalId ? 0 : 6,
88
89
  fontFamily: 'Poppins',
89
90
  fontStyle: 'normal',
90
91
  fontWeight: 'normal',
@@ -179,17 +180,27 @@ export const OrderItem = React.memo((props: any) => {
179
180
  />
180
181
  </NotificationIcon>
181
182
  )}
182
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
183
+ <View style={{ flexDirection: `${showExternalId ? 'column' : 'row'}`, flexWrap: 'wrap' }}>
184
+ {!order?.order_group_id && showExternalId && !order?.order_group && (
185
+ <OText
186
+ style={styles.date}
187
+ color={theme.colors.unselectText}
188
+ numberOfLines={1}
189
+ adjustsFontSizeToFit
190
+ >
191
+ {order?.external_id ?? t('NO_EXTERNAL_ID', 'No external Id ') + t('NO', 'Order No.') + order?.id}
192
+ </OText>
193
+ )}
183
194
  <OText
184
195
  style={styles.date}
185
196
  color={theme.colors.unselectText}
186
197
  numberOfLines={1}
187
198
  adjustsFontSizeToFit
188
199
  >
189
- {(!!order?.order_group_id && order?.order_group && isLogisticOrder
200
+ {(!showExternalId && ((!!order?.order_group_id && order?.order_group && isLogisticOrder
190
201
  ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
191
- : (t('NO', 'Order No.') + order.id)
192
- ) + ' · '}
202
+ : (t('NO', 'Order No.') + order?.id)
203
+ ) + ' · '))}
193
204
  {order?.delivery_datetime_utc
194
205
  ? parseDate(order?.delivery_datetime_utc)
195
206
  : parseDate(order?.delivery_datetime, { utc: false })}