Ajout pages fav, list-cat + header

This commit is contained in:
Romain 2022-01-19 13:01:19 +01:00
parent 125d0862b5
commit 1bcd85fc5c
19 changed files with 146 additions and 6 deletions

View File

@ -1,10 +1,15 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { FavorisUserComponent } from './pages/favoris-user/favoris-user.component';
import { HomePageComponent } from './pages/home-page/home-page.component';
import { ListCategoriesComponent } from './pages/list-categories/list-categories.component';
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomePageComponent },
{ path: 'categories', component: ListCategoriesComponent },
{ path: 'favoris', component: FavorisUserComponent },
{ path: 'Deconnexion', redirectTo: 'home'}
];
@NgModule({

View File

@ -1,2 +1,3 @@
<app-search-bar></app-search-bar>
<app-nav-bar></app-nav-bar>
<router-outlet></router-outlet>

View File

@ -15,6 +15,8 @@ import { CardRestoComponent } from './card-resto/card-resto.component';
import { FooterComponent } from './footer/footer.component';
import { HomePageComponent } from './pages/home-page/home-page.component';
import { HttpClientModule } from '@angular/common/http';
import { ListCategoriesComponent } from './pages/list-categories/list-categories.component';
import { FavorisUserComponent } from './pages/favoris-user/favoris-user.component';
@NgModule({
declarations: [
@ -29,7 +31,9 @@ import { HttpClientModule } from '@angular/common/http';
CardCategoryComponent,
CardRestoComponent,
FooterComponent,
HomePageComponent
HomePageComponent,
ListCategoriesComponent,
FavorisUserComponent
],
imports: [
BrowserModule,

View File

@ -1 +1,27 @@
<p>nav-bar works!</p>
<nav class="navbar-expand-lg navbar-light">
<div class="container-fluid">
<button class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNavAltMarkup"
aria-controls="navbarNavAltMarkup"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNavAltMarkup">
<div class="navbar-nav ">
<a routerLink="home" routerLinkActive="active-custom" class="nav-link p-4 ">Accueil</a>
<a routerLink="categories" routerLinkActive="active-custom" class="nav-link p-4">Categories</a>
<a routerLink="favoris" routerLinkActive="active-custom" class="nav-link p-4">Mes favoris</a>
<a routerLink="" routerLinkActive="active-custom" class="nav-link p-4">Deconnexion</a>
</div>
</div>
<div id="image-header">
<img src="assets/images-header/fond.png" alt="fond_header">
</div>
</div>
</nav>

View File

@ -0,0 +1,7 @@
#image-header{
display: flex;
justify-content: center;
margin: auto;
padding-bottom: 5%;
filter: drop-shadow(0 0 0.30rem black);
}

View File

@ -1 +1,8 @@
<p>search-bar works!</p>
<nav class="navbar navbar-light">
<div class="container-fluid">
<img src="assets/images-header/logo.png" alt="logo">
<form style="width: 20%;" class="d-flex">
<input class="form-control me-2" type="search" placeholder="Trouver votre Simpl'eat" aria-label="Search">
</form>
</div>
</nav>

View File

@ -0,0 +1,7 @@
.container-fluid
{
padding-top: 2%;
width : 100%;
margin: auto;
border-bottom: 3px crimson;
}

View File

@ -0,0 +1 @@
<p>favoris-user works!</p>

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FavorisUserComponent } from './favoris-user.component';
describe('FavorisUserComponent', () => {
let component: FavorisUserComponent;
let fixture: ComponentFixture<FavorisUserComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ FavorisUserComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(FavorisUserComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-favoris-user',
templateUrl: './favoris-user.component.html',
styleUrls: ['./favoris-user.component.scss']
})
export class FavorisUserComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View File

@ -1,3 +1,3 @@
<div *ngFor="let category of listCategories">
<app-card-category [categoryData]="category"></app-card-category>
</div>
<app-card-category [categoryData]="category"></app-card-category>
</div>

View File

@ -0,0 +1 @@
category-works!

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ListCategoriesComponent } from './list-categories.component';
describe('ListCategoriesComponent', () => {
let component: ListCategoriesComponent;
let fixture: ComponentFixture<ListCategoriesComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ListCategoriesComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ListCategoriesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,16 @@
import { Component, OnInit } from '@angular/core';
import { ApiBackService } from 'src/app/services/api-back.service';
@Component({
selector: 'app-list-categories',
templateUrl: './list-categories.component.html',
styleUrls: ['./list-categories.component.scss']
})
export class ListCategoriesComponent implements OnInit {
constructor(private apiBackService : ApiBackService) {
}
ngOnInit(): void {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -4,7 +4,7 @@
export const environment = {
production: false,
apiUrl: "http://localhost:8080",
apiUrl: "http://localhost:3000",
};
/*