diff --git a/frontend/src/app/pages/vote/vote.component.html b/frontend/src/app/pages/vote/vote.component.html index 0326b6e..f8b53c1 100644 --- a/frontend/src/app/pages/vote/vote.component.html +++ b/frontend/src/app/pages/vote/vote.component.html @@ -49,7 +49,8 @@ -
+
{{ getVoteText(voteSite) }}
diff --git a/frontend/src/app/pages/vote/vote.component.scss b/frontend/src/app/pages/vote/vote.component.scss index 93c54d4..80bd995 100644 --- a/frontend/src/app/pages/vote/vote.component.scss +++ b/frontend/src/app/pages/vote/vote.component.scss @@ -41,3 +41,11 @@ color: black; text-shadow: none; } + +.available-button-outer { + background-color: #4caf50 !important; +} + +.not-available-button-outer { + background-color: var(--white) !important; +} diff --git a/frontend/src/app/pages/vote/vote.component.ts b/frontend/src/app/pages/vote/vote.component.ts index 5f53681..4e99beb 100644 --- a/frontend/src/app/pages/vote/vote.component.ts +++ b/frontend/src/app/pages/vote/vote.component.ts @@ -88,4 +88,15 @@ export class VoteComponent implements OnInit, OnDestroy { } protected readonly Object = Object; + + canVote(voteSite: string) { + if (!this.voteStats) { + return false; + } + const now: Date = new Date(); + return ( + this.voteStats.allVoteInfo.some(voteInfo => voteInfo.siteName === voteSite + && voteInfo.lastVoteTimestamp - now.getTime() < 86400000) + ) + } }