diff --git a/src/app/demo/page.tsx b/src/app/demo/page.tsx index bfec7c4..501faef 100644 --- a/src/app/demo/page.tsx +++ b/src/app/demo/page.tsx @@ -36,7 +36,7 @@ const initialProposals: DemoProposal[] = [ id: 1, title: "Add dark mode to the dashboard", description: "Implement a dark theme option for better nighttime usage", - score: 87, + score: 45, userVote: 0, pendingVote: 0, stage: "ranking", @@ -47,7 +47,7 @@ const initialProposals: DemoProposal[] = [ id: 2, title: "Weekly community calls", description: "Host weekly video calls to discuss proposals and progress", - score: 42, + score: 43, userVote: 0, pendingVote: 0, stage: "ranking", @@ -58,12 +58,12 @@ const initialProposals: DemoProposal[] = [ id: 3, title: "Create a mobile app", description: "Build native iOS and Android apps for on-the-go voting", - score: 103, + score: 44, userVote: 0, pendingVote: 0, - stage: "voting", - yesVotes: 12, - noVotes: 5, + stage: "ranking", + yesVotes: 0, + noVotes: 0, }, ]; @@ -171,7 +171,9 @@ export default function DemoPage() { setProposals(initialProposals); } - const rankingProposals = proposals.filter((p) => p.stage === "ranking"); + const rankingProposals = proposals + .filter((p) => p.stage === "ranking") + .sort((a, b) => b.score - a.score); // Sort by score descending const votingProposals = proposals.filter((p) => p.stage === "voting"); return ( @@ -253,15 +255,20 @@ export default function DemoPage() { - {rankingProposals.map((proposal) => { + {rankingProposals.map((proposal, index) => { const hasPending = proposal.pendingVote !== 0; const hasVoted = proposal.userVote !== 0; const pendingCost = proposal.pendingVote * proposal.pendingVote; const previewScore = proposal.score + proposal.pendingVote; + const rank = index + 1; return ( - +
+ {/* Rank indicator */} +
+ #{rank} +
{/* Up arrow */}