Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions src/components/VoteOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { VoteChoiceWithMeta } from "@/lib/types";
import { cn, ellipsisMiddle } from "@/lib/utils";
import BN from "bn.js";
import React, { FC } from "react";
import { FaCircle, FaCircleCheck } from "react-icons/fa6";
import { FaCircleCheck } from "react-icons/fa6";
import { Loader2 } from "lucide-react";
import { PublicKey } from "@solana/web3.js";
import { Pill } from "./Pill";
Expand Down Expand Up @@ -46,9 +46,28 @@ export const VoteOption: FC<{
<div className="flex flex-row gap-2 items-center">
{voting ? (
<Loader2 className="size-5 animate-spin" />
) : !didVote ? (
<div
className={cn("size-5 rounded-full border-2", {
"border-vote-0": option.index === 0,
"border-vote-1": option.index === 1,
"border-vote-2": option.index === 2,
"border-vote-3": option.index === 3,
"border-vote-4": option.index === 4,
"border-vote-5": option.index === 5,
"border-vote-6": option.index === 6,
"border-vote-7": option.index === 7,
"border-vote-8": option.index === 8,
"border-vote-9": option.index === 9,
"border-vote-10": option.index === 10,
"border-vote-11": option.index === 11,
"border-vote-12": option.index === 12,
"border-vote-13": option.index === 13,
})}
/>
) : (
<FaCircle
className={cn("size-5 border rounded-full", {
<FaCircleCheck
className={cn("size-5", {
"fill-vote-0": option.index === 0,
"fill-vote-1": option.index === 1,
"fill-vote-2": option.index === 2,
Expand All @@ -67,7 +86,6 @@ export const VoteOption: FC<{
/>
)}
<p className="font-normal flex-grow">{option.name}</p>
{didVote && <FaCircleCheck className="size-5 fill-success-foreground" />}
</div>

{voters.length > 0 && (
Expand Down