-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notfound): add NotFound page (#1672)
- Loading branch information
Showing
9 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/app/pages/miscellaneous/miscellaneous-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { MiscellaneousComponent } from './miscellaneous.component'; | ||
import { NotFoundComponent } from './not-found/not-found.component'; | ||
|
||
const routes: Routes = [{ | ||
path: '', | ||
component: MiscellaneousComponent, | ||
children: [{ | ||
path: '404', | ||
component: NotFoundComponent, | ||
}], | ||
}]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class MiscellaneousRoutingModule { } | ||
|
||
export const routedComponents = [ | ||
MiscellaneousComponent, | ||
NotFoundComponent, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ngx-miscellaneous', | ||
template: ` | ||
<router-outlet></router-outlet> | ||
`, | ||
}) | ||
export class MiscellaneousComponent { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { ThemeModule } from '../../@theme/theme.module'; | ||
import { MiscellaneousRoutingModule, routedComponents } from './miscellaneous-routing.module'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
ThemeModule, | ||
MiscellaneousRoutingModule, | ||
], | ||
declarations: [ | ||
...routedComponents, | ||
], | ||
}) | ||
export class MiscellaneousModule { } |
15 changes: 15 additions & 0 deletions
15
src/app/pages/miscellaneous/not-found/not-found.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<nb-card> | ||
<nb-card-body> | ||
<div class="flex-centered col-xl-4 col-lg-6 col-md-8 col-sm-12"> | ||
<h2 class="title">404 Page Not Found</h2> | ||
<small class="sub-title">The page you were looking for doesn't exist</small> | ||
<button (click)="goToHome()" type="button" class="btn btn-block btn-hero-primary"> | ||
Take me home | ||
</button> | ||
</div> | ||
</nb-card-body> | ||
</nb-card> | ||
</div> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
src/app/pages/miscellaneous/not-found/not-found.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.flex-centered { | ||
margin: auto; | ||
} | ||
nb-card-body { | ||
display: flex; | ||
} | ||
|
||
.title { | ||
text-align: center; | ||
} | ||
|
||
.sub-title { | ||
text-align: center; | ||
display: block; | ||
margin-bottom: 3rem; | ||
} | ||
|
||
.btn { | ||
margin-bottom: 2rem; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/app/pages/miscellaneous/not-found/not-found.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NbMenuService } from '@nebular/theme'; | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ngx-not-found', | ||
styleUrls: ['./not-found.component.scss'], | ||
templateUrl: './not-found.component.html', | ||
}) | ||
export class NotFoundComponent { | ||
|
||
constructor(private menuService: NbMenuService) { | ||
} | ||
|
||
goToHome() { | ||
this.menuService.navigateHome(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters