feat: ajout du composant search a la page home. Retrait de la nav bar pour passer en menu latéral
This commit is contained in:
parent
dee8d9cc6b
commit
1f3ed57c4b
|
|
@ -36,6 +36,7 @@ yarn-error.log
|
|||
/libpeerconnection.log
|
||||
testem.log
|
||||
/typings
|
||||
/environments
|
||||
|
||||
# System files
|
||||
.DS_Store
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<html><app-header [userEmail]="connectedUserEmail()" />
|
||||
<app-header [userEmail]="connectedUserEmail()" />
|
||||
<main>
|
||||
<app-sidebar [userEmail]="connectedUserEmail()">
|
||||
|
||||
</app-sidebar>
|
||||
<router-outlet />
|
||||
</main>
|
||||
</html>
|
||||
|
|
@ -1 +1 @@
|
|||
<p>home works!</p>
|
||||
<app-search/>
|
||||
|
|
@ -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'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3,15 +3,14 @@
|
|||
<img
|
||||
src={{nasaPOTD()?.url}}
|
||||
class="max-w-mid rounded-lg shadow-2xl"
|
||||
alt="{{nasaPOTD()?.explanation}}"
|
||||
/>
|
||||
<div>
|
||||
<h1 class="text-5xl font-bold">{{nasaPOTD()?.title}}</h1>
|
||||
<p class="text-2x2 font-semibold">Copyright: {{nasaPOTD()?.copyright}}</p>
|
||||
<p class="text-2x2 font-semibold">{{nasaPOTD()?.copyright}}</p>
|
||||
<p class="py-6">
|
||||
{{nasaPOTD()?.explanation}}
|
||||
</p>
|
||||
<!-- TODO: button to erase or find a usage -->
|
||||
<!-- <button class="btn btn-primary">Get Started</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
<div class="navbar bg-base-100 shadow-sm" >
|
||||
<div><a class="btn btn-ghost text-xl" routerLink="/home">Home</a></div>
|
||||
<div><a class="btn btn-ghost text-xl" routerLink="/potd">Picture of the day</a></div>
|
||||
<div><a class="btn btn-ghost text-xl" routerLink="/search">Search</a></div>
|
||||
@if(isLoggedIn()){
|
||||
<div><a class="btn btn-ghost text-xl" (click)="logout()">Logout</a></div>
|
||||
}
|
||||
@if(!isLoggedIn()){
|
||||
<div ><a class="btn btn-ghost text-xl" routerLink="/login">Login</a></div>
|
||||
<div ><a class="btn btn-ghost text-xl" routerLink="/register">Register</a></div>
|
||||
}
|
||||
</div>
|
||||
|
|
@ -1 +1,12 @@
|
|||
<p>sidebar works!</p>
|
||||
<div class="menu bg-base-100 shadow-sm" >
|
||||
<div><a class="btn btn-ghost text-xl" routerLink="/home">Home</a></div>
|
||||
<div><a class="btn btn-ghost text-xl" routerLink="/potd">Picture of the day</a></div>
|
||||
<div><a class="btn btn-ghost text-xl" routerLink="/search">Search</a></div>
|
||||
@if(isLoggedIn()){
|
||||
<div><a class="btn btn-ghost text-xl" (click)="logout()">Logout</a></div>
|
||||
}
|
||||
@if(!isLoggedIn()){
|
||||
<div ><a class="btn btn-ghost text-xl" routerLink="/login">Login</a></div>
|
||||
<div ><a class="btn btn-ghost text-xl" routerLink="/register">Register</a></div>
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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<string | null>(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"])
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>TpAngularFinal</title>
|
||||
<title>Nasa youtube clone</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./out-tsc/app",
|
||||
"types": []
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine"
|
||||
|
|
|
|||
Loading…
Reference in New Issue