Skip to content

Commit

Permalink
Merge pull request #325 from comdex-official/ui-updates
Browse files Browse the repository at this point in the history
Added color for empty highcharts in govern vote.
  • Loading branch information
dheerajkd30 authored Nov 21, 2022
2 parents dd707ae + 2a47457 commit 777ac08
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
11 changes: 6 additions & 5 deletions src/containers/More/Govern/Details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const GovernDetails = ({
if (currentProposalId) {
fetchSpecificProposal(currentProposalId)
}
}, [voteCount])
}, [currentProposalId, voteCount])

useEffect(() => {
if (currentProposalId && address) {
Expand Down Expand Up @@ -91,10 +91,10 @@ const GovernDetails = ({
let abstain = Number(value?.abstain);
let totalValue = yes + no + abstain + veto;

yes = Number((yes / totalValue) * 100).toFixed(2)
no = Number((no / totalValue) * 100).toFixed(2)
veto = Number((veto / totalValue) * 100).toFixed(2)
abstain = Number((abstain / totalValue) * 100).toFixed(2)
yes = Number(((yes / totalValue) * 100) || 0).toFixed(2)
no = Number(((no / totalValue) * 100) || 0).toFixed(2)
veto = Number(((veto / totalValue) * 100) || 0).toFixed(2)
abstain = Number(((abstain / totalValue) * 100) || 0).toFixed(2)
setGetVotes({
...getVotes,
yes: yes,
Expand Down Expand Up @@ -171,6 +171,7 @@ const GovernDetails = ({
size: "120%",
innerSize: "75%",
borderWidth: 0,
className: "totalvalue-chart",
dataLabels: {
enabled: false,
distance: -14,
Expand Down
5 changes: 5 additions & 0 deletions src/containers/More/Govern/Details/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
@media only screen and (max-width: 550px) {
flex-direction: column;
}
.totalvalue-chart {
.highcharts-empty-series {
fill: #c0c0c0;
}
}
.govern-dlt-chart {
width: 40%;
}
Expand Down
6 changes: 3 additions & 3 deletions src/containers/More/Govern/VoteNowModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const VoteNowModal = ({
setLoading(true)
if (address) {
if (userVote) {
transactionForVote(address,currentProposalId, userVote, (error, result) => {
transactionForVote(address, currentProposalId, userVote, (error, result) => {
if (error) {
message.error(error?.rawLog || "Transaction Failed")
setLoading(false)
Expand Down Expand Up @@ -67,7 +67,7 @@ const VoteNowModal = ({
return (
<>
<div>
<Button type="primary" className="btn-filled mb-n4" onClick={showModal} loading={loading} disabled={currentProposal?.status !== "open"} >Vote Now</Button>
<Button type="primary" className="btn-filled mb-n4" onClick={showModal} disabled={currentProposal?.status !== "open"} >Vote Now</Button>
</div>
<Modal
centered={true}
Expand Down Expand Up @@ -104,7 +104,7 @@ const VoteNowModal = ({
<Button type="primary" className="px-5 mr-3" size="large" onClick={handleCancel} disabled={loading}>
Cancel
</Button>
<Button type="primary" className="btn-filled px-5" size="large" onClick={handleOk} loading={loading} >
<Button type="primary" className="btn-filled px-5" size="large" onClick={handleOk} loading={loading} disabled={loading} >
Confirm
</Button>
</Col>
Expand Down
3 changes: 0 additions & 3 deletions src/containers/More/Locker/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ const Create = ({
<div className="voting-title">Your voting power will be:</div>
<div className="value-main-container">
<div className="harbor-value">{veHarbor} veHARBOR</div>
<div className="harbor-locked-value">

</div>
</div>
</div>
<div className="assets-poolSelect-btn">
Expand Down

0 comments on commit 777ac08

Please sign in to comment.