Skip to content

Commit

Permalink
Update Multigov changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinoConti committed Feb 25, 2025
1 parent b26508e commit 9c70c91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pages/Multigov/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const statusMap: any = {
defeated: "Failed",
executed: "Executed",
pendingexecution: "Active",
active: "Active",
succeeded: "Passed",
};

Expand All @@ -60,7 +61,7 @@ const Multigov = () => {
if (activeView === "all") return proposals;

const statusMapping = {
active: "pendingexecution",
active: ["active", "pendingexecution"],
passed: "succeeded",
executed: "executed",
failed: "defeated",
Expand All @@ -69,7 +70,7 @@ const Multigov = () => {
};

const targetStatus = statusMapping[activeView as keyof typeof statusMapping];
return proposals.filter(proposal => proposal.status === targetStatus);
return proposals.filter(proposal => targetStatus.includes(proposal.status));
};

const parsedProposals =
Expand All @@ -81,8 +82,8 @@ const Multigov = () => {
}, {});

const proposalName = proposal.metadata?.description?.split("\n")[0].replace(/^# /, "");
const positiveVotes = voteStats?.for + voteStats?.pendingfor;
const negativeVotes = voteStats?.against + voteStats?.pendingagainst;
const positiveVotes = voteStats?.for + voteStats?.pending_for;
const negativeVotes = voteStats?.against + voteStats?.pending_against;

const status = statusMap[proposal.status];

Expand Down Expand Up @@ -220,7 +221,7 @@ const Multigov = () => {
{ label: "Active", value: "active" },
{ label: "Passed", value: "passed" },
{ label: "Executed", value: "executed" },
{ label: "Quorum not met", value: "quorumNotMet" },
// { label: "Quorum not met", value: "quorumNotMet" },
{ label: "Failed", value: "failed" },
{ label: "Cancelled", value: "cancelled" },
]}
Expand Down
6 changes: 6 additions & 0 deletions src/pages/Multigov/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
border-radius: 8px;
background-color: var(--color-plum-600);
}

&.Passed {
background-color: var(--color-lime);
padding: 4px 8px;
border-radius: 8px;
}
}
}

Expand Down

0 comments on commit 9c70c91

Please sign in to comment.