Skip to content

Commit

Permalink
Change useMatchBid to be regular function
Browse files Browse the repository at this point in the history
  • Loading branch information
b-tarczynski committed Apr 18, 2024
1 parent 58bb974 commit 4fbaa8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/components/bids/allBids/AllBidsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getFirstRaffleBidIndex } from '@/utils/getFirstRaffleBidIndex'
import { useBids } from '@/providers/BidsProvider'
import { NothingFound } from '@/components/bids/allBids/NothingFound'
import { BidsListHeaders } from '@/components/bids/BidsListHeaders'
import { useMatchBid } from '@/components/bids/allBids/useMatchBid'
import { matchesBidFn } from '@/components/bids/allBids/matchesBidFn'
import { BidsSubList } from '@/components/bids/allBids/BidsSubList'

interface AllBidsListProps {
Expand All @@ -14,8 +14,8 @@ interface AllBidsListProps {

export const AllBidsList = ({ search, auctionWinnersCount, raffleWinnersCount }: AllBidsListProps) => {
const { bidList } = useBids()
const matchesSearch = useMatchBid(search)

const matchesSearch = matchesBidFn(search)
const firstRaffleBidIndex = getFirstRaffleBidIndex(bidList.length, auctionWinnersCount, raffleWinnersCount)

const bids = useMemo(() => {
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/components/bids/allBids/matchesBidFn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Bid } from '@/types/bid'

export const matchesBidFn = (value: string) => {
return (bid: Bid) => (value ? bid.address.toLowerCase().includes(value.toLowerCase()) : true)
}
5 changes: 0 additions & 5 deletions packages/frontend/src/components/bids/allBids/useMatchBid.ts

This file was deleted.

0 comments on commit 4fbaa8a

Please sign in to comment.