Commit b48a7c52 authored by Noah Zinsmeister's avatar Noah Zinsmeister

fix: proposal sorting

parent 2eca50be
......@@ -135,6 +135,8 @@ export default function Vote() {
uniBalance && JSBI.notEqual(uniBalance.quotient, JSBI.BigInt(0)) && userDelegatee === ZERO_ADDRESS
)
const maxGovernorIndex = allProposals.reduce((max, p) => Math.max(p.governorIndex, max), 0)
return (
<>
<PageWrapper gap="lg" justify="center">
......@@ -261,7 +263,9 @@ export default function Vote() {
{allProposals?.reverse()?.map((p: ProposalData) => {
return (
<Proposal as={Link} to={`/vote/${p.governorIndex}/${p.id}`} key={`${p.governorIndex}${p.id}`}>
<ProposalNumber>{p.id}</ProposalNumber>
<ProposalNumber>
{maxGovernorIndex - p.governorIndex}.{p.id}
</ProposalNumber>
<ProposalTitle>{p.title}</ProposalTitle>
<ProposalStatus status={p.status}>{ProposalState[p.status]}</ProposalStatus>
</Proposal>
......
......@@ -241,7 +241,7 @@ export function useAllProposalData(): ProposalData[] {
)
}
return results.flat()
return results.reverse().flat()
}
export function useProposalData(governorIndex: number, id: string): ProposalData | undefined {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment