Skip to content

Commit

Permalink
refacto pages with modules
Browse files Browse the repository at this point in the history
  • Loading branch information
FunixG committed Sep 20, 2023
1 parent 7fb2a94 commit a9ee38d
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 112 deletions.
34 changes: 12 additions & 22 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {CgvComponent} from "./pages/legal/cgv/cgv.component";
import {CguComponent} from "./pages/legal/cgu/cgu.component";
import {AboutComponent} from "./pages/about/about.component";
import {JoinComponent} from "./pages/join/join.component";
import {NewsListPageComponent} from "./pages/news/news-list-page/news-list-page.component";
import {VotePageComponent} from "./pages/vote/vote-page/vote-page.component";
import {AccueilComponent} from "./pages/accueil/accueil.component";

const routes: Routes = [
Expand All @@ -15,39 +9,35 @@ const routes: Routes = [
},
{
path: 'cgv',
component: CgvComponent
loadChildren: () => import('./pages/legal/cgv/cgv.module').then(m => m.CgvModule)
},
{
path: 'cgu',
component: CguComponent
},
{
path: 'about',
component: AboutComponent
loadChildren: () => import('./pages/legal/cgu/cgu.module').then(m => m.CguModule)
},
{
path: 'join',
component: JoinComponent
},
{
path: 'news',
component: NewsListPageComponent
loadChildren: () => import('./pages/join/join.module').then(m => m.JoinModule)
},
{
path: 'vote',
component: VotePageComponent
loadChildren: () => import('./pages/vote/vote.module').then(m => m.VoteModule)
},
{
path: 'shop', loadChildren: () => import('./pages/shop/shop.module').then(m => m.ShopModule)
path: 'shop',
loadChildren: () => import('./pages/shop/shop.module').then(m => m.ShopModule)
},
{
path: 'user', loadChildren: () => import('./pages/user/user.module').then(m => m.UserModule)
path: 'user',
loadChildren: () => import('./pages/user/user.module').then(m => m.UserModule)
},
{
path: 'wiki', loadChildren: () => import('./pages/wiki/wiki.module').then(m => m.WikiModule)
path: 'wiki',
loadChildren: () => import('./pages/wiki/wiki.module').then(m => m.WikiModule)
},
{
path: 'news', loadChildren: () => import('./pages/news/news.module').then(m => m.NewsModule)
path: 'news',
loadChildren: () => import('./pages/news/news.module').then(m => m.NewsModule)
},
{
path: '**',
Expand Down
15 changes: 1 addition & 14 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import {AppComponent} from './app.component';
import {NavbarComponent} from './components/navbar/navbar.component';
import {FooterComponent} from './components/footer/footer.component';
import {FontAwesomeModule} from "@fortawesome/angular-fontawesome";
import {CguComponent} from './pages/legal/cgu/cgu.component';
import {CgvComponent} from './pages/legal/cgv/cgv.component';
import {AboutComponent} from './pages/about/about.component';
import {JoinComponent} from './pages/join/join.component';
import {VotePageComponent} from './pages/vote/vote-page/vote-page.component';
import {HttpClientModule} from "@angular/common/http";
import {NgForOf, NgIf, NgOptimizedImage} from "@angular/common";
import {NewsModule} from "./pages/news/news.module";
Expand All @@ -35,17 +30,10 @@ import {AboutAccueilSectionComponent} from "./pages/accueil/components/about/abo

AccueilComponent,
WelcomeAccueilSectionComponent,
AboutComponent,
AboutDetailsAccueilSectionComponent,
NewsAccueilSectionComponent,
SocialsAccueilSectionComponent,
StaffAccueilSectionComponent,

CguComponent,
CgvComponent,
AboutComponent,
JoinComponent,
VotePageComponent,
AboutAccueilSectionComponent
],
imports: [
Expand All @@ -64,8 +52,7 @@ import {AboutAccueilSectionComponent} from "./pages/accueil/components/about/abo
provideClientHydration()
],
exports: [
NotificationComponent,
AboutComponent
NotificationComponent
],
bootstrap: [AppComponent]
})
Expand Down
5 changes: 0 additions & 5 deletions src/app/pages/about/about.component.html

This file was deleted.

23 changes: 0 additions & 23 deletions src/app/pages/about/about.component.spec.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/app/pages/about/about.component.ts

This file was deleted.

16 changes: 16 additions & 0 deletions src/app/pages/join/join-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {JoinComponent} from "./join.component";

const routes: Routes = [
{
path: '',
component: JoinComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class JoinRoutingModule { }
16 changes: 16 additions & 0 deletions src/app/pages/join/join.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {JoinComponent} from "./join.component";
import {JoinRoutingModule} from "./join-routing.module";


@NgModule({
declarations: [
JoinComponent
],
imports: [
CommonModule,
JoinRoutingModule
]
})
export class JoinModule { }
16 changes: 16 additions & 0 deletions src/app/pages/legal/cgu/cgu-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {CguComponent} from "./cgu.component";

const routes: Routes = [
{
path: '',
component: CguComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class CguRoutingModule { }
16 changes: 16 additions & 0 deletions src/app/pages/legal/cgu/cgu.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {CguComponent} from "./cgu.component";
import {CguRoutingModule} from "./cgu-routing.module";


@NgModule({
declarations: [
CguComponent
],
imports: [
CommonModule,
CguRoutingModule
]
})
export class CguModule { }
16 changes: 16 additions & 0 deletions src/app/pages/legal/cgv/cgv-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {CgvComponent} from "./cgv.component";

const routes: Routes = [
{
path: '',
component: CgvComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class CgvRoutingModule { }
5 changes: 3 additions & 2 deletions src/app/pages/legal/cgv/cgv.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {Title} from "@angular/platform-browser";

@Component({
Expand All @@ -13,6 +13,7 @@ export class CgvComponent {

if (!title.startsWith("CGV")) {
titleService.setTitle('CGV - ' + title);
} }
}
}

}
16 changes: 16 additions & 0 deletions src/app/pages/legal/cgv/cgv.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {CgvComponent} from "./cgv.component";
import {CgvRoutingModule} from "./cgv-routing.module";


@NgModule({
declarations: [
CgvComponent
],
imports: [
CommonModule,
CgvRoutingModule
]
})
export class CgvModule { }
Empty file.
23 changes: 0 additions & 23 deletions src/app/pages/vote/vote-page/vote-page.component.spec.ts

This file was deleted.

16 changes: 16 additions & 0 deletions src/app/pages/vote/vote-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {VoteComponent} from "./vote.component";

const routes: Routes = [
{
path: '',
component: VoteComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class VoteRoutingModule { }
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions src/app/pages/vote/vote.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';

import {VoteComponent} from './vote.component';

describe('VotePageComponent', () => {
let component: VoteComponent;
let fixture: ComponentFixture<VoteComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ VoteComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(VoteComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {Title} from "@angular/platform-browser";

@Component({
selector: 'app-vote-page',
templateUrl: './vote-page.component.html',
styleUrls: ['./vote-page.component.scss']
templateUrl: './vote.component.html',
styleUrls: ['./vote.component.scss']
})
export class VotePageComponent {
export class VoteComponent {

constructor(private titleService: Title) {
const title: string = titleService.getTitle();
Expand Down
16 changes: 16 additions & 0 deletions src/app/pages/vote/vote.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {VoteComponent} from "./vote.component";
import {VoteRoutingModule} from "./vote-routing.module";


@NgModule({
declarations: [
VoteComponent
],
imports: [
CommonModule,
VoteRoutingModule
]
})
export class VoteModule { }

0 comments on commit a9ee38d

Please sign in to comment.