From 1f3ed57c4b91958edc6138ff09282ddf7c534cf7 Mon Sep 17 00:00:00 2001 From: maxime Date: Mon, 6 Apr 2026 20:55:57 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20ajout=20du=20composant=20search=20a=20l?= =?UTF-8?q?a=20page=20home.=20Retrait=20de=20la=20nav=20bar=20pour=20passe?= =?UTF-8?q?r=20en=20menu=20lat=C3=A9ral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/app/app.html | 6 ++++-- src/app/pages/home/home.html | 2 +- src/app/pages/home/home.ts | 3 ++- src/app/pages/potd/potd.html | 5 ++--- src/app/shared/header/header.html | 12 ------------ src/app/shared/sidebar/sidebar.html | 13 ++++++++++++- src/app/shared/sidebar/sidebar.ts | 16 +++++++++++++++- src/index.html | 2 +- tsconfig.app.json | 1 + tsconfig.spec.json | 1 + 11 files changed, 40 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 70583d7..7a753b3 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ yarn-error.log /libpeerconnection.log testem.log /typings +/environments # System files .DS_Store diff --git a/src/app/app.html b/src/app/app.html index c7ae0dc..24ff786 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -1,5 +1,7 @@ - +
+ + +
- \ No newline at end of file diff --git a/src/app/pages/home/home.html b/src/app/pages/home/home.html index 6e1756e..ff55278 100644 --- a/src/app/pages/home/home.html +++ b/src/app/pages/home/home.html @@ -1 +1 @@ -

home works!

+ \ No newline at end of file diff --git a/src/app/pages/home/home.ts b/src/app/pages/home/home.ts index bd403ec..9a7d89d 100644 --- a/src/app/pages/home/home.ts +++ b/src/app/pages/home/home.ts @@ -1,8 +1,9 @@ import { Component } from '@angular/core'; +import { Search } from "../search/search"; @Component({ selector: 'app-home', - imports: [], + imports: [Search], templateUrl: './home.html', styleUrl: './home.css' }) diff --git a/src/app/pages/potd/potd.html b/src/app/pages/potd/potd.html index 831123d..c349967 100644 --- a/src/app/pages/potd/potd.html +++ b/src/app/pages/potd/potd.html @@ -3,15 +3,14 @@ {{nasaPOTD()?.explanation}}

{{nasaPOTD()?.title}}

-

Copyright: {{nasaPOTD()?.copyright}}

+

{{nasaPOTD()?.copyright}}

{{nasaPOTD()?.explanation}}

- -
diff --git a/src/app/shared/header/header.html b/src/app/shared/header/header.html index 2f7ad64..e69de29 100644 --- a/src/app/shared/header/header.html +++ b/src/app/shared/header/header.html @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/src/app/shared/sidebar/sidebar.html b/src/app/shared/sidebar/sidebar.html index c59e43b..181c0f7 100644 --- a/src/app/shared/sidebar/sidebar.html +++ b/src/app/shared/sidebar/sidebar.html @@ -1 +1,12 @@ -

sidebar works!

+ diff --git a/src/app/shared/sidebar/sidebar.ts b/src/app/shared/sidebar/sidebar.ts index f156eac..066d597 100644 --- a/src/app/shared/sidebar/sidebar.ts +++ b/src/app/shared/sidebar/sidebar.ts @@ -1,4 +1,6 @@ -import { Component } from '@angular/core'; +import { Component, computed, input, signal, Signal } from '@angular/core'; +import { Router, RouterLink } from '@angular/router'; +import { Auth } from '../../services/auth'; @Component({ selector: 'app-sidebar', @@ -7,5 +9,17 @@ import { Component } from '@angular/core'; styleUrl: './sidebar.css' }) export class Sidebar { + userEmail=input(null); + isLoggedIn = computed(()=>this.userEmail() !== null) + currentUserEmail = computed(()=> this.userEmail()); + + constructor(private readonly loginservice: Auth, private readonly router: Router){ + + } + + logout(){ + this.loginservice.logout(); + this.router.navigate(["/login"]) + } } diff --git a/src/index.html b/src/index.html index 65fd1d1..3192fd2 100644 --- a/src/index.html +++ b/src/index.html @@ -2,7 +2,7 @@ - TpAngularFinal + Nasa youtube clone diff --git a/tsconfig.app.json b/tsconfig.app.json index 254a59d..0bd7321 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -3,6 +3,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "rootDir": "./src", "outDir": "./out-tsc/app", "types": [] }, diff --git a/tsconfig.spec.json b/tsconfig.spec.json index f936da6..60636fe 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -3,6 +3,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "rootDir": "./src", "outDir": "./out-tsc/spec", "types": [ "jasmine"