Browse Source

feat: Change About module to Map

master
Konstantinos Kamaropoulos 5 years ago
parent
commit
a1d4b30c69
  1. 12
      src/app/about/about.module.ts
  2. 2
      src/app/app-routing.module.ts
  3. 6
      src/app/map/map-routing.module.ts
  4. 0
      src/app/map/map.component.html
  5. 4
      src/app/map/map.component.scss
  6. 12
      src/app/map/map.component.spec.ts
  7. 8
      src/app/map/map.component.ts
  8. 12
      src/app/map/map.module.ts
  9. 14
      src/app/shell/header/header.component.html

12
src/app/about/about.module.ts

@ -1,12 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { AboutRoutingModule } from './about-routing.module';
import { AboutComponent } from './about.component';
@NgModule({
imports: [CommonModule, TranslateModule, AboutRoutingModule],
declarations: [AboutComponent]
})
export class AboutModule {}

2
src/app/app-routing.module.ts

@ -3,7 +3,7 @@ import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { Shell } from '@app/shell/shell.service';
const routes: Routes = [
Shell.childRoutes([{ path: 'about', loadChildren: './about/about.module#AboutModule' }]),
Shell.childRoutes([{ path: 'map', loadChildren: './map/map.module#MapModule' }]),
// Fallback when no prior route is matched
{ path: '**', redirectTo: '', pathMatch: 'full' }
];

6
src/app/about/about-routing.module.ts → src/app/map/map-routing.module.ts

@ -2,11 +2,11 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { extract } from '@app/core';
import { AboutComponent } from './about.component';
import { MapComponent } from './map.component';
const routes: Routes = [
// Module is lazy loaded, see app-routing.module.ts
{ path: '', component: AboutComponent, data: { title: extract('About') } }
{ path: '', component: MapComponent, data: { title: extract('Map') } }
];
@NgModule({
@ -14,4 +14,4 @@ const routes: Routes = [
exports: [RouterModule],
providers: []
})
export class AboutRoutingModule {}
export class MapRoutingModule {}

0
src/app/about/about.component.html → src/app/map/map.component.html

4
src/app/about/about.component.scss → src/app/map/map.component.scss

@ -6,3 +6,7 @@
.mapDiv {
text-align: left;
}
.mapboxgl-marker {
cursor: pointer;
}

12
src/app/about/about.component.spec.ts → src/app/map/map.component.spec.ts

@ -1,19 +1,19 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AboutComponent } from './about.component';
import { MapComponent } from './map.component';
describe('AboutComponent', () => {
let component: AboutComponent;
let fixture: ComponentFixture<AboutComponent>;
describe('MapComponent', () => {
let component: MapComponent;
let fixture: ComponentFixture<MapComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AboutComponent]
declarations: [MapComponent]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AboutComponent);
fixture = TestBed.createComponent(MapComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

8
src/app/about/about.component.ts → src/app/map/map.component.ts

@ -8,11 +8,11 @@ import { LogsService } from '@app/logs.service';
import { interval } from 'rxjs';
@Component({
selector: 'app-about',
templateUrl: './about.component.html',
styleUrls: ['./about.component.scss']
selector: 'app-map',
templateUrl: './map.component.html',
styleUrls: ['./map.component.scss']
})
export class AboutComponent implements OnInit {
export class MapComponent implements OnInit {
version: string | null = environment.version;
// data: Array<Object>;

12
src/app/map/map.module.ts

@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MapRoutingModule } from './map-routing.module';
import { MapComponent } from './map.component';
@NgModule({
imports: [CommonModule, TranslateModule, MapRoutingModule],
declarations: [MapComponent]
})
export class MapModule {}

14
src/app/shell/header/header.component.html

@ -17,12 +17,16 @@
<i class="fas fa-home"></i>
<span translate> Home</span>
</a>
<a class="nav-item nav-link text-uppercase" routerLink="/about" routerLinkActive="active">
<i class="fas fa-question-circle"></i>
<span translate>About</span>
<a class="nav-item nav-link text-uppercase" routerLink="/map" routerLinkActive="active">
<i class="fas fa-map"></i>
<span translate> Map</span>
</a>
<a class="nav-item nav-link text-uppercase" routerLink="/chart" routerLinkActive="active">
<i class="fas fa-chart-area"></i>
<span translate> Chart</span>
</a>
</div>
<div class="navbar-nav ml-auto">
<!-- <div class="navbar-nav ml-auto">
<div class="nav-item" ngbDropdown display="dynamic" placement="bottom-right">
<a id="language-dropdown" class="nav-link" ngbDropdownToggle>{{ currentLanguage }}</a>
<div ngbDropdownMenu aria-labelledby="language-dropdown">
@ -31,7 +35,7 @@
</button>
</div>
</div>
</div>
</div> -->
</div>
</nav>
</header>

Loading…
Cancel
Save