Skip to content

Commit

Permalink
✨feature: Voting Bar Color Fix (#34)
Browse files Browse the repository at this point in the history
* ✨feature: Voting Bar Color Fix

* 🐞 fix: Lint / Format
  • Loading branch information
Strehk authored Jun 22, 2023
1 parent b6f0917 commit cac4eb6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions chase/frontend/app/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
:root {
--dmun-primary: #3d7dd2;
--dmun-black: #000;
--voting-for: rgb(21 128 61);
--voting-for: #188a42;
--voting-abstain: #3d7dd2;
--voting-against: rgb(220 38 38);
--voting-against: #ff3d32;
}


Expand Down
19 changes: 8 additions & 11 deletions chase/frontend/components/voting/voting_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ export default function VotingBar({
<VotingBarSection
numberOfVotes={countVotes("yes")}
percentage={yesVotesPercentage}
color="green-700"
color="bg-voting-for"
/>
<div className="bg-white h-8 w-px" />
<VotingBarSection
numberOfVotes={countRemainingVotes()}
percentage={remainingVotesPercentage}
color="white"
color="bg-white"
hideCounter
/>
<VotingBarSection
numberOfVotes={countVotes("abstain")}
percentage={abstainVotesPercentage}
color="dmun"
color="bg-voting-abstain"
/>
<div className="bg-white h-8 w-px" />
<VotingBarSection
numberOfVotes={countVotes("no")}
percentage={noVotesPercentage}
color="red-600"
color="bg-voting-against"
/>
<MajorityMarking
majority={majority}
Expand All @@ -93,14 +93,11 @@ function VotingBarSection({
color: string;
hideCounter?: boolean;
}) {
let classNames =
"flex justify-center items-center text-white h-8 transition-all duration-1000 ";
if (color) {
classNames += `bg-${color}`;
}

return (
<div className={classNames} style={{ width: `${percentage}%` }}>
<div
className={`flex justify-center items-center text-white h-8 transition-all duration-1000 ${color}`}
style={{ width: `${percentage}%` }}
>
{!hideCounter && numberOfVotes > 0 && (
<div className="text-sm">{numberOfVotes}</div>
)}
Expand Down
5 changes: 5 additions & 0 deletions chase/frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ module.exports = {
icon: "rgb(156 163 175)",
text: "rgb(75 85 99)",
},
voting: {
for: "#188a42",
against: "#ff3d32",
abstain: "#3d7dd2",
},
},
},
},
Expand Down

0 comments on commit cac4eb6

Please sign in to comment.