Update vote eligibility logic, add MatIconModule, and refine button styles for improved clarity.
This commit is contained in:
parent
29967d65b8
commit
e0a09d303c
|
|
@ -57,7 +57,9 @@
|
||||||
[href]="voteSites[voteSite]">
|
[href]="voteSites[voteSite]">
|
||||||
<div class=button-outer [class.not-available-button-outer]="!canVote(voteSite)"
|
<div class=button-outer [class.not-available-button-outer]="!canVote(voteSite)"
|
||||||
[class.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>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.available-button-outer {
|
.available-button-outer {
|
||||||
background-color: #4caf50 !important;
|
border: 2px solid #4caf50;
|
||||||
}
|
}
|
||||||
|
|
||||||
.not-available-button-outer {
|
.not-available-button-outer {
|
||||||
background-color: var(--white) !important;
|
border: 2px solid #ffa433;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,15 @@ import {SiteService, VoteData} from '@api';
|
||||||
import {AuthService} from '@services/auth.service';
|
import {AuthService} from '@services/auth.service';
|
||||||
import {interval, Subscription} from 'rxjs';
|
import {interval, Subscription} from 'rxjs';
|
||||||
import {TimeAgoPipe} from '@pipes/TimeAgoPipe';
|
import {TimeAgoPipe} from '@pipes/TimeAgoPipe';
|
||||||
|
import {MatIconModule} from '@angular/material/icon';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-vote',
|
selector: 'app-vote',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
TimeAgoPipe
|
TimeAgoPipe,
|
||||||
|
MatIconModule,
|
||||||
],
|
],
|
||||||
templateUrl: './vote.component.html',
|
templateUrl: './vote.component.html',
|
||||||
styleUrl: './vote.component.scss'
|
styleUrl: './vote.component.scss'
|
||||||
|
|
@ -98,6 +100,6 @@ export class VoteComponent implements OnInit, OnDestroy {
|
||||||
if (!voteInfo) {
|
if (!voteInfo) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return (voteInfo.lastVoteTimestamp - now.getTime() > 86400000)
|
return (now.getTime() - voteInfo.lastVoteTimestamp < 86400000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user