Skip to content

Commit

Permalink
fix navbar component
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmostafa committed Jan 29, 2025
1 parent 30ee81b commit 758045c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions web/src/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="#">ResDEEDS</a>
<button class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a *ngIf="!authService.isAuthenticated()" class="nav-link" href="/login">Login</a>
<a *ngIf="!authService.isAuthenticated()" class="nav-link" routerLink="/login">Login</a>
</li>
<li class="nav-item">
<a *ngIf="!authService.isAuthenticated()" class="nav-link" href="/signup">Sign Up</a>
<a *ngIf="!authService.isAuthenticated()" class="nav-link" routerLink="/signup">Sign Up</a>
</li>
<li class="nav-item">
<a *ngIf="authService.isAuthenticated()" class="nav-link" href="/hello-world">Dashboard</a>
<a *ngIf="authService.isAuthenticated()" class="nav-link" routerLink="/hello-world">Dashboard</a>
</li>
<li class="nav-item">
<a *ngIf="authService.isAuthenticated()" class="nav-link" (click)="logout()">Logout</a>
Expand Down
3 changes: 2 additions & 1 deletion web/src/app/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Component, inject } from '@angular/core';
import { AuthService } from '../services/auth.service';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

@Component({
selector: 'app-navbar',
standalone: true,
imports: [CommonModule],
imports: [CommonModule, RouterModule],
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css']
})
Expand Down

0 comments on commit 758045c

Please sign in to comment.