Skip to content

Joinable pools filter#2158

Open
uiuxxx wants to merge 18 commits intomainfrom
feat/joinable-pools
Open

Joinable pools filter#2158
uiuxxx wants to merge 18 commits intomainfrom
feat/joinable-pools

Conversation

@uiuxxx
Copy link
Copy Markdown
Collaborator

@uiuxxx uiuxxx commented Feb 19, 2026

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mono-beets-test-v3 Ready Ready Preview, Comment Apr 9, 2026 0:31am
mono-beets-v3 Ready Ready Preview, Comment Apr 9, 2026 0:31am
mono-frontend-v3 Ready Ready Preview, Comment Apr 9, 2026 0:31am
mono-test-v3 Ready Ready Preview, Comment Apr 9, 2026 0:31am

Request Review

isTokenInWallet={
joinablePools
? tokenAddress => hasWalletTokenBalance(pool.chain, tokenAddress)
: undefined
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be either true or false? what does undefined mean here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having a balance for a token in the wallet defines the highlight styling in the pills
so a function is passed for that purpose
we can't check this in PoolTokenPills itself because it's also used outside of the PoolList context

}),
})

const walletTokenAddressesByChain = useMemo(() => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why do we need the useMemo here. Normally it is used when calculations are expensive (e.g. network calls), but doesn't seem to be the case here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is some looping and formatting done so i think it's ok to keep it

}, [joinablePools, joinableChains, walletBalanceQueries, priceFor])

const joinablePoolsQuery = useReactQuery({
queryKey: [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really want to cache each of these queries?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's caching several apollo queries so why don't do it?

staleTime: 30_000,
})

const joinablePoolsData = useMemo(() => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure we need the useMemo here.

Copy link
Copy Markdown
Collaborator

@groninge01 groninge01 Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is some deduping and sorting done so i think it's ok to keep it

count: joinablePools ? filteredPools.length : data?.count || previousData?.count,
queryState,
loading,
loading: loading || (joinablePools && isJoinableBalanceLoading),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isJoinableBalanceLoading already has joinablePools as conditions, this seems like a duplicate.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

tokens: (PoolToken | ApiToken)[]
chain: GqlChain
iconSize?: number
isTokenInWallet?: IsTokenInWallet
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the idea of passing this function as a parameter here? (having this IsTokenInWallet type looks really strange)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see here

<Badge
key={[token.address, token.chain, i].join('-')}
{...badgeProps}
_after={
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this block seems repeated before, can we abstract this somehow?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const normalizedJoinablePoolsValue = joinablePoolsValue?.toLowerCase()
const joinablePools =
normalizedJoinablePoolsValue !== undefined &&
['true', '1', ''].includes(normalizedJoinablePoolsValue)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't understand this code. What does normalizedJoinablePoolsValue stand for? why can it be so many different kind of values?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to only use joinablePools=true in the url when the filter is active

getRowId,
loadingLength = 20,
paginationStyles,
loadingSpinnerPosition = 'center',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we want the spinner position to be different on PaginatedTable's? shouldn't all of them work in the same way?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants