Browse Source

Add in links rather than icon to user profiles

feature/mapper-integration
Quildra 2 years ago
parent
commit
a8f0047f29
  1. 11
      packages/bridge-ui/src/app/components/race-details/race-details.component.html
  2. 43
      packages/bridge-ui/src/app/components/race-details/race-details.component.scss
  3. 10
      packages/bridge-ui/src/app/components/race-details/race-details.component.ts
  4. 9
      packages/bridge-ui/src/app/components/season-standings/season-standings.component.html
  5. 64
      packages/bridge-ui/src/app/components/season-standings/season-standings.component.scss

11
packages/bridge-ui/src/app/components/race-details/race-details.component.html

@ -60,7 +60,14 @@
<!-- Name Column --> <!-- Name Column -->
<ng-container matColumnDef="name"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>Name </th> <th mat-header-cell *matHeaderCellDef>Name </th>
<td mat-cell *matCellDef="let element"> {{getRacerName(element.racer)}} </td> <td mat-cell *matCellDef="let element">
@if(element.racer.user) {
<a class="user-link" [routerLink]="['/user/'+getUserId(element.racer)]">{{getRacerName(element.racer)}}</a>
}
@else {
{{getRacerName(element.racer)}}
}
</td>
</ng-container> </ng-container>
<!-- Weight Column --> <!-- Weight Column -->
@ -72,7 +79,7 @@
<ng-container matColumnDef="ghost"> <ng-container matColumnDef="ghost">
<th mat-header-cell *matHeaderCellDef>Ghost</th> <th mat-header-cell *matHeaderCellDef>Ghost</th>
@if(openToUploads) { @if(openToUploads) {
<td mat-cell *matCellDef="let element"> <button mat-raised-button color="disabled"><mat-icon aria-hidden="false" aria-label="Example home icon" fontIcon="download"></mat-icon> Ghost</button> </td> <td mat-cell *matCellDef="let element"> <button mat-raised-button color="disabled"><mat-icon aria-hidden="false" aria-label="Example home icon" fontIcon="file_download_off"></mat-icon> Ghost</button> </td>
} }
@else { @else {
<td mat-cell *matCellDef="let element"> <button mat-raised-button color="accent" (click)="onClickDownloadGhost(element)"><mat-icon aria-hidden="false" aria-label="Example home icon" fontIcon="download"></mat-icon> Ghost</button> </td> <td mat-cell *matCellDef="let element"> <button mat-raised-button color="accent" (click)="onClickDownloadGhost(element)"><mat-icon aria-hidden="false" aria-label="Example home icon" fontIcon="download"></mat-icon> Ghost</button> </td>

43
packages/bridge-ui/src/app/components/race-details/race-details.component.scss

@ -116,4 +116,47 @@
.mat-column-ghost { .mat-column-ghost {
text-align: center; text-align: center;
}
.small-icon-button {
width: 32px !important;
height: 32px !important;
padding: 0px !important;
display: inline-flex !important;
align-items: center;
justify-content: center;
& > *[role=img] {
width: 24px;
height: 24px;
font-size: 24px;
svg {
width: 24px;
height: 24px;
}
}
.mat-mdc-button-touch-target {
width: 24px !important;
height: 24px !important;
}
}
.inline-row-name {
display: inline;
vertical-align: super;
}
a {
font-weight: 700;
text-decoration: none;
}
a, a:visited, a:hover, a:active {
color: inherit;
}
a:hover { /* mouse over link */
border-bottom: 1px solid;
} }

10
packages/bridge-ui/src/app/components/race-details/race-details.component.ts

@ -1,5 +1,6 @@
import { AfterViewInit, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; import { AfterViewInit, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { MatGridListModule } from '@angular/material/grid-list'; import { MatGridListModule } from '@angular/material/grid-list';
@ -19,6 +20,7 @@ import { ServerSideEventsService } from '../../services/server-side-events.servi
standalone: true, standalone: true,
imports: [ imports: [
CommonModule, CommonModule,
RouterModule,
MatGridListModule, MatGridListModule,
MatIconModule, MatIconModule,
MatTableModule, MatTableModule,
@ -162,6 +164,14 @@ export class RaceDetailsComponent implements AfterViewInit {
return "" return ""
} }
getUserId(racer: any): string {
if( racer != undefined && racer.user != undefined) {
return racer.user.auth0id.replace("auth0|", "");
}
return ""
}
timeToMedal(time: number) { timeToMedal(time: number) {
if( this.race == undefined) { return "" } if( this.race == undefined) { return "" }
if( time < this.race.authorTime ) { return "assets/medal_author.png"; } if( time < this.race.authorTime ) { return "assets/medal_author.png"; }

9
packages/bridge-ui/src/app/components/season-standings/season-standings.component.html

@ -10,16 +10,11 @@
<th mat-header-cell *matHeaderCellDef>Name </th> <th mat-header-cell *matHeaderCellDef>Name </th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
@if(element.racer.user) { @if(element.racer.user) {
<button mat-icon-button class="small-icon-button" [routerLink]="['/user/'+getUserId(element.racer)]"> <a class="user-link" [routerLink]="['/user/'+getUserId(element.racer)]">{{getRacerName(element.racer)}}</a>
<mat-icon>info</mat-icon>
</button>
} }
@else { @else {
<button mat-icon-button class="small-icon-button"> {{getRacerName(element.racer)}}
<mat-icon>mystery</mat-icon>
</button>
} }
{{getRacerName(element.racer)}}
</td> </td>
</ng-container> </ng-container>

64
packages/bridge-ui/src/app/components/season-standings/season-standings.component.scss

@ -1,24 +1,42 @@
.small-icon-button { .small-icon-button {
width: 24px !important; width: 32px !important;
height: 24px !important; height: 32px !important;
padding: 0px !important; padding: 0px !important;
display: inline-flex !important; display: inline-flex !important;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
& > *[role=img] { & > *[role=img] {
width: 16px; width: 24px;
height: 16px; height: 24px;
font-size: 16px; font-size: 24px;
svg { svg {
width: 16px; width: 24px;
height: 16px; height: 24px;
} }
} }
.mat-mdc-button-touch-target { .mat-mdc-button-touch-target {
width: 24px !important; width: 24px !important;
height: 24px !important; height: 24px !important;
} }
} }
.inline-row-name {
display: inline;
vertical-align: super;
}
a {
font-weight: 700;
text-decoration: none;
}
a, a:visited, a:hover, a:active {
color: inherit;
}
a:hover { /* mouse over link */
border-bottom: 1px solid;
}
Loading…
Cancel
Save