Skip to content

Commit

Permalink
New Features:
Browse files Browse the repository at this point in the history
1. Menu Added, and will not show if on Login or Register pages
New Pages:

Bugs Corrected:

To Be Corrected:
  • Loading branch information
juanfranciscocis committed May 29, 2024
1 parent 3fb0eca commit 5b1d8c6
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const redirectLoggedInToHome = () => redirectLoggedInTo(['home']);
const routes: Routes = [
{
path: '',
redirectTo: 'register',
redirectTo: 'login',
pathMatch: 'full'
},
{
Expand Down
23 changes: 22 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
<ion-app>
<ion-router-outlet></ion-router-outlet>
<ion-split-pane when="md" contentId="menu-content" >
<ion-menu content-id="menu-content" menu-id="menu-id" side="start" type="overlay">
<ion-header>
<ion-toolbar >
<ion-title>
Menu
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list class="h-full">
<ion-menu-toggle *ngFor="let item of menuItems" auto-hide="false">
<ion-item [routerLink]="item.url">
<ion-icon [name]="item.icon" slot="start"></ion-icon>
<ion-label color="primary">{{item.title}}</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
</ion-content>
</ion-menu>
<ion-router-outlet id="menu-content"></ion-router-outlet>
</ion-split-pane>
</ion-app>
30 changes: 27 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { MenuController } from '@ionic/angular';

@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
})
export class AppComponent {
constructor() {}
export class AppComponent implements OnInit {

menuItems = [
{
title: 'Home',
url: '/home',
icon: 'home'
},
];

constructor(private router: Router, private menuController: MenuController) {}

ngOnInit() {
this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd) {
// Disable the menu on Login and Register pages
if (event.urlAfterRedirects.includes('/login') || event.urlAfterRedirects.includes('/register')) {
this.menuController.enable(false);
} else {
this.menuController.enable(true);
}
}
});
}
}
12 changes: 3 additions & 9 deletions src/app/home/home.page.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
Juan
</ion-title>
<ion-menu-button slot="start" menu="menu-id">
</ion-menu-button>
<ion-title >Inicio</ion-title>
</ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">DevProbe</ion-title>
</ion-toolbar>
</ion-header>

<div id="container">
<strong>Ready to create an app?</strong>
<p>Start with Ionic <a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components">UI Components</a></p>
Expand Down
1 change: 1 addition & 0 deletions www/5075.1962af4f40e84068.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion www/5075.69f1387a10a41fbb.js

This file was deleted.

Loading

0 comments on commit 5b1d8c6

Please sign in to comment.