-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: voting list #148
base: main
Are you sure you want to change the base?
feat: voting list #148
Conversation
# Conflicts: # packages/lib/modules/pool/PoolDetail/PoolHeader/PoolMetaBadges.tsx
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/lib/modules/vebal/vote/hidden-hand/hidden-hand.type.ts
Outdated
Show resolved
Hide resolved
const { | ||
data: votingIncentives, | ||
isLoading: votingIncentivesLoading, | ||
error: votingIncentivesError, | ||
} = useHiddenHandVotingIncentives() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any fetching that can be done server-side, e.g to external APIs or our own can be done in the RSC/layout component and passed into providers as inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be fetching data in this component and passing it into providers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<PoolListTokenPills pool={pool} px="sm" py="2" /> | ||
<PoolListTokenPills | ||
chain={pool.chain} | ||
displayTokens={pool.displayTokens} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
displayTokens
are deprecated in the API.
Depending on what we need here, we can probably reuse some helpers from pool.helpers
or we can implement the same logic that the api implements for displayTokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used getPoolDisplayTokens
@@ -45,11 +45,13 @@ export function PoolListTableRow({ pool, keyValue, ...rest }: Props) { | |||
</GridItem> | |||
<GridItem> | |||
<PoolListTokenPills | |||
chain={pool.chain} | |||
displayTokens={pool.displayTokens} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
displayTokens
is deprecated.
@@ -45,11 +45,13 @@ export function PoolListTableRow({ pool, keyValue, ...rest }: Props) { | |||
</GridItem> | |||
<GridItem> | |||
<PoolListTokenPills | |||
chain={pool.chain} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you replaced pool={pool}
prop to spread its used fields so that you can reuse PoolListTokenPills
component in the voting list.
Instead of spreading the fields: chain, displayTokens, type... into the props I would create a new TS subtype that both the PoolListTableRow and the VotingListRow can satisfy.
For example:
type PoolTokenData = {
chain: GqlChain,
displayTokens: ...
type: ...
}
that way its's easier to understand the purpose of that group of pool fields.
}) | ||
}, [gaugeAddresses, thisWeekTimestamp, nextWeekTimestamp, isConnected, userAddress]) | ||
|
||
const { results, refetchAll, isLoading } = useMulticall(gaugeRequests, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I think that we should try to avoid useMulticall
as much as possible and replace it with useReadContracts
, which offers better TS inference experience and it will be easier to refactor in the future if wagmi changes.
useMulticall
was a workaround at the beginning of the project, but it lacks of good TS experience cause it uses:
.reduce((o, { id, ...rest }) => set(o, id, rest), {})
which is not TS safe.
There are already some examples of complex queries using useReadContracts
in the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# Conflicts: # packages/lib/modules/pool/PoolList/PoolListTable/PoolListTableRow.tsx
# Conflicts: # apps/beets-frontend-v3/app/(app)/pools/[chain]/[variant]/[id]/layout.tsx # apps/beets-frontend-v3/app/(app)/portfolio/[chain]/page.tsx # apps/frontend-v3/app/(app)/pools/[chain]/[variant]/[id]/layout.tsx # apps/frontend-v3/app/(app)/portfolio/[chain]/page.tsx # packages/lib/config/networks/mainnet.ts # packages/lib/modules/pool/PoolDetail/PoolMyLiquidity.tsx # packages/lib/modules/pool/PoolList/PoolListTable/PoolListTableRow.tsx # packages/lib/modules/pool/PoolList/PoolListTokenPills.tsx # packages/lib/modules/pool/PoolName.tsx # packages/lib/modules/pool/pool.utils.ts # packages/lib/modules/portfolio/PortfolioTable/PortfolioTableRow.tsx # packages/lib/modules/tokens/TokenRow/TokenRow.tsx # packages/lib/shared/services/api/pools.graphql
Hi, it's looking good. Some notes here: |
thanks @uiuxxx will fix it in sep pr |
This pr adds vebal voting list