From da7e96526c3ed95b395b33bdaee5347ea9837f6f Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Mon, 20 Apr 2020 18:15:30 +0200 Subject: [PATCH] :zap: add component having a couple of configurable links, to navigate between pages --- src/app/app.module.ts | 2 ++ .../two-links/two-links.component.html | 8 +++++++ .../two-links/two-links.component.scss | 0 .../two-links/two-links.component.spec.ts | 24 +++++++++++++++++++ .../two-links/two-links.component.ts | 15 ++++++++++++ 5 files changed, 49 insertions(+) create mode 100644 src/app/ui/navigation/two-links/two-links.component.html create mode 100644 src/app/ui/navigation/two-links/two-links.component.scss create mode 100644 src/app/ui/navigation/two-links/two-links.component.spec.ts create mode 100644 src/app/ui/navigation/two-links/two-links.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e02aa8eb..2d89b6bc 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -57,6 +57,7 @@ import { NavigationComponent } from './ui/navigation/navigation.component'; import { LanguageComponent } from './ui/selector/language/language.component'; import { SelectorComponent } from './ui/selector/selector.component'; import { ThemeSelectorComponent } from './ui/selector/theme-selector/theme-selector.component'; +import { TwoLinksComponent } from './ui/navigation/two-links/two-links.component'; export class MyMissingTranslationHandler implements MissingTranslationHandler { handle(params: MissingTranslationHandlerParams) { @@ -106,6 +107,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { ThemeSelectorComponent, MasterHeadComponent, LanguageComponent, + TwoLinksComponent, ], imports: [ ConfirmDialogModule, diff --git a/src/app/ui/navigation/two-links/two-links.component.html b/src/app/ui/navigation/two-links/two-links.component.html new file mode 100644 index 00000000..fc4bcab1 --- /dev/null +++ b/src/app/ui/navigation/two-links/two-links.component.html @@ -0,0 +1,8 @@ + diff --git a/src/app/ui/navigation/two-links/two-links.component.scss b/src/app/ui/navigation/two-links/two-links.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/ui/navigation/two-links/two-links.component.spec.ts b/src/app/ui/navigation/two-links/two-links.component.spec.ts new file mode 100644 index 00000000..025d3f9b --- /dev/null +++ b/src/app/ui/navigation/two-links/two-links.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TwoLinksComponent } from './two-links.component'; + +describe('TwoLinksComponent', () => { + let component: TwoLinksComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TwoLinksComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TwoLinksComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/ui/navigation/two-links/two-links.component.ts b/src/app/ui/navigation/two-links/two-links.component.ts new file mode 100644 index 00000000..d1cd2051 --- /dev/null +++ b/src/app/ui/navigation/two-links/two-links.component.ts @@ -0,0 +1,15 @@ +import { Component, Input, OnInit } from '@angular/core'; + +@Component({ + selector: 'framadate-two-links', + templateUrl: './two-links.component.html', + styleUrls: ['./two-links.component.scss'], +}) +export class TwoLinksComponent implements OnInit { + @Input() nextRouteConfig; + @Input() previousRouteConfig; + + constructor() {} + + ngOnInit(): void {} +}