From bc56e5bdb67234244dac549dfc032f08df756d78 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 5 Feb 2026 22:34:54 +0000 Subject: [PATCH] Fix demo page voting - use Button components and proper flex layout - Replace raw + {/* Reddit-style vote column */} +
+ - {/* Score display */} -
0 - ? "text-orange-500" - : "text-blue-500" - : hasVoted - ? proposal.userVote > 0 - ? "text-orange-500" - : "text-blue-500" - : "text-foreground" - }`}> - {hasPending ? previewScore : proposal.score} -
+ + {displayScore} + - {/* Downvote button */} - -
- - {/* Proposal content */} -
-

{proposal.title}

-

- {proposal.description} -

- - {/* Progress bar */} -
-
- Progress to voting stage - 0 ? "text-orange-500" : "text-blue-500") : ""}> - {hasPending ? previewScore : proposal.score}/100 - -
-
-
0 - ? "bg-orange-500" - : "bg-blue-500" - : "bg-primary" - }`} - style={{ width: `${hasPending ? previewPercent : progressPercent}%` }} - /> -
-
- - {/* Vote status / pending confirmation */} - {(hasPending || hasVoted) && ( -
- {hasPending ? ( - <> - 0 - ? "border-orange-500/50 text-orange-600 bg-orange-500/10" - : "border-blue-500/50 text-blue-600 bg-blue-500/10" - } - > - {proposal.pendingVote > 0 ? "+" : ""}{proposal.pendingVote} vote = {pendingCost} credits - - - - - ) : hasVoted && ( - 0 - ? "bg-orange-500/20 text-orange-600 border-orange-500/30" - : "bg-blue-500/20 text-blue-600 border-blue-500/30" - } - > - You voted: {proposal.userVote > 0 ? "+" : ""}{proposal.userVote} - - )} -
- )} -
+
- + + {/* Proposal content */} +
+

{proposal.title}

+

+ {proposal.description} +

+ + {/* Progress bar */} +
+
+ Progress to voting stage + + {displayScore}/100 + +
+
+
+
+
+ + {/* Pending vote confirmation */} + {hasPending && ( +
+ 0 + ? "border-orange-500/50 text-orange-600 bg-orange-500/10" + : "border-blue-500/50 text-blue-600 bg-blue-500/10" + } + > + {proposal.pendingVote > 0 ? "+" : ""}{proposal.pendingVote} vote = {pendingCost} credits + + + +
+ )} + + {/* Existing vote indicator */} + {hasVoted && !hasPending && ( +
+ 0 + ? "bg-orange-500/20 text-orange-600" + : "bg-blue-500/20 text-blue-600" + } + > + You voted: {proposal.userVote > 0 ? "+" : ""}{proposal.userVote} + +
+ )} +
+
); })} @@ -468,7 +443,6 @@ export default function DemoPage() { {proposal.description} - {/* Vote bar */}
- {/* Vote buttons */}