-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs(nav): component playground for modal navigation #2463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sean-perkins
merged 12 commits into
docs/nav-playground
from
nav-playground/modal-navigation
Aug 17, 2022
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9405453
docs(nav): nav link component playground
sean-perkins efcdd0d
wip(): react example
sean-perkins b27d021
docs(): vue nav-link example
sean-perkins fe321b7
docs(): make angular example match other examples
sean-perkins fbc7f74
docs(): wip modal nav
sean-perkins af701cb
chore(): update demo
sean-perkins ed775fb
wip(): vue and angular examples, react in progress
sean-perkins 539567d
fix(): remaining examples
sean-perkins 24594f0
Merge remote-tracking branch 'origin/docs/nav-playground' into nav-pl…
sean-perkins 54957da
chore(): clean-up + bump package lock
sean-perkins 772410f
chore(): remove inline TOC
sean-perkins 45b76df
chore(): add padding to modal demo example
sean-perkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
static/usage/nav/modal-navigation/angular/app_component_html.md
This file contains hidden or 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 @@ | ||
```html | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Modal Navigation</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<ion-button id="openModal">Open Modal</ion-button> | ||
<ion-modal #modal trigger="openModal" (willPresent)="onWillPresent()"> | ||
<ng-template> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Modal</ion-title> | ||
<ion-buttons slot="end"> | ||
<ion-button (click)="modal.dismiss()"> Close </ion-button> | ||
</ion-buttons> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<ion-nav #nav></ion-nav> | ||
</ion-content> | ||
</ng-template> | ||
</ion-modal> | ||
</ion-content> | ||
``` |
18 changes: 18 additions & 0 deletions
18
static/usage/nav/modal-navigation/angular/app_component_ts.md
This file contains hidden or 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,18 @@ | ||
```ts | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { IonNav } from '@ionic/angular'; | ||
|
||
import { PageOneComponent } from './page-one.component'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: 'app.component.html', | ||
}) | ||
export class AppComponent { | ||
@ViewChild('nav') private nav: IonNav; | ||
|
||
onWillPresent() { | ||
this.nav.setRoot(PageOneComponent); | ||
} | ||
} | ||
``` |
20 changes: 20 additions & 0 deletions
20
static/usage/nav/modal-navigation/angular/app_module_ts.md
This file contains hidden or 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 @@ | ||
```ts | ||
import { NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { IonicModule } from '@ionic/angular'; | ||
|
||
import { AppComponent } from './app.component'; | ||
|
||
import { PageOneComponent } from './page-one.component'; | ||
import { PageTwoComponent } from './page-two.component'; | ||
import { PageThreeComponent } from './page-three.component'; | ||
|
||
@NgModule({ | ||
imports: [BrowserModule, RouterModule.forRoot([]), IonicModule.forRoot({})], | ||
declarations: [AppComponent, PageOneComponent, PageTwoComponent, PageThreeComponent], | ||
bootstrap: [AppComponent], | ||
}) | ||
export class AppModule {} | ||
``` |
23 changes: 23 additions & 0 deletions
23
static/usage/nav/modal-navigation/angular/page_one_component_ts.md
This file contains hidden or 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,23 @@ | ||
```ts | ||
import { Component } from '@angular/core'; | ||
import { IonNav } from '@ionic/angular'; | ||
|
||
import { PageTwoComponent } from './page-two.component'; | ||
|
||
@Component({ | ||
selector: 'app-page-one', | ||
template: ` | ||
<ion-content class="ion-padding"> | ||
<h1>Page One</h1> | ||
<ion-button (click)="navigateToPageTwo()">Go to Page Two</ion-button> | ||
</ion-content> | ||
`, | ||
}) | ||
export class PageOneComponent { | ||
constructor(private nav: IonNav) {} | ||
|
||
navigateToPageTwo() { | ||
this.nav.push(PageTwoComponent); | ||
} | ||
} | ||
``` |
26 changes: 26 additions & 0 deletions
26
static/usage/nav/modal-navigation/angular/page_three_component_ts.md
This file contains hidden or 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,26 @@ | ||
```ts | ||
import { Component } from '@angular/core'; | ||
import { IonNav } from '@ionic/angular'; | ||
|
||
@Component({ | ||
selector: 'app-page-one', | ||
template: ` | ||
<ion-content class="ion-padding"> | ||
<h1>Page Three</h1> | ||
<ion-button (click)="navigateBack()">Go Back</ion-button> | ||
<ion-button (click)="navigateToRoot()">Go to Root</ion-button> | ||
</ion-content> | ||
`, | ||
}) | ||
export class PageThreeComponent { | ||
constructor(private nav: IonNav) {} | ||
|
||
navigateBack() { | ||
this.nav.pop(); | ||
} | ||
|
||
navigateToRoot() { | ||
this.nav.popToRoot(); | ||
} | ||
} | ||
``` |
25 changes: 25 additions & 0 deletions
25
static/usage/nav/modal-navigation/angular/page_two_component_ts.md
This file contains hidden or 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 @@ | ||
```ts | ||
import { Component } from '@angular/core'; | ||
import { IonNav } from '@ionic/angular'; | ||
|
||
import { PageThreeComponent } from './page-three.component'; | ||
|
||
@Component({ | ||
selector: 'app-page-two', | ||
template: ` | ||
<ion-content class="ion-padding"> | ||
<h1>Page Two</h1> | ||
<ion-button (click)="navigateToPageThree()">Go to Page Three</ion-button> | ||
</ion-content> | ||
`, | ||
}) | ||
export class PageTwoComponent { | ||
component = PageThreeComponent; | ||
|
||
constructor(private nav: IonNav) {} | ||
|
||
navigateToPageThree() { | ||
this.nav.push(PageThreeComponent); | ||
} | ||
} | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing some weird transition animations in iOS mode: https://user-images.githubusercontent.com/90629384/184921906-98e49071-f095-4424-b437-689e636d9adb.mp4
It doesn't happen in Stackblitz, so maybe this is related to the Playground component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a strange one... the style block that is causing this issue is:
somehow it's stripping the space within the
:not
tag, as ours is:We can see that issue directly from the CDN: https://cdn.jsdelivr.net/npm/@ionic/core/css/ionic.bundle.css.
I'll need to work with Liam to uncover why this is happening. I don't see this as a blocker though, as the Stackblitz examples work & when developers install the package they will not have this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this will be resolved once: ionic-team/ionic-framework#25767 is merged, we deploy the next patch & jsDelivr cache is purged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Word 👍