ordering-ui-react-native 0.23.93 → 0.23.95

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.93",
3
+ "version": "0.23.95",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react'
1
+ import React, { useEffect, useMemo, useState } from 'react'
2
2
  import { useLanguage, BusinessSearchList, useOrder, useUtils, useEvent, showToast, ToastType } from 'ordering-components/native'
3
3
  import { ScrollView, StyleSheet, Dimensions, FlatList } from 'react-native'
4
4
  import { useTheme } from 'styled-components/native'
@@ -164,10 +164,14 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
164
164
  handleChangeTermValue('')
165
165
  }, [isFocused])
166
166
 
167
+ const businessFiltered = useMemo(() => {
168
+ return businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0)
169
+ }, [businessesSearchList.businesses])
170
+
167
171
  return (
168
172
  <>
169
173
  <FlatList
170
- data={businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0)}
174
+ data={businessFiltered}
171
175
  ListFooterComponent={<BusinessSearchFooter
172
176
  businessesSearchList={businessesSearchList}
173
177
  handleCloseFilters={handleCloseFilters}
@@ -129,7 +129,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
129
129
  const [showTitle, setShowTitle] = useState(false)
130
130
 
131
131
  const { order, businessData } = props.order;
132
- const mapValidStatuses = [9, 19, 23, 26]
132
+ const mapValidStatuses = [9, 18, 19, 23, 26]
133
133
  const placeSpotTypes = [3, 4, 5]
134
134
  const directionTypes = [2, 3, 4, 5]
135
135
  const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23, 24, 25, 26]
@@ -474,7 +474,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
474
474
  {activeStatus.includes(order?.status) ? (
475
475
  <>
476
476
  {cateringTypes.includes(order?.delivery_type) ? `${t('CREATED_AT', 'Created at')}: ${parseDate(order?.created_at)}\n` : ''}
477
- {cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}:` : ''} <OrderEta order={order} outputFormat={`YYYY-MM-DD ${configs?.general_hour_format?.value}`} />
477
+ {cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}:` : ''} <OrderEta order={order} outputFormat={`YYYY-MM-DD ${configs?.general_hour_format?.value}`} />
478
478
  </>
479
479
  ) : (
480
480
  parseDate(order?.reporting_data?.at[`status:${order.status}`], { outputFormat: `YYYY-MM-DD ${configs?.general_hour_format?.value}` })