ordering-ui-react-native 0.15.19 → 0.15.20

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.15.19",
3
+ "version": "0.15.20",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -631,6 +631,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
631
631
  getOrderStatus={getOrderStatus}
632
632
  handleClickOrder={handleClickOrder}
633
633
  slaSettingTime={slaSettingTime}
634
+ currentTabSelected={currentTabSelected}
634
635
  />
635
636
  )}
636
637
  {!logisticOrders?.error?.length &&
@@ -17,7 +17,8 @@ export const PreviousOrders = (props: any) => {
17
17
  handleClickOrder,
18
18
  isLogisticOrder,
19
19
  handleClickLogisticOrder,
20
- slaSettingTime
20
+ slaSettingTime,
21
+ currentTabSelected
21
22
  } = props;
22
23
  const [, t] = useLanguage();
23
24
  const [{ parseDate, optimizeImage }] = useUtils();
@@ -159,7 +160,7 @@ export const PreviousOrders = (props: any) => {
159
160
  />
160
161
  </NotificationIcon>
161
162
  )}
162
- <View style={{ flexDirection: 'row' }}>
163
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
163
164
  <OText
164
165
  style={styles.date}
165
166
  color={theme.colors.unselectText}
@@ -169,9 +170,14 @@ export const PreviousOrders = (props: any) => {
169
170
  {(order?.order_group_id && order?.order_group && isLogisticOrder ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}` : (t('NO', 'Order No.') + order.id)) + ' · '}
170
171
  {order?.delivery_datetime_utc
171
172
  ? parseDate(order?.delivery_datetime_utc, { outputFormat: 'MM/DD/YY · HH:mm a' })
172
- : parseDate(order?.delivery_datetime, { utc: false })}{' · '}
173
+ : parseDate(order?.delivery_datetime, { utc: false })}
173
174
  </OText>
174
- <OText style={styles.date} color={order?.time_status === 'in_time' ? '#00D27A' : order?.time_status === 'at_risk' ? '#FFC700' : order?.time_status === 'delayed' ? '#E63757' : ''} >{getDelayTime(order)}</OText>
175
+ {(currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && (
176
+ <>
177
+ <OText> · </OText>
178
+ <OText style={styles.date} color={order?.time_status === 'in_time' ? '#00D27A' : order?.time_status === 'at_risk' ? '#FFC700' : order?.time_status === 'delayed' ? '#E63757' : ''} >{getDelayTime(order)}</OText>
179
+ </>
180
+ )}
175
181
  </View>
176
182
  {!isLogisticOrder && (
177
183
  <MyOrderOptions>
@@ -1,4 +1,4 @@
1
- import React, { Mixin } from 'react'
1
+ import React from 'react'
2
2
  import { useLanguage } from 'ordering-components/native'
3
3
  import { SingleProductCard } from '../SingleProductCard'
4
4
  import { TaxInformationContainer, ProductContainer } from './styles'
@@ -9,7 +9,7 @@ interface taxInformationParams {
9
9
  name: string,
10
10
  description?: string,
11
11
  rate: string | number,
12
- type: number,
12
+ type: string | number,
13
13
  fixed?: number,
14
14
  percentage?: number,
15
15
  id: number,
@@ -29,6 +29,10 @@ export const TaxInformation = (props: taxInformationParams) => {
29
29
  const [, t] = useLanguage()
30
30
 
31
31
  const includedOnPriceString = data?.type === 1 ? `(${t('INCLUDED_ON_PRICE', 'Included on price')})` : `(${t('NOT_INCLUDED_ON_PRICE', 'Not included on price')})`
32
+ const offersHideArray = ['offer_target_2', 'offer_target_3']
33
+ const hideProductsSectionOffers = offersHideArray.includes(type)
34
+ const dataHideArray : Array<string | number> = ['platform', 'business']
35
+ const hideProductsSectionData = dataHideArray.includes(data.type)
32
36
 
33
37
  const getFilterValidation = (product: any) => {
34
38
  return (
@@ -61,7 +65,7 @@ export const TaxInformation = (props: taxInformationParams) => {
61
65
  {t('WITHOUT_DESCRIPTION', 'Without description')}
62
66
  </OText>
63
67
  )}
64
- {!(type === 'offer_target_2' || type === 'offer_target_3') && (
68
+ {!hideProductsSectionOffers && !hideProductsSectionData && (
65
69
  <>
66
70
  <OText>{t('OTHER_PRODUCTS_WITH_THIS', 'Other products with this')} {getTypeString()}:</OText>
67
71
  <ProductContainer>