Skip to content

Commit

Permalink
dev: Gallery to be standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
kwongtn committed Jun 21, 2024
1 parent 1345ee4 commit 9f463a8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
16 changes: 6 additions & 10 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
import { RouterModule, Routes } from "@angular/router";

import { ConstructionComponent } from "./construction/construction.component";
import { GalleryComponent } from "./gallery/gallery.component";
import { InsidenMainComponent } from "./insiden/insiden.component";
import { SituasiComponent } from "./situasi/situasi.component";

Expand Down Expand Up @@ -88,20 +87,17 @@ const routes: Routes = [
{
path: "gallery",
title: "MLPTF | Gallery",
loadChildren: async () => {
loadComponent: () => {
if (maintenance.gallery.curentlyInMaintenance) {
const module = await import(
"./construction/construction.module"
return import("./construction/construction.component").then(
(m) => m.ConstructionComponent
);
return module.ConstructionModule;
} else {
const module = await import("./gallery/gallery.module");
return module.GalleryModule;
return import("./gallery/gallery.component").then(
(m) => m.GalleryComponent
);
}
},
component: maintenance.spotting.curentlyInMaintenance
? ConstructionComponent
: GalleryComponent,
},
{
path: "spotting",
Expand Down
7 changes: 6 additions & 1 deletion src/app/gallery/gallery.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { QueryRef } from "apollo-angular";
import { InViewportModule } from "ng-in-viewport";
import { NzSpinModule } from "ng-zorro-antd/spin";
import { Subscription } from "rxjs";
import { InputImage } from "src/app/@ui/image-grid/image-grid.component";
import { ImageGridModule } from "src/app/@ui/image-grid/image-grid.module";
import { getThumbnail } from "src/app/@util/imgur";

import { KeyValue } from "@angular/common";
import { CommonModule, KeyValue } from "@angular/common";
import { Component, OnDestroy, OnInit } from "@angular/core";

import {
Expand All @@ -15,6 +18,8 @@ import {
selector: "app-gallery",
templateUrl: "./gallery.component.html",
styleUrls: ["./gallery.component.scss"],
standalone: true,
imports: [CommonModule, ImageGridModule, InViewportModule, NzSpinModule],
})
export class GalleryComponent implements OnInit, OnDestroy {
imageDateMaps: {
Expand Down
14 changes: 0 additions & 14 deletions src/app/gallery/gallery.module.ts

This file was deleted.

0 comments on commit 9f463a8

Please sign in to comment.