Skip to content

Commit

Permalink
update navbar and claims voting page
Browse files Browse the repository at this point in the history
  • Loading branch information
daxaxelrod committed Dec 16, 2023
1 parent 52224cd commit 46f3e46
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions frontend/src/app/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export default function NavBar() {
<Link to={"/join"}>
<Button type="link">Register</Button>
</Link>
<Link to={"/login"}>
<Button type="link">Login</Button>
</Link>
</Col>
)}
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ export default function ClaimVoteStatus({
strokeWidth?: number;
withRedLine?: boolean;
}) {
let approvals = claim.approvals;
let acceptances = approvals.filter((a: ClaimApproval) => a.approved).length;
let rejections = approvals.filter((a: ClaimApproval) => !a.approved).length;
let percent = (acceptances / (acceptances + rejections)) * 100;
const approvals = claim.approvals;
const acceptances = approvals.filter(
(a: ClaimApproval) => a.approved
).length;
const rejections = approvals.filter(
(a: ClaimApproval) => !a.approved
).length;
const percent = (acceptances / (acceptances + rejections)) * 100;
const rejectionsPercent = (rejections / (acceptances + rejections)) * 100;

return (
<div
Expand All @@ -60,13 +65,15 @@ export default function ClaimVoteStatus({
}}
>
<Progress
percent={parseFloat(percent.toFixed(0))}
success={{ percent: parseFloat(percent.toFixed(0)) }}
percent={parseFloat(rejectionsPercent.toFixed(0))}
strokeWidth={strokeWidth}
status={
percent >= policy.claim_approval_threshold_percentage
? "success"
: "normal"
: "exception"
}
showInfo={false}
/>
{withRedLine && (
<ThresholdBar
Expand Down

0 comments on commit 46f3e46

Please sign in to comment.