Skip to content

Commit

Permalink
Show score in level statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
jvyden committed Nov 9, 2023
1 parent 5a31ad2 commit 2e3b2fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/app/api/types/level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export interface Level {
publisher: User
teamPicked: boolean
gameVersion: number
score: number
}
36 changes: 20 additions & 16 deletions src/app/components/level-statistics/level-statistics.component.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<div class="flex gap-2 cursor-default" *ngIf="level">
<div title="Yays">
<fa-icon [icon]="faThumbsUp"></fa-icon>
{{level.yayRatings}}
</div>
<div title="Boos">
<fa-icon [icon]="faThumbsDown"></fa-icon>
{{level.booRatings}}
</div>
<div title="Hearts">
<fa-icon [icon]="faHeart"></fa-icon>
{{level.hearts}}
</div>
<div title="Unique Plays">
<fa-icon [icon]="faPlay"></fa-icon>
{{level.uniquePlays}}
</div>
<div title="Yays">
<fa-icon [icon]="faThumbsUp"></fa-icon>
{{level.yayRatings}}
</div>
<div title="Boos">
<fa-icon [icon]="faThumbsDown"></fa-icon>
{{level.booRatings}}
</div>
<div title="Hearts">
<fa-icon [icon]="faHeart"></fa-icon>
{{level.hearts}}
</div>
<div title="Unique Plays">
<fa-icon [icon]="faPlay"></fa-icon>
{{level.uniquePlays}}
</div>
<div title="Cool Rating (CR)">
<fa-icon [icon]="faStar"></fa-icon>
{{level.score | number:'1.0-1'}}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, Input} from '@angular/core';
import {faHeart, faPlay, faThumbsDown, faThumbsUp} from "@fortawesome/free-solid-svg-icons";
import {faHeart, faPlay, faStar, faThumbsDown, faThumbsUp} from "@fortawesome/free-solid-svg-icons";
import {Level} from "../../api/types/level";

@Component({
Expand All @@ -13,4 +13,5 @@ export class LevelStatisticsComponent {
protected readonly faPlay = faPlay;
protected readonly faThumbsUp = faThumbsUp;
protected readonly faThumbsDown = faThumbsDown;
protected readonly faStar = faStar;
}

0 comments on commit 2e3b2fa

Please sign in to comment.