Skip to content

Commit

Permalink
Add admin-link-button
Browse files Browse the repository at this point in the history
  • Loading branch information
jvyden committed Oct 29, 2023
1 parent 8b99681 commit 462b129
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import { CarouselCycleButtonComponent } from './components/carousel-cycle-button
import { LevelStatisticsComponent } from './components/level-statistics/level-statistics.component';
import { MenuComponent } from './components/menu/menu.component';
import { MenuLinkComponent } from './components/menu-link/menu-link.component';
import { AdminLinkButtonComponent } from './components/admin-link-button/admin-link-button.component';

@NgModule({
declarations: [
Expand Down Expand Up @@ -145,6 +146,7 @@ import { MenuLinkComponent } from './components/menu-link/menu-link.component';
LevelStatisticsComponent,
MenuComponent,
MenuLinkComponent,
AdminLinkButtonComponent,
],
imports: [
BrowserModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="cursor-pointer bg-warning px-5 py-2 rounded-[11px] text-center drop-shadow-lg w-64">
<fa-icon [icon]="faWrench" class="pr-1.5"></fa-icon>
Manage in Admin Panel
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
import {faWrench} from "@fortawesome/free-solid-svg-icons";

@Component({
selector: 'admin-link-button',
templateUrl: './admin-link-button.component.html'
})
export class AdminLinkButtonComponent {

protected readonly faWrench = faWrench;
}
2 changes: 1 addition & 1 deletion src/app/pages/level/level.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
</page-header-block>
<page-header-block *ngIf="ownUser?.role == UserRoles.Admin">
<secondary-button text="Manage" class="flex" [icon]="faWrench" [routerLink]="'/admin/level/' + level?.levelId"></secondary-button>
<admin-link-button [routerLink]="'/admin/level/' + level?.levelId"></admin-link-button>
</page-header-block>

<page-header-block *ngIf="!level">
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/user/user.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</page-header-block>

<page-header-block *ngIf="ownUser?.role == UserRoles.Admin">
<secondary-button text="Manage" class="flex" [icon]="faWrench" [routerLink]="'/admin/user/' + user?.userId"></secondary-button>
<admin-link-button [routerLink]="'/admin/user/' + user?.userId"></admin-link-button>
</page-header-block>

<page-header-block *ngIf="!user">
Expand Down

0 comments on commit 462b129

Please sign in to comment.