Update vote eligibility logic, add MatIconModule, and refine button styles for improved clarity.

This commit is contained in:
akastijn 2025-10-24 22:43:38 +02:00
parent 29967d65b8
commit e0a09d303c
3 changed files with 9 additions and 5 deletions

View File

@ -57,7 +57,9 @@
[href]="voteSites[voteSite]">
<div class=button-outer [class.not-available-button-outer]="!canVote(voteSite)"
[class.available-button-outer]="canVote(voteSite)">
<span class="button-inner">{{ getVoteText(voteSite) }}</span>
<span class="button-inner">
{{ getVoteText(voteSite) }}
</span>
</div>
</a>
</div>

View File

@ -43,9 +43,9 @@
}
.available-button-outer {
background-color: #4caf50 !important;
border: 2px solid #4caf50;
}
.not-available-button-outer {
background-color: var(--white) !important;
border: 2px solid #ffa433;
}

View File

@ -6,13 +6,15 @@ import {SiteService, VoteData} from '@api';
import {AuthService} from '@services/auth.service';
import {interval, Subscription} from 'rxjs';
import {TimeAgoPipe} from '@pipes/TimeAgoPipe';
import {MatIconModule} from '@angular/material/icon';
@Component({
selector: 'app-vote',
standalone: true,
imports: [
HeaderComponent,
TimeAgoPipe
TimeAgoPipe,
MatIconModule,
],
templateUrl: './vote.component.html',
styleUrl: './vote.component.scss'
@ -98,6 +100,6 @@ export class VoteComponent implements OnInit, OnDestroy {
if (!voteInfo) {
return true;
}
return (voteInfo.lastVoteTimestamp - now.getTime() > 86400000)
return (now.getTime() - voteInfo.lastVoteTimestamp < 86400000)
}
}