Skip to content

Commit

Permalink
feat: fix footer routing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhavelik committed Oct 13, 2023
1 parent 9711fcf commit 693142e
Showing 1 changed file with 54 additions and 50 deletions.
104 changes: 54 additions & 50 deletions web/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,54 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

/* ROOT VIEW */
import { AppComponent } from './app.component';

/* MAIN VIEWS */
import { AboutViewComponent } from './views/about-view/about-view.component';
import { CampViewComponent } from './views/camp-view/camp-view.component';
import { ContactsViewComponent } from './views/contacts-view/contacts-view.component';
import { EventsViewComponent } from './views/events-view/events-view.component';
import { GalleryViewComponent } from './views/gallery-view/gallery-view.component';
import { NewsViewComponent } from './views/news-view/news-view.component';

/* CHILD VIEWS */
import { GalleryViewAlbumComponent } from './views/gallery-view/gallery-view-album/gallery-view-album.component';
import { GalleryViewTimelineComponent } from './views/gallery-view/gallery-view-timeline/gallery-view-timeline.component';
import { GalleryViewPhotosComponent } from './views/gallery-view/gallery-view-photos/gallery-view-photos.component';


const routes: Routes = [

{ path: 'aktualne', component: NewsViewComponent },

{
path: 'fotogalerie', component: GalleryViewComponent,
children: [
{ path: ':album/:photo', component: GalleryViewPhotosComponent },
{ path: ':album', component: GalleryViewAlbumComponent },
{ path: '', component: GalleryViewTimelineComponent }
]
},

{ path: 'kontakty', component: ContactsViewComponent },

{ path: 'o-nas', component: AboutViewComponent },

{ path: 'program', component: EventsViewComponent },

{ path: 'tabor', component: CampViewComponent },

{ path: '', redirectTo: "o-nas", pathMatch: "full" }

];

@NgModule({
imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: 'enabled' })],
exports: [RouterModule]
})
export class AppRoutingModule { }
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";

/* MAIN VIEWS */
import { AboutViewComponent } from "./views/about-view/about-view.component";
import { CampViewComponent } from "./views/camp-view/camp-view.component";
import { ContactsViewComponent } from "./views/contacts-view/contacts-view.component";
import { EventsViewComponent } from "./views/events-view/events-view.component";
import { GalleryViewComponent } from "./views/gallery-view/gallery-view.component";
import { NewsViewComponent } from "./views/news-view/news-view.component";

/* CHILD VIEWS */
import { GalleryViewAlbumComponent } from "./views/gallery-view/gallery-view-album/gallery-view-album.component";
import {
GalleryViewTimelineComponent
} from "./views/gallery-view/gallery-view-timeline/gallery-view-timeline.component";
import { GalleryViewPhotosComponent } from "./views/gallery-view/gallery-view-photos/gallery-view-photos.component";


const routes: Routes = [

{ path: "aktualne", component: NewsViewComponent },

{
path: "fotogalerie", component: GalleryViewComponent,
children: [
{ path: ":album/:photo", component: GalleryViewPhotosComponent },
{ path: ":album", component: GalleryViewAlbumComponent },
{ path: "", component: GalleryViewTimelineComponent }
]
},

{ path: "kontakty", component: ContactsViewComponent },

{ path: "o-nas", component: AboutViewComponent },

{ path: "program", component: EventsViewComponent },

{ path: "tabor", component: CampViewComponent },

{ path: "", redirectTo: "o-nas", pathMatch: "full" }

];

@NgModule({
imports: [RouterModule.forRoot(routes, {
scrollPositionRestoration: "enabled",
anchorScrolling: "enabled",
scrollOffset: [0, 50]
})],
exports: [RouterModule]
})
export class AppRoutingModule {
}

0 comments on commit 693142e

Please sign in to comment.