ordering-ui-react-native 0.23.94 → 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.94",
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}