From b886a321611f0b0cede69c3a4c4164a0c883d659 Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Tue, 21 Jun 2022 22:57:32 -0400 Subject: [PATCH 1/6] docs(nav): component playground examples --- docs/api/nav-link.md | 2 + docs/api/nav.md | 22 +- .../reference/ReleaseNotes/release-notes.json | 204 +++--------------- 3 files changed, 49 insertions(+), 179 deletions(-) diff --git a/docs/api/nav-link.md b/docs/api/nav-link.md index 24fce107ee5..39ee866164a 100644 --- a/docs/api/nav-link.md +++ b/docs/api/nav-link.md @@ -36,6 +36,8 @@ A navigation link is used to navigate to a specified component. The component ca It is the element form of calling the `push()`, `pop()`, and `setRoot()` methods on the navigation controller. +For an example of how to use `ion-nav-link`, visit the [`ion-nav` docs](./nav#using-navlink). + diff --git a/docs/api/nav.md b/docs/api/nav.md index e8b47e335cf..678969eca07 100644 --- a/docs/api/nav.md +++ b/docs/api/nav.md @@ -1,8 +1,6 @@ --- title: "ion-nav" hide_table_of_contents: true -demoUrl: "/docs/demos/api/nav/index.html" -demoSourceUrl: "https://github.com/ionic-team/ionic-docs/tree/main/static/demos/api/nav/index.html" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -38,6 +36,26 @@ Nav is a standalone component for loading arbitrary components and pushing new c Unlike Router Outlet, Nav is not tied to a particular router. This means that if we load a Nav component, and push other components to the stack, they will not affect the app's overall router. This fits use cases where you could have a modal, which needs its own sub-navigation, without making it tied to the apps URL. +## Using NavController + +TODO: Playground Example + +## Using NavLink + +TODO: Playground Example + +## Navigation within a Modal + +TODO: Playground Example + +## Animations + +TODO: Playground Example + +## Event Handling + +TODO: Playground Example + ## Interfaces ### NavCustomEvent diff --git a/src/components/page/reference/ReleaseNotes/release-notes.json b/src/components/page/reference/ReleaseNotes/release-notes.json index 982333d8fec..089331e7df5 100644 --- a/src/components/page/reference/ReleaseNotes/release-notes.json +++ b/src/components/page/reference/ReleaseNotes/release-notes.json @@ -1,202 +1,52 @@ [ { - "body": "

6.1.3 (2022-04-27)

\n

Bug Fixes

\n\n", + "body": "

6.1.10 (2022-06-15)

\n

Bug Fixes

\n\n", "element": "Vanadium", - "name": "v6.1.3", - "published_at": "April 27 2022", + "name": "v6.1.10", + "published_at": "June 15 2022", "symbol": "V", - "tag_name": "v6.1.3", + "tag_name": "v6.1.10", "type": "patch", - "version": "6.1.3" + "version": "6.1.10" }, { - "body": "

6.1.2 (2022-04-20)

\n

Bug Fixes

\n\n", + "body": "

6.1.9 (2022-06-08)

\n

Bug Fixes

\n\n", "element": "Vanadium", - "name": "v6.1.2", - "published_at": "April 20 2022", + "name": "v6.1.9", + "published_at": "June 8 2022", "symbol": "V", - "tag_name": "v6.1.2", + "tag_name": "v6.1.9", "type": "patch", - "version": "6.1.2" + "version": "6.1.9" }, { - "body": "

6.1.1 (2022-04-15)

\n

Bug Fixes

\n\n", + "body": "

6.1.8 (2022-06-01)

\n

Bug Fixes

\n\n", "element": "Vanadium", - "name": "v6.1.1", - "published_at": "April 15 2022", + "name": "v6.1.8", + "published_at": "June 1 2022", "symbol": "V", - "tag_name": "v6.1.1", + "tag_name": "v6.1.8", "type": "patch", - "version": "6.1.1" + "version": "6.1.8" }, { - "body": "

6.1.0 Vanadium (2022-04-13)

\n

Bug Fixes

\n\n

Features

\n\n", + "body": "

6.1.7 (2022-05-26)

\n

Bug Fixes

\n\n", "element": "Vanadium", - "name": "v6.1.0 Vanadium", - "published_at": "April 13 2022", + "name": "v6.1.7", + "published_at": "May 26 2022", "symbol": "V", - "tag_name": "v6.1.0", - "type": "minor", - "version": "6.1.0" - }, - { - "body": "

6.0.16 (2022-04-08)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.16", - "published_at": "April 8 2022", - "symbol": "Ti", - "tag_name": "v6.0.16", - "type": "patch", - "version": "6.0.16" - }, - { - "body": "

6.0.15 (2022-04-06)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.15", - "published_at": "April 6 2022", - "symbol": "Ti", - "tag_name": "v6.0.15", - "type": "patch", - "version": "6.0.15" - }, - { - "body": "

6.0.14 (2022-03-30)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.14", - "published_at": "March 30 2022", - "symbol": "Ti", - "tag_name": "v6.0.14", - "type": "patch", - "version": "6.0.14" - }, - { - "body": "

6.0.13 (2022-03-23)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.13", - "published_at": "March 23 2022", - "symbol": "Ti", - "tag_name": "v6.0.13", - "type": "patch", - "version": "6.0.13" - }, - { - "body": "

6.0.12 (2022-03-16)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.12", - "published_at": "March 16 2022", - "symbol": "Ti", - "tag_name": "v6.0.12", - "type": "patch", - "version": "6.0.12" - }, - { - "body": "

6.0.11 (2022-03-09)

\n

Bug Fixes

\n\n

Performance Improvements

\n\n", - "element": "Titanium", - "name": "v6.0.11", - "published_at": "March 9 2022", - "symbol": "Ti", - "tag_name": "v6.0.11", - "type": "patch", - "version": "6.0.11" - }, - { - "body": "

6.0.10 (2022-03-02)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.10", - "published_at": "March 2 2022", - "symbol": "Ti", - "tag_name": "v6.0.10", - "type": "patch", - "version": "6.0.10" - }, - { - "body": "

6.0.9 (2022-02-23)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.9", - "published_at": "February 23 2022", - "symbol": "Ti", - "tag_name": "v6.0.9", + "tag_name": "v6.1.7", "type": "patch", - "version": "6.0.9" + "version": "6.1.7" }, { - "body": "

6.0.8 (2022-02-15)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.8", - "published_at": "February 15 2022", - "symbol": "Ti", - "tag_name": "v6.0.8", - "type": "patch", - "version": "6.0.8" - }, - { - "body": "

6.0.7 (2022-02-09)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.7", - "published_at": "February 9 2022", - "symbol": "Ti", - "tag_name": "v6.0.7", - "type": "patch", - "version": "6.0.7" - }, - { - "body": "

6.0.6 (2022-02-09)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.6", - "published_at": "February 9 2022", - "symbol": "Ti", - "tag_name": "v6.0.6", - "type": "patch", - "version": "6.0.6" - }, - { - "body": "

6.0.5 (2022-02-02)

\n

Bug Fixes

\n\n

Performance Improvements

\n\n", - "element": "Titanium", - "name": "v6.0.5", - "published_at": "February 2 2022", - "symbol": "Ti", - "tag_name": "v6.0.5", - "type": "patch", - "version": "6.0.5" - }, - { - "body": "

6.0.4 (2022-01-26)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.4", - "published_at": "January 26 2022", - "symbol": "Ti", - "tag_name": "v6.0.4", - "type": "patch", - "version": "6.0.4" - }, - { - "body": "

6.0.3 (2022-01-19)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.3", - "published_at": "January 19 2022", - "symbol": "Ti", - "tag_name": "v6.0.3", - "type": "patch", - "version": "6.0.3" - }, - { - "body": "

6.0.2 (2022-01-11)

\n

Bug Fixes

\n\n", - "element": "Titanium", - "name": "v6.0.2", - "published_at": "January 11 2022", - "symbol": "Ti", - "tag_name": "v6.0.2", - "type": "patch", - "version": "6.0.2" - }, - { - "body": "

5.9.4 (2022-04-27)

\n

Bug Fixes

\n\n", - "element": "Scandium", - "name": "v5.9.4", - "published_at": "April 27 2022", - "symbol": "Sc", - "tag_name": "v5.9.4", + "body": "

6.1.6 (2022-05-18)

\n

Bug Fixes

\n\n", + "element": "Vanadium", + "name": "v6.1.6", + "published_at": "May 18 2022", + "symbol": "V", + "tag_name": "v6.1.6", "type": "patch", - "version": "5.9.4" + "version": "6.1.6" } ] From 550396c26ea90edf25320bf23d2a0111330b658d Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Wed, 6 Jul 2022 16:08:22 -0400 Subject: [PATCH 2/6] docs(nav): nav link component playground (#2437) --- docs/api/nav.md | 6 +- .../nav-link/angular/app_component_html.md | 3 + .../nav/nav-link/angular/app_component_ts.md | 13 +++ .../nav/nav-link/angular/app_module_ts.md | 20 +++++ .../nav-link/angular/page_one_component_ts.md | 25 ++++++ .../angular/page_three_component_ts.md | 21 +++++ .../nav-link/angular/page_two_component_ts.md | 30 +++++++ static/usage/nav/nav-link/demo.html | 84 +++++++++++++++++++ static/usage/nav/nav-link/index.md | 54 ++++++++++++ static/usage/nav/nav-link/javascript.md | 67 +++++++++++++++ static/usage/nav/nav-link/react/main_tsx.md | 11 +++ .../usage/nav/nav-link/react/page_one_tsx.md | 26 ++++++ .../nav/nav-link/react/page_three_tsx.md | 24 ++++++ .../usage/nav/nav-link/react/page_two_tsx.md | 38 +++++++++ static/usage/nav/nav-link/vue/example_vue.md | 19 +++++ static/usage/nav/nav-link/vue/page_one_vue.md | 29 +++++++ .../usage/nav/nav-link/vue/page_three_vue.md | 23 +++++ static/usage/nav/nav-link/vue/page_two_vue.md | 50 +++++++++++ 18 files changed, 542 insertions(+), 1 deletion(-) create mode 100644 static/usage/nav/nav-link/angular/app_component_html.md create mode 100644 static/usage/nav/nav-link/angular/app_component_ts.md create mode 100644 static/usage/nav/nav-link/angular/app_module_ts.md create mode 100644 static/usage/nav/nav-link/angular/page_one_component_ts.md create mode 100644 static/usage/nav/nav-link/angular/page_three_component_ts.md create mode 100644 static/usage/nav/nav-link/angular/page_two_component_ts.md create mode 100644 static/usage/nav/nav-link/demo.html create mode 100644 static/usage/nav/nav-link/index.md create mode 100644 static/usage/nav/nav-link/javascript.md create mode 100644 static/usage/nav/nav-link/react/main_tsx.md create mode 100644 static/usage/nav/nav-link/react/page_one_tsx.md create mode 100644 static/usage/nav/nav-link/react/page_three_tsx.md create mode 100644 static/usage/nav/nav-link/react/page_two_tsx.md create mode 100644 static/usage/nav/nav-link/vue/example_vue.md create mode 100644 static/usage/nav/nav-link/vue/page_one_vue.md create mode 100644 static/usage/nav/nav-link/vue/page_three_vue.md create mode 100644 static/usage/nav/nav-link/vue/page_two_vue.md diff --git a/docs/api/nav.md b/docs/api/nav.md index 678969eca07..5e649ae8912 100644 --- a/docs/api/nav.md +++ b/docs/api/nav.md @@ -42,7 +42,11 @@ TODO: Playground Example ## Using NavLink -TODO: Playground Example +NavLink is a simplified API when interacting with Nav. Developers can customize the component, pass along component properties, modify the direction of the route animation or define a custom animation when navigating. + +import NavLinkExample from '@site/static/usage/nav/nav-link/index.md'; + + ## Navigation within a Modal diff --git a/static/usage/nav/nav-link/angular/app_component_html.md b/static/usage/nav/nav-link/angular/app_component_html.md new file mode 100644 index 00000000000..1534ea3a6ec --- /dev/null +++ b/static/usage/nav/nav-link/angular/app_component_html.md @@ -0,0 +1,3 @@ +```html + +``` diff --git a/static/usage/nav/nav-link/angular/app_component_ts.md b/static/usage/nav/nav-link/angular/app_component_ts.md new file mode 100644 index 00000000000..472f41634da --- /dev/null +++ b/static/usage/nav/nav-link/angular/app_component_ts.md @@ -0,0 +1,13 @@ +```ts +import { Component } from '@angular/core'; + +import { PageOneComponent } from './page-one.component'; + +@Component({ + selector: 'app-root', + templateUrl: 'app.component.html', +}) +export class AppComponent { + component = PageOneComponent; +} +``` diff --git a/static/usage/nav/nav-link/angular/app_module_ts.md b/static/usage/nav/nav-link/angular/app_module_ts.md new file mode 100644 index 00000000000..17eb272293f --- /dev/null +++ b/static/usage/nav/nav-link/angular/app_module_ts.md @@ -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 {} +``` diff --git a/static/usage/nav/nav-link/angular/page_one_component_ts.md b/static/usage/nav/nav-link/angular/page_one_component_ts.md new file mode 100644 index 00000000000..06c42b342cf --- /dev/null +++ b/static/usage/nav/nav-link/angular/page_one_component_ts.md @@ -0,0 +1,25 @@ +```ts +import { Component } from '@angular/core'; + +import { PageTwoComponent } from './page-two.component'; + +@Component({ + selector: 'app-page-one', + template: ` + + + Page One + + + +

Page One

+ + Go to Page Two + +
+ `, +}) +export class PageOneComponent { + component = PageTwoComponent; +} +``` diff --git a/static/usage/nav/nav-link/angular/page_three_component_ts.md b/static/usage/nav/nav-link/angular/page_three_component_ts.md new file mode 100644 index 00000000000..d9e95ed7218 --- /dev/null +++ b/static/usage/nav/nav-link/angular/page_three_component_ts.md @@ -0,0 +1,21 @@ +```ts +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-page-one', + template: ` + + + + + + Page Three + + + +

Page Three

+
+ `, +}) +export class PageThreeComponent {} +``` diff --git a/static/usage/nav/nav-link/angular/page_two_component_ts.md b/static/usage/nav/nav-link/angular/page_two_component_ts.md new file mode 100644 index 00000000000..d6edd90a593 --- /dev/null +++ b/static/usage/nav/nav-link/angular/page_two_component_ts.md @@ -0,0 +1,30 @@ +```ts +import { Component } from '@angular/core'; + +import { PageThreeComponent } from './page-three.component'; + +@Component({ + selector: 'app-page-two', + template: ` + + + + + + Page Two + + + +

Page Two

+
+ + Go to Page Three + +
+
+ `, +}) +export class PageTwoComponent { + component = PageThreeComponent; +} +``` diff --git a/static/usage/nav/nav-link/demo.html b/static/usage/nav/nav-link/demo.html new file mode 100644 index 00000000000..d813dfe8a87 --- /dev/null +++ b/static/usage/nav/nav-link/demo.html @@ -0,0 +1,84 @@ + + + + + + + + Nav | NavLink + + + + + + + + + + + + + + + + diff --git a/static/usage/nav/nav-link/index.md b/static/usage/nav/nav-link/index.md new file mode 100644 index 00000000000..07f88bf10f1 --- /dev/null +++ b/static/usage/nav/nav-link/index.md @@ -0,0 +1,54 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; + +import angular_app_module_ts from './angular/app_module_ts.md'; +import angular_app_component_html from './angular/app_component_html.md'; +import angular_app_component_ts from './angular/app_component_ts.md'; +import angular_page_one_component_ts from './angular/page_one_component_ts.md'; +import angular_page_two_component_ts from './angular/page_two_component_ts.md'; +import angular_page_three_component_ts from './angular/page_three_component_ts.md'; + +import react_main_tsx from './react/main_tsx.md'; +import react_page_one_tsx from './react/page_one_tsx.md'; +import react_page_two_tsx from './react/page_two_tsx.md'; +import react_page_three_tsx from './react/page_three_tsx.md'; + +import vue_example from './vue/example_vue.md'; +import vue_page_one from './vue/page_one_vue.md'; +import vue_page_two from './vue/page_two_vue.md'; +import vue_page_three from './vue/page_three_vue.md'; + + diff --git a/static/usage/nav/nav-link/javascript.md b/static/usage/nav/nav-link/javascript.md new file mode 100644 index 00000000000..faf19dc3ca7 --- /dev/null +++ b/static/usage/nav/nav-link/javascript.md @@ -0,0 +1,67 @@ +```html + + + + + +``` diff --git a/static/usage/nav/nav-link/react/main_tsx.md b/static/usage/nav/nav-link/react/main_tsx.md new file mode 100644 index 00000000000..f6196a362e9 --- /dev/null +++ b/static/usage/nav/nav-link/react/main_tsx.md @@ -0,0 +1,11 @@ +```tsx +import React from 'react'; +import { IonNav } from '@ionic/react'; + +import PageOne from './page-one'; + +function Example() { + return }>; +} +export default Example; +``` diff --git a/static/usage/nav/nav-link/react/page_one_tsx.md b/static/usage/nav/nav-link/react/page_one_tsx.md new file mode 100644 index 00000000000..303ad18547a --- /dev/null +++ b/static/usage/nav/nav-link/react/page_one_tsx.md @@ -0,0 +1,26 @@ +```tsx +import React from 'react'; +import { IonButton, IonHeader, IonContent, IonNavLink, IonToolbar, IonTitle } from '@ionic/react'; + +import PageTwo from './page-two'; + +function PageOne() { + return ( + <> + + + Page One + + + +

Page One

+ }> + Go to Page Two + +
+ + ); +} + +export default PageOne; +``` diff --git a/static/usage/nav/nav-link/react/page_three_tsx.md b/static/usage/nav/nav-link/react/page_three_tsx.md new file mode 100644 index 00000000000..451d30db85d --- /dev/null +++ b/static/usage/nav/nav-link/react/page_three_tsx.md @@ -0,0 +1,24 @@ +```tsx +import React from 'react'; +import { IonBackButton, IonButtons, IonHeader, IonContent, IonToolbar, IonTitle } from '@ionic/react'; + +function PageThree() { + return ( + <> + + + + + + Page Three + + + +

Page Three

+
+ + ); +} + +export default PageThree; +``` diff --git a/static/usage/nav/nav-link/react/page_two_tsx.md b/static/usage/nav/nav-link/react/page_two_tsx.md new file mode 100644 index 00000000000..fd3f8764873 --- /dev/null +++ b/static/usage/nav/nav-link/react/page_two_tsx.md @@ -0,0 +1,38 @@ +```tsx +import React from 'react'; +import { + IonBackButton, + IonButtons, + IonButton, + IonHeader, + IonContent, + IonNavLink, + IonToolbar, + IonTitle, +} from '@ionic/react'; + +import PageThree from './page-three'; + +function PageTwo() { + return ( + <> + + + + + + Page Two + + + +

Page Two

+ }> + Go to Page Three + +
+ + ); +} + +export default PageTwo; +``` diff --git a/static/usage/nav/nav-link/vue/example_vue.md b/static/usage/nav/nav-link/vue/example_vue.md new file mode 100644 index 00000000000..ec054a80749 --- /dev/null +++ b/static/usage/nav/nav-link/vue/example_vue.md @@ -0,0 +1,19 @@ +```html + + + +``` diff --git a/static/usage/nav/nav-link/vue/page_one_vue.md b/static/usage/nav/nav-link/vue/page_one_vue.md new file mode 100644 index 00000000000..f3635e1db37 --- /dev/null +++ b/static/usage/nav/nav-link/vue/page_one_vue.md @@ -0,0 +1,29 @@ +```html + + + +``` diff --git a/static/usage/nav/nav-link/vue/page_three_vue.md b/static/usage/nav/nav-link/vue/page_three_vue.md new file mode 100644 index 00000000000..54d6acf24c9 --- /dev/null +++ b/static/usage/nav/nav-link/vue/page_three_vue.md @@ -0,0 +1,23 @@ +```html + + + +``` diff --git a/static/usage/nav/nav-link/vue/page_two_vue.md b/static/usage/nav/nav-link/vue/page_two_vue.md new file mode 100644 index 00000000000..0d736d69c88 --- /dev/null +++ b/static/usage/nav/nav-link/vue/page_two_vue.md @@ -0,0 +1,50 @@ +```html + + + +``` From 847a21c93137a4e58057989518af842bbd8a0958 Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Wed, 17 Aug 2022 11:02:53 -0400 Subject: [PATCH 3/6] docs(nav): component playground for modal navigation (#2463) --- docs/api/nav.md | 27 ++--- .../code/stackblitz/react/package-lock.json | 61 ++++++---- .../angular/app_component_html.md | 25 +++++ .../angular/app_component_ts.md | 18 +++ .../modal-navigation/angular/app_module_ts.md | 20 ++++ .../angular/page_one_component_ts.md | 23 ++++ .../angular/page_three_component_ts.md | 26 +++++ .../angular/page_two_component_ts.md | 25 +++++ static/usage/nav/modal-navigation/demo.html | 106 ++++++++++++++++++ static/usage/nav/modal-navigation/index.md | 54 +++++++++ .../usage/nav/modal-navigation/javascript.md | 86 ++++++++++++++ .../nav/modal-navigation/react/main_tsx.md | 60 ++++++++++ .../modal-navigation/react/page_one_tsx.md | 18 +++ .../modal-navigation/react/page_three_tsx.md | 19 ++++ .../modal-navigation/react/page_two_tsx.md | 19 ++++ .../nav/modal-navigation/vue/example_vue.md | 60 ++++++++++ .../nav/modal-navigation/vue/page_one_vue.md | 24 ++++ .../modal-navigation/vue/page_three_vue.md | 28 +++++ .../nav/modal-navigation/vue/page_two_vue.md | 24 ++++ 19 files changed, 682 insertions(+), 41 deletions(-) create mode 100644 static/usage/nav/modal-navigation/angular/app_component_html.md create mode 100644 static/usage/nav/modal-navigation/angular/app_component_ts.md create mode 100644 static/usage/nav/modal-navigation/angular/app_module_ts.md create mode 100644 static/usage/nav/modal-navigation/angular/page_one_component_ts.md create mode 100644 static/usage/nav/modal-navigation/angular/page_three_component_ts.md create mode 100644 static/usage/nav/modal-navigation/angular/page_two_component_ts.md create mode 100644 static/usage/nav/modal-navigation/demo.html create mode 100644 static/usage/nav/modal-navigation/index.md create mode 100644 static/usage/nav/modal-navigation/javascript.md create mode 100644 static/usage/nav/modal-navigation/react/main_tsx.md create mode 100644 static/usage/nav/modal-navigation/react/page_one_tsx.md create mode 100644 static/usage/nav/modal-navigation/react/page_three_tsx.md create mode 100644 static/usage/nav/modal-navigation/react/page_two_tsx.md create mode 100644 static/usage/nav/modal-navigation/vue/example_vue.md create mode 100644 static/usage/nav/modal-navigation/vue/page_one_vue.md create mode 100644 static/usage/nav/modal-navigation/vue/page_three_vue.md create mode 100644 static/usage/nav/modal-navigation/vue/page_two_vue.md diff --git a/docs/api/nav.md b/docs/api/nav.md index 5e649ae8912..90b3bf8114c 100644 --- a/docs/api/nav.md +++ b/docs/api/nav.md @@ -1,6 +1,5 @@ --- title: "ion-nav" -hide_table_of_contents: true --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -22,24 +21,10 @@ import APITOCInline from '@components/page/api/APITOCInline'; -

Contents

- - - - - Nav is a standalone component for loading arbitrary components and pushing new components on to the stack. Unlike Router Outlet, Nav is not tied to a particular router. This means that if we load a Nav component, and push other components to the stack, they will not affect the app's overall router. This fits use cases where you could have a modal, which needs its own sub-navigation, without making it tied to the apps URL. -## Using NavController - -TODO: Playground Example - ## Using NavLink NavLink is a simplified API when interacting with Nav. Developers can customize the component, pass along component properties, modify the direction of the route animation or define a custom animation when navigating. @@ -50,15 +35,17 @@ import NavLinkExample from '@site/static/usage/nav/nav-link/index.md'; ## Navigation within a Modal -TODO: Playground Example +Modal can use Nav to offer a linear navigation that is independent of the URL. + +:::note -## Animations +The example below uses a reference to Nav and the public method APIs to push and pop views. It is recommended to use NavLink in implementations that do not require this level of granular access and control. -TODO: Playground Example +::: -## Event Handling +import ModalNavigationExample from '@site/static/usage/nav/modal-navigation/index.md'; -TODO: Playground Example + ## Interfaces diff --git a/static/code/stackblitz/react/package-lock.json b/static/code/stackblitz/react/package-lock.json index 4531aeadb45..614b0d32709 100644 --- a/static/code/stackblitz/react/package-lock.json +++ b/static/code/stackblitz/react/package-lock.json @@ -8,7 +8,7 @@ "name": "create-react-app-typescript", "version": "0.1.0", "dependencies": { - "@ionic/react": "^6.0.0", + "@ionic/react": "^6.2.0", "@types/node": "^16.11.35", "@types/react": "^18.0.9", "@types/react-dom": "^18.0.4", @@ -2187,9 +2187,9 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, "node_modules/@ionic/core": { - "version": "6.1.10", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.1.10.tgz", - "integrity": "sha512-QmQvIe+IklQhNhbq438I3eCnL6XjfTxrgO1+paOdGNKk3R3o4mqJmV0YYT5r9iwnieHgDxKbo3ovs9UnTXhI7g==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.2.tgz", + "integrity": "sha512-neE+JhtQ7Kb4nGoKR3e55edHQot5BZTw+woV9+pbyCXP1jGeyFeWWPYBYYOkm05TSEkHgh0v6NkV9y31k8GTNw==", "dependencies": { "@stencil/core": "^2.16.0", "ionicons": "^6.0.2", @@ -2197,11 +2197,11 @@ } }, "node_modules/@ionic/react": { - "version": "6.1.10", - "resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.1.10.tgz", - "integrity": "sha512-3XivIon+43cD0QLBAkfi9+9BX0tFL1P0g34Og+DStHdXXtDBgSwqqVW8P96K45uRb7gZuBx9bccb9z9ntOCcig==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.2.2.tgz", + "integrity": "sha512-CRuDJbNDn9bbDba37/5v9aZ2gd450XGklGqXmsxEfadh1iq7iWmqcgw14S0ZDAXQt0aE/J+TeKhTyjyutjsAww==", "dependencies": { - "@ionic/core": "^6.1.10", + "@ionic/core": "^6.2.2", "ionicons": "^6.0.2", "tslib": "*" }, @@ -3124,9 +3124,9 @@ } }, "node_modules/@stencil/core": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz", - "integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw==", + "version": "2.17.3", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.3.tgz", + "integrity": "sha512-qw2DZzOpyaltLLEfYRTj3n+XbvRtkmv4QQimYDJubC6jMY0NXK9r6H2+VyszdbbVmvK1D9GqZtyvY0NmOrztsg==", "bin": { "stencil": "bin/stencil" }, @@ -8307,6 +8307,18 @@ "@stencil/core": "~2.16.0" } }, + "node_modules/ionicons/node_modules/@stencil/core": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz", + "integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw==", + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=12.10.0", + "npm": ">=6.0.0" + } + }, "node_modules/ipaddr.js": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", @@ -17539,9 +17551,9 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, "@ionic/core": { - "version": "6.1.10", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.1.10.tgz", - "integrity": "sha512-QmQvIe+IklQhNhbq438I3eCnL6XjfTxrgO1+paOdGNKk3R3o4mqJmV0YYT5r9iwnieHgDxKbo3ovs9UnTXhI7g==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.2.tgz", + "integrity": "sha512-neE+JhtQ7Kb4nGoKR3e55edHQot5BZTw+woV9+pbyCXP1jGeyFeWWPYBYYOkm05TSEkHgh0v6NkV9y31k8GTNw==", "requires": { "@stencil/core": "^2.16.0", "ionicons": "^6.0.2", @@ -17549,11 +17561,11 @@ } }, "@ionic/react": { - "version": "6.1.10", - "resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.1.10.tgz", - "integrity": "sha512-3XivIon+43cD0QLBAkfi9+9BX0tFL1P0g34Og+DStHdXXtDBgSwqqVW8P96K45uRb7gZuBx9bccb9z9ntOCcig==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.2.2.tgz", + "integrity": "sha512-CRuDJbNDn9bbDba37/5v9aZ2gd450XGklGqXmsxEfadh1iq7iWmqcgw14S0ZDAXQt0aE/J+TeKhTyjyutjsAww==", "requires": { - "@ionic/core": "^6.1.10", + "@ionic/core": "^6.2.2", "ionicons": "^6.0.2", "tslib": "*" } @@ -18218,9 +18230,9 @@ } }, "@stencil/core": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz", - "integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw==" + "version": "2.17.3", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.3.tgz", + "integrity": "sha512-qw2DZzOpyaltLLEfYRTj3n+XbvRtkmv4QQimYDJubC6jMY0NXK9r6H2+VyszdbbVmvK1D9GqZtyvY0NmOrztsg==" }, "@surma/rollup-plugin-off-main-thread": { "version": "2.2.3", @@ -21996,6 +22008,13 @@ "integrity": "sha512-AyKfFaUKVoBz4eB8XkU7H1R5HFnVsgq5ijqSdbXC0lES9PDK/J6LUQz6XUJq0mVVQF5k9kczSPOLMW3mszG0mQ==", "requires": { "@stencil/core": "~2.16.0" + }, + "dependencies": { + "@stencil/core": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz", + "integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw==" + } } }, "ipaddr.js": { diff --git a/static/usage/nav/modal-navigation/angular/app_component_html.md b/static/usage/nav/modal-navigation/angular/app_component_html.md new file mode 100644 index 00000000000..0a41e05a60c --- /dev/null +++ b/static/usage/nav/modal-navigation/angular/app_component_html.md @@ -0,0 +1,25 @@ +```html + + + Modal Navigation + + + + Open Modal + + + + + Modal + + Close + + + + + + + + + +``` diff --git a/static/usage/nav/modal-navigation/angular/app_component_ts.md b/static/usage/nav/modal-navigation/angular/app_component_ts.md new file mode 100644 index 00000000000..4d5bc2bd1c5 --- /dev/null +++ b/static/usage/nav/modal-navigation/angular/app_component_ts.md @@ -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); + } +} +``` diff --git a/static/usage/nav/modal-navigation/angular/app_module_ts.md b/static/usage/nav/modal-navigation/angular/app_module_ts.md new file mode 100644 index 00000000000..17eb272293f --- /dev/null +++ b/static/usage/nav/modal-navigation/angular/app_module_ts.md @@ -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 {} +``` diff --git a/static/usage/nav/modal-navigation/angular/page_one_component_ts.md b/static/usage/nav/modal-navigation/angular/page_one_component_ts.md new file mode 100644 index 00000000000..3c9ec863d04 --- /dev/null +++ b/static/usage/nav/modal-navigation/angular/page_one_component_ts.md @@ -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: ` + +

Page One

+ Go to Page Two +
+ `, +}) +export class PageOneComponent { + constructor(private nav: IonNav) {} + + navigateToPageTwo() { + this.nav.push(PageTwoComponent); + } +} +``` diff --git a/static/usage/nav/modal-navigation/angular/page_three_component_ts.md b/static/usage/nav/modal-navigation/angular/page_three_component_ts.md new file mode 100644 index 00000000000..5b1b70c3474 --- /dev/null +++ b/static/usage/nav/modal-navigation/angular/page_three_component_ts.md @@ -0,0 +1,26 @@ +```ts +import { Component } from '@angular/core'; +import { IonNav } from '@ionic/angular'; + +@Component({ + selector: 'app-page-one', + template: ` + +

Page Three

+ Go Back + Go to Root +
+ `, +}) +export class PageThreeComponent { + constructor(private nav: IonNav) {} + + navigateBack() { + this.nav.pop(); + } + + navigateToRoot() { + this.nav.popToRoot(); + } +} +``` diff --git a/static/usage/nav/modal-navigation/angular/page_two_component_ts.md b/static/usage/nav/modal-navigation/angular/page_two_component_ts.md new file mode 100644 index 00000000000..0cd5713c062 --- /dev/null +++ b/static/usage/nav/modal-navigation/angular/page_two_component_ts.md @@ -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: ` + +

Page Two

+ Go to Page Three +
+ `, +}) +export class PageTwoComponent { + component = PageThreeComponent; + + constructor(private nav: IonNav) {} + + navigateToPageThree() { + this.nav.push(PageThreeComponent); + } +} +``` diff --git a/static/usage/nav/modal-navigation/demo.html b/static/usage/nav/modal-navigation/demo.html new file mode 100644 index 00000000000..9ef92b54a39 --- /dev/null +++ b/static/usage/nav/modal-navigation/demo.html @@ -0,0 +1,106 @@ + + + + + + + + Nav | Modal Navigation + + + + + + + + + + + Modal Navigation + + + + Open Modal + + + + Modal + + + Close + + + + + + + + + + + + + + + + diff --git a/static/usage/nav/modal-navigation/index.md b/static/usage/nav/modal-navigation/index.md new file mode 100644 index 00000000000..5821f957c0c --- /dev/null +++ b/static/usage/nav/modal-navigation/index.md @@ -0,0 +1,54 @@ +import Playground from '@site/src/components/global/Playground'; + +import javascript from './javascript.md'; + +import angular_app_module_ts from './angular/app_module_ts.md'; +import angular_app_component_ts from './angular/app_component_ts.md'; +import angular_app_component_html from './angular/app_component_html.md'; +import angular_page_one_component_ts from './angular/page_one_component_ts.md'; +import angular_page_two_component_ts from './angular/page_two_component_ts.md'; +import angular_page_three_component_ts from './angular/page_three_component_ts.md'; + +import react_main_tsx from './react/main_tsx.md'; +import react_page_one_tsx from './react/page_one_tsx.md'; +import react_page_two_tsx from './react/page_two_tsx.md'; +import react_page_three_tsx from './react/page_three_tsx.md'; + +import vue_example from './vue/example_vue.md'; +import vue_page_one from './vue/page_one_vue.md'; +import vue_page_two from './vue/page_two_vue.md'; +import vue_page_three from './vue/page_three_vue.md'; + + diff --git a/static/usage/nav/modal-navigation/javascript.md b/static/usage/nav/modal-navigation/javascript.md new file mode 100644 index 00000000000..c6e571959a5 --- /dev/null +++ b/static/usage/nav/modal-navigation/javascript.md @@ -0,0 +1,86 @@ +```html + + + + Modal Navigation + + + + Open Modal + + + + Modal + + Close + + + + + + + + + + + +``` diff --git a/static/usage/nav/modal-navigation/react/main_tsx.md b/static/usage/nav/modal-navigation/react/main_tsx.md new file mode 100644 index 00000000000..be4c01e1972 --- /dev/null +++ b/static/usage/nav/modal-navigation/react/main_tsx.md @@ -0,0 +1,60 @@ +```tsx +import React, { useRef } from 'react'; +import { + IonNav, + IonPage, + IonHeader, + IonToolbar, + IonTitle, + IonButton, + IonButtons, + IonContent, + IonModal, +} from '@ionic/react'; + +import PageOne from './page-one'; + +function Example() { + const nav = useRef(null); + const modal = useRef(null); + + const didPresent = () => { + if (nav.current) { + nav.current.setRoot(PageOne, { nav: nav.current }); + } + }; + + const dismiss = () => { + if (modal.current) { + modal.current.dismiss(); + } + }; + + return ( + + + + Modal Navigation + + + + Open Modal + + + + Modal + + Close + + + + + + + + + + ); +} +export default Example; +``` diff --git a/static/usage/nav/modal-navigation/react/page_one_tsx.md b/static/usage/nav/modal-navigation/react/page_one_tsx.md new file mode 100644 index 00000000000..ce5c266e21b --- /dev/null +++ b/static/usage/nav/modal-navigation/react/page_one_tsx.md @@ -0,0 +1,18 @@ +```tsx +import React from 'react'; +import { IonButton, IonContent } from '@ionic/react'; + +import PageTwo from './page-two'; + +function PageOne({ nav }: { nav: HTMLIonNavElement }) { + const navigateToPageTwo = () => nav.push(PageTwo, { nav }); + return ( + +

Page One

+ Go to Page Two +
+ ); +} + +export default PageOne; +``` diff --git a/static/usage/nav/modal-navigation/react/page_three_tsx.md b/static/usage/nav/modal-navigation/react/page_three_tsx.md new file mode 100644 index 00000000000..3613967edfd --- /dev/null +++ b/static/usage/nav/modal-navigation/react/page_three_tsx.md @@ -0,0 +1,19 @@ +```tsx +import React from 'react'; +import { IonButton, IonContent } from '@ionic/react'; + +function PageThree({ nav }: { nav: HTMLIonNavElement }) { + const navigateBack = () => nav.pop(); + const navigateToRoot = () => nav.popToRoot(); + + return ( + +

Page Three

+ Go Back + Go to Root +
+ ); +} + +export default PageThree; +``` diff --git a/static/usage/nav/modal-navigation/react/page_two_tsx.md b/static/usage/nav/modal-navigation/react/page_two_tsx.md new file mode 100644 index 00000000000..48562bd23cd --- /dev/null +++ b/static/usage/nav/modal-navigation/react/page_two_tsx.md @@ -0,0 +1,19 @@ +```tsx +import React from 'react'; +import { IonButton, IonContent } from '@ionic/react'; + +import PageThree from './page-three'; + +function PageTwo({ nav }: { nav: HTMLIonNavElement }) { + const navigateToPageThree = () => nav.push(PageThree, { nav }); + + return ( + +

Page Two

+ Go to Page Three +
+ ); +} + +export default PageTwo; +``` diff --git a/static/usage/nav/modal-navigation/vue/example_vue.md b/static/usage/nav/modal-navigation/vue/example_vue.md new file mode 100644 index 00000000000..018fb3369d2 --- /dev/null +++ b/static/usage/nav/modal-navigation/vue/example_vue.md @@ -0,0 +1,60 @@ +```html + + + +``` diff --git a/static/usage/nav/modal-navigation/vue/page_one_vue.md b/static/usage/nav/modal-navigation/vue/page_one_vue.md new file mode 100644 index 00000000000..94613725139 --- /dev/null +++ b/static/usage/nav/modal-navigation/vue/page_one_vue.md @@ -0,0 +1,24 @@ +```html + + + +``` diff --git a/static/usage/nav/modal-navigation/vue/page_three_vue.md b/static/usage/nav/modal-navigation/vue/page_three_vue.md new file mode 100644 index 00000000000..9dde8817996 --- /dev/null +++ b/static/usage/nav/modal-navigation/vue/page_three_vue.md @@ -0,0 +1,28 @@ +```html + + + +``` diff --git a/static/usage/nav/modal-navigation/vue/page_two_vue.md b/static/usage/nav/modal-navigation/vue/page_two_vue.md new file mode 100644 index 00000000000..737fa71158b --- /dev/null +++ b/static/usage/nav/modal-navigation/vue/page_two_vue.md @@ -0,0 +1,24 @@ +```html + + + +``` From 8a168d779017a1d4e8524d7609acdc6371fb9edb Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Wed, 17 Aug 2022 12:12:40 -0400 Subject: [PATCH 4/6] fix(): clean-up examples --- .../usage/nav/modal-navigation/angular/app_module_ts.md | 3 ++- .../{app_component_html.md => example_component_html.md} | 2 +- .../{app_component_ts.md => example_component_ts.md} | 6 +++--- static/usage/nav/modal-navigation/index.md | 9 +++++---- static/usage/nav/modal-navigation/javascript.md | 2 +- static/usage/nav/modal-navigation/react/main_tsx.md | 2 +- static/usage/nav/modal-navigation/vue/example_vue.md | 2 +- static/usage/nav/nav-link/angular/app_module_ts.md | 3 ++- .../{app_component_html.md => example_component_html.md} | 0 .../{app_component_ts.md => example_component_ts.md} | 6 +++--- static/usage/nav/nav-link/index.md | 8 ++++---- 11 files changed, 23 insertions(+), 20 deletions(-) rename static/usage/nav/modal-navigation/angular/{app_component_html.md => example_component_html.md} (94%) rename static/usage/nav/modal-navigation/angular/{app_component_ts.md => example_component_ts.md} (74%) rename static/usage/nav/nav-link/angular/{app_component_html.md => example_component_html.md} (100%) rename static/usage/nav/nav-link/angular/{app_component_ts.md => example_component_ts.md} (61%) diff --git a/static/usage/nav/modal-navigation/angular/app_module_ts.md b/static/usage/nav/modal-navigation/angular/app_module_ts.md index 17eb272293f..d3b8b44f6ce 100644 --- a/static/usage/nav/modal-navigation/angular/app_module_ts.md +++ b/static/usage/nav/modal-navigation/angular/app_module_ts.md @@ -6,6 +6,7 @@ import { RouterModule } from '@angular/router'; import { IonicModule } from '@ionic/angular'; import { AppComponent } from './app.component'; +import { ExampleComponent } from './example.component'; import { PageOneComponent } from './page-one.component'; import { PageTwoComponent } from './page-two.component'; @@ -13,7 +14,7 @@ import { PageThreeComponent } from './page-three.component'; @NgModule({ imports: [BrowserModule, RouterModule.forRoot([]), IonicModule.forRoot({})], - declarations: [AppComponent, PageOneComponent, PageTwoComponent, PageThreeComponent], + declarations: [AppComponent, ExampleComponent, PageOneComponent, PageTwoComponent, PageThreeComponent], bootstrap: [AppComponent], }) export class AppModule {} diff --git a/static/usage/nav/modal-navigation/angular/app_component_html.md b/static/usage/nav/modal-navigation/angular/example_component_html.md similarity index 94% rename from static/usage/nav/modal-navigation/angular/app_component_html.md rename to static/usage/nav/modal-navigation/angular/example_component_html.md index 0a41e05a60c..06d46334df5 100644 --- a/static/usage/nav/modal-navigation/angular/app_component_html.md +++ b/static/usage/nav/modal-navigation/angular/example_component_html.md @@ -4,7 +4,7 @@ Modal Navigation - + Open Modal diff --git a/static/usage/nav/modal-navigation/angular/app_component_ts.md b/static/usage/nav/modal-navigation/angular/example_component_ts.md similarity index 74% rename from static/usage/nav/modal-navigation/angular/app_component_ts.md rename to static/usage/nav/modal-navigation/angular/example_component_ts.md index 4d5bc2bd1c5..366dc7e246d 100644 --- a/static/usage/nav/modal-navigation/angular/app_component_ts.md +++ b/static/usage/nav/modal-navigation/angular/example_component_ts.md @@ -5,10 +5,10 @@ import { IonNav } from '@ionic/angular'; import { PageOneComponent } from './page-one.component'; @Component({ - selector: 'app-root', - templateUrl: 'app.component.html', + selector: 'app-example', + templateUrl: 'example.component.html', }) -export class AppComponent { +export class ExampleComponent { @ViewChild('nav') private nav: IonNav; onWillPresent() { diff --git a/static/usage/nav/modal-navigation/index.md b/static/usage/nav/modal-navigation/index.md index 5821f957c0c..55cfafaeeda 100644 --- a/static/usage/nav/modal-navigation/index.md +++ b/static/usage/nav/modal-navigation/index.md @@ -3,8 +3,8 @@ import Playground from '@site/src/components/global/Playground'; import javascript from './javascript.md'; import angular_app_module_ts from './angular/app_module_ts.md'; -import angular_app_component_ts from './angular/app_component_ts.md'; -import angular_app_component_html from './angular/app_component_html.md'; +import angular_example_component_ts from './angular/example_component_ts.md'; +import angular_example_component_html from './angular/example_component_html.md'; import angular_page_one_component_ts from './angular/page_one_component_ts.md'; import angular_page_two_component_ts from './angular/page_two_component_ts.md'; import angular_page_three_component_ts from './angular/page_three_component_ts.md'; @@ -24,8 +24,8 @@ import vue_page_three from './vue/page_three_vue.md'; javascript, angular: { files: { - 'src/app/app.component.html': angular_app_component_html, - 'src/app/app.component.ts': angular_app_component_ts, + 'src/app/example.component.html': angular_example_component_html, + 'src/app/example.component.ts': angular_example_component_ts, 'src/app/page-one.component.ts': angular_page_one_component_ts, 'src/app/page-two.component.ts': angular_page_two_component_ts, 'src/app/page-three.component.ts': angular_page_three_component_ts, @@ -51,4 +51,5 @@ import vue_page_three from './vue/page_three_vue.md'; }} src="usage/nav/modal-navigation/demo.html" devicePreview + includeIonContent={false} /> diff --git a/static/usage/nav/modal-navigation/javascript.md b/static/usage/nav/modal-navigation/javascript.md index c6e571959a5..5fd4e9ef13a 100644 --- a/static/usage/nav/modal-navigation/javascript.md +++ b/static/usage/nav/modal-navigation/javascript.md @@ -5,7 +5,7 @@ Modal Navigation - + Open Modal diff --git a/static/usage/nav/modal-navigation/react/main_tsx.md b/static/usage/nav/modal-navigation/react/main_tsx.md index be4c01e1972..fc6901b3d6d 100644 --- a/static/usage/nav/modal-navigation/react/main_tsx.md +++ b/static/usage/nav/modal-navigation/react/main_tsx.md @@ -37,7 +37,7 @@ function Example() { Modal Navigation - + Open Modal diff --git a/static/usage/nav/modal-navigation/vue/example_vue.md b/static/usage/nav/modal-navigation/vue/example_vue.md index 018fb3369d2..ad5242e5c06 100644 --- a/static/usage/nav/modal-navigation/vue/example_vue.md +++ b/static/usage/nav/modal-navigation/vue/example_vue.md @@ -6,7 +6,7 @@ Modal Navigation - + Open Modal diff --git a/static/usage/nav/nav-link/angular/app_module_ts.md b/static/usage/nav/nav-link/angular/app_module_ts.md index 17eb272293f..d3b8b44f6ce 100644 --- a/static/usage/nav/nav-link/angular/app_module_ts.md +++ b/static/usage/nav/nav-link/angular/app_module_ts.md @@ -6,6 +6,7 @@ import { RouterModule } from '@angular/router'; import { IonicModule } from '@ionic/angular'; import { AppComponent } from './app.component'; +import { ExampleComponent } from './example.component'; import { PageOneComponent } from './page-one.component'; import { PageTwoComponent } from './page-two.component'; @@ -13,7 +14,7 @@ import { PageThreeComponent } from './page-three.component'; @NgModule({ imports: [BrowserModule, RouterModule.forRoot([]), IonicModule.forRoot({})], - declarations: [AppComponent, PageOneComponent, PageTwoComponent, PageThreeComponent], + declarations: [AppComponent, ExampleComponent, PageOneComponent, PageTwoComponent, PageThreeComponent], bootstrap: [AppComponent], }) export class AppModule {} diff --git a/static/usage/nav/nav-link/angular/app_component_html.md b/static/usage/nav/nav-link/angular/example_component_html.md similarity index 100% rename from static/usage/nav/nav-link/angular/app_component_html.md rename to static/usage/nav/nav-link/angular/example_component_html.md diff --git a/static/usage/nav/nav-link/angular/app_component_ts.md b/static/usage/nav/nav-link/angular/example_component_ts.md similarity index 61% rename from static/usage/nav/nav-link/angular/app_component_ts.md rename to static/usage/nav/nav-link/angular/example_component_ts.md index 472f41634da..b123a4858ce 100644 --- a/static/usage/nav/nav-link/angular/app_component_ts.md +++ b/static/usage/nav/nav-link/angular/example_component_ts.md @@ -4,10 +4,10 @@ import { Component } from '@angular/core'; import { PageOneComponent } from './page-one.component'; @Component({ - selector: 'app-root', - templateUrl: 'app.component.html', + selector: 'app-example', + templateUrl: 'example.component.html', }) -export class AppComponent { +export class ExampleComponent { component = PageOneComponent; } ``` diff --git a/static/usage/nav/nav-link/index.md b/static/usage/nav/nav-link/index.md index 07f88bf10f1..535155750f0 100644 --- a/static/usage/nav/nav-link/index.md +++ b/static/usage/nav/nav-link/index.md @@ -3,8 +3,8 @@ import Playground from '@site/src/components/global/Playground'; import javascript from './javascript.md'; import angular_app_module_ts from './angular/app_module_ts.md'; -import angular_app_component_html from './angular/app_component_html.md'; -import angular_app_component_ts from './angular/app_component_ts.md'; +import angular_example_component_html from './angular/example_component_html.md'; +import angular_example_component_ts from './angular/example_component_ts.md'; import angular_page_one_component_ts from './angular/page_one_component_ts.md'; import angular_page_two_component_ts from './angular/page_two_component_ts.md'; import angular_page_three_component_ts from './angular/page_three_component_ts.md'; @@ -24,8 +24,8 @@ import vue_page_three from './vue/page_three_vue.md'; javascript, angular: { files: { - 'src/app/app.component.html': angular_app_component_html, - 'src/app/app.component.ts': angular_app_component_ts, + 'src/app/example.component.html': angular_example_component_html, + 'src/app/example.component.ts': angular_example_component_ts, 'src/app/page-one.component.ts': angular_page_one_component_ts, 'src/app/page-two.component.ts': angular_page_two_component_ts, 'src/app/page-three.component.ts': angular_page_three_component_ts, From 2370f1d2665c1951ddc567ce5f4097bad3f09c80 Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Mon, 12 Aug 2024 17:46:37 -0400 Subject: [PATCH 5/6] chore: run prettier --- static/usage/nav/modal-navigation/demo.html | 154 ++++++++++---------- static/usage/nav/nav-link/demo.html | 65 ++++----- 2 files changed, 105 insertions(+), 114 deletions(-) diff --git a/static/usage/nav/modal-navigation/demo.html b/static/usage/nav/modal-navigation/demo.html index 9ef92b54a39..6485f99618c 100644 --- a/static/usage/nav/modal-navigation/demo.html +++ b/static/usage/nav/modal-navigation/demo.html @@ -1,106 +1,100 @@ - - - - - Nav | Modal Navigation - - - - - - - - - - - Modal Navigation - - - - Open Modal - - - - Modal - - - Close - - - - - - - - - - - - + + + + + + + + + Modal Navigation + + + + Open Modal + + + + Modal + + Close + + + + + + + + + + + - - + customElements.define('page-one', PageOne); + customElements.define('page-two', PageTwo); + customElements.define('page-three', PageThree); + + diff --git a/static/usage/nav/nav-link/demo.html b/static/usage/nav/nav-link/demo.html index d813dfe8a87..171067273b3 100644 --- a/static/usage/nav/nav-link/demo.html +++ b/static/usage/nav/nav-link/demo.html @@ -1,26 +1,25 @@ + + + + Nav | NavLink + + + + + - - - - Nav | NavLink - - - - - + + + + - - - - - - - - - + customElements.define('page-one', PageOne); + customElements.define('page-two', PageTwo); + customElements.define('page-three', PageThree); + + From f54644ef206fa99f48666ef9b93ad05e72539aaa Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Mon, 12 Aug 2024 17:56:21 -0400 Subject: [PATCH 6/6] fix: build --- docs/api/nav.md | 12 +-- .../modal-navigation/angular/app_module_ts.md | 21 ---- .../angular/example_component_html.md | 25 ----- .../angular/example_component_ts.md | 18 ---- .../angular/page_one_component_ts.md | 23 ---- .../angular/page_three_component_ts.md | 26 ----- .../angular/page_two_component_ts.md | 25 ----- static/usage/nav/modal-navigation/demo.html | 100 ------------------ static/usage/nav/modal-navigation/index.md | 55 ---------- .../usage/nav/modal-navigation/javascript.md | 86 --------------- .../nav/modal-navigation/react/main_tsx.md | 60 ----------- .../modal-navigation/react/page_one_tsx.md | 18 ---- .../modal-navigation/react/page_three_tsx.md | 19 ---- .../modal-navigation/react/page_two_tsx.md | 19 ---- .../nav/modal-navigation/vue/example_vue.md | 60 ----------- .../nav/modal-navigation/vue/page_one_vue.md | 24 ----- .../modal-navigation/vue/page_three_vue.md | 28 ----- .../nav/modal-navigation/vue/page_two_vue.md | 24 ----- .../nav/nav-link/angular/app_module_ts.md | 21 ---- .../angular/example_component_html.md | 3 - .../nav-link/angular/example_component_ts.md | 13 --- .../nav-link/angular/page_one_component_ts.md | 25 ----- .../angular/page_three_component_ts.md | 21 ---- .../nav-link/angular/page_two_component_ts.md | 30 ------ static/usage/nav/nav-link/demo.html | 81 -------------- static/usage/nav/nav-link/index.md | 54 ---------- static/usage/nav/nav-link/javascript.md | 67 ------------ static/usage/nav/nav-link/react/main_tsx.md | 11 -- .../usage/nav/nav-link/react/page_one_tsx.md | 26 ----- .../nav/nav-link/react/page_three_tsx.md | 24 ----- .../usage/nav/nav-link/react/page_two_tsx.md | 38 ------- static/usage/nav/nav-link/vue/example_vue.md | 19 ---- static/usage/nav/nav-link/vue/page_one_vue.md | 29 ----- .../usage/nav/nav-link/vue/page_three_vue.md | 23 ---- static/usage/nav/nav-link/vue/page_two_vue.md | 50 --------- 35 files changed, 2 insertions(+), 1176 deletions(-) delete mode 100644 static/usage/nav/modal-navigation/angular/app_module_ts.md delete mode 100644 static/usage/nav/modal-navigation/angular/example_component_html.md delete mode 100644 static/usage/nav/modal-navigation/angular/example_component_ts.md delete mode 100644 static/usage/nav/modal-navigation/angular/page_one_component_ts.md delete mode 100644 static/usage/nav/modal-navigation/angular/page_three_component_ts.md delete mode 100644 static/usage/nav/modal-navigation/angular/page_two_component_ts.md delete mode 100644 static/usage/nav/modal-navigation/demo.html delete mode 100644 static/usage/nav/modal-navigation/index.md delete mode 100644 static/usage/nav/modal-navigation/javascript.md delete mode 100644 static/usage/nav/modal-navigation/react/main_tsx.md delete mode 100644 static/usage/nav/modal-navigation/react/page_one_tsx.md delete mode 100644 static/usage/nav/modal-navigation/react/page_three_tsx.md delete mode 100644 static/usage/nav/modal-navigation/react/page_two_tsx.md delete mode 100644 static/usage/nav/modal-navigation/vue/example_vue.md delete mode 100644 static/usage/nav/modal-navigation/vue/page_one_vue.md delete mode 100644 static/usage/nav/modal-navigation/vue/page_three_vue.md delete mode 100644 static/usage/nav/modal-navigation/vue/page_two_vue.md delete mode 100644 static/usage/nav/nav-link/angular/app_module_ts.md delete mode 100644 static/usage/nav/nav-link/angular/example_component_html.md delete mode 100644 static/usage/nav/nav-link/angular/example_component_ts.md delete mode 100644 static/usage/nav/nav-link/angular/page_one_component_ts.md delete mode 100644 static/usage/nav/nav-link/angular/page_three_component_ts.md delete mode 100644 static/usage/nav/nav-link/angular/page_two_component_ts.md delete mode 100644 static/usage/nav/nav-link/demo.html delete mode 100644 static/usage/nav/nav-link/index.md delete mode 100644 static/usage/nav/nav-link/javascript.md delete mode 100644 static/usage/nav/nav-link/react/main_tsx.md delete mode 100644 static/usage/nav/nav-link/react/page_one_tsx.md delete mode 100644 static/usage/nav/nav-link/react/page_three_tsx.md delete mode 100644 static/usage/nav/nav-link/react/page_two_tsx.md delete mode 100644 static/usage/nav/nav-link/vue/example_vue.md delete mode 100644 static/usage/nav/nav-link/vue/page_one_vue.md delete mode 100644 static/usage/nav/nav-link/vue/page_three_vue.md delete mode 100644 static/usage/nav/nav-link/vue/page_two_vue.md diff --git a/docs/api/nav.md b/docs/api/nav.md index 9a5cbc8fa2e..ff8bba63acf 100644 --- a/docs/api/nav.md +++ b/docs/api/nav.md @@ -27,17 +27,9 @@ Unlike Router Outlet, Nav is not tied to a particular router. This means that if ## Using NavLink -NavLink is a simplified API when interacting with Nav. Developers can customize the component, pass along component properties, modify the direction of the route animation or define a custom animation when navigating. - -import NavLinkExample from '@site/static/usage/v8/nav/nav-link/index.md'; - - - -## Using NavLink - NavLink is a simplified API when interacting with Nav. Developers can customize the component, pass along component properties, modify the direction of the route animation or define a custom animation when navigating. -import NavLinkExample from '@site/static/usage/nav/nav-link/index.md'; +import NavLinkExample from '@site/static/usage/v8/nav/nav-link/index.md'; @@ -51,7 +43,7 @@ The example below uses a reference to Nav and the public method APIs to push and ::: -import ModalNavigationExample from '@site/static/usage/nav/modal-navigation/index.md'; +import ModalNavigationExample from '@site/static/usage/v8/nav/modal-navigation/index.md'; diff --git a/static/usage/nav/modal-navigation/angular/app_module_ts.md b/static/usage/nav/modal-navigation/angular/app_module_ts.md deleted file mode 100644 index d3b8b44f6ce..00000000000 --- a/static/usage/nav/modal-navigation/angular/app_module_ts.md +++ /dev/null @@ -1,21 +0,0 @@ -```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 { ExampleComponent } from './example.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, ExampleComponent, PageOneComponent, PageTwoComponent, PageThreeComponent], - bootstrap: [AppComponent], -}) -export class AppModule {} -``` diff --git a/static/usage/nav/modal-navigation/angular/example_component_html.md b/static/usage/nav/modal-navigation/angular/example_component_html.md deleted file mode 100644 index 06d46334df5..00000000000 --- a/static/usage/nav/modal-navigation/angular/example_component_html.md +++ /dev/null @@ -1,25 +0,0 @@ -```html - - - Modal Navigation - - - - Open Modal - - - - - Modal - - Close - - - - - - - - - -``` diff --git a/static/usage/nav/modal-navigation/angular/example_component_ts.md b/static/usage/nav/modal-navigation/angular/example_component_ts.md deleted file mode 100644 index 366dc7e246d..00000000000 --- a/static/usage/nav/modal-navigation/angular/example_component_ts.md +++ /dev/null @@ -1,18 +0,0 @@ -```ts -import { Component, ViewChild } from '@angular/core'; -import { IonNav } from '@ionic/angular'; - -import { PageOneComponent } from './page-one.component'; - -@Component({ - selector: 'app-example', - templateUrl: 'example.component.html', -}) -export class ExampleComponent { - @ViewChild('nav') private nav: IonNav; - - onWillPresent() { - this.nav.setRoot(PageOneComponent); - } -} -``` diff --git a/static/usage/nav/modal-navigation/angular/page_one_component_ts.md b/static/usage/nav/modal-navigation/angular/page_one_component_ts.md deleted file mode 100644 index 3c9ec863d04..00000000000 --- a/static/usage/nav/modal-navigation/angular/page_one_component_ts.md +++ /dev/null @@ -1,23 +0,0 @@ -```ts -import { Component } from '@angular/core'; -import { IonNav } from '@ionic/angular'; - -import { PageTwoComponent } from './page-two.component'; - -@Component({ - selector: 'app-page-one', - template: ` - -

Page One

- Go to Page Two -
- `, -}) -export class PageOneComponent { - constructor(private nav: IonNav) {} - - navigateToPageTwo() { - this.nav.push(PageTwoComponent); - } -} -``` diff --git a/static/usage/nav/modal-navigation/angular/page_three_component_ts.md b/static/usage/nav/modal-navigation/angular/page_three_component_ts.md deleted file mode 100644 index 5b1b70c3474..00000000000 --- a/static/usage/nav/modal-navigation/angular/page_three_component_ts.md +++ /dev/null @@ -1,26 +0,0 @@ -```ts -import { Component } from '@angular/core'; -import { IonNav } from '@ionic/angular'; - -@Component({ - selector: 'app-page-one', - template: ` - -

Page Three

- Go Back - Go to Root -
- `, -}) -export class PageThreeComponent { - constructor(private nav: IonNav) {} - - navigateBack() { - this.nav.pop(); - } - - navigateToRoot() { - this.nav.popToRoot(); - } -} -``` diff --git a/static/usage/nav/modal-navigation/angular/page_two_component_ts.md b/static/usage/nav/modal-navigation/angular/page_two_component_ts.md deleted file mode 100644 index 0cd5713c062..00000000000 --- a/static/usage/nav/modal-navigation/angular/page_two_component_ts.md +++ /dev/null @@ -1,25 +0,0 @@ -```ts -import { Component } from '@angular/core'; -import { IonNav } from '@ionic/angular'; - -import { PageThreeComponent } from './page-three.component'; - -@Component({ - selector: 'app-page-two', - template: ` - -

Page Two

- Go to Page Three -
- `, -}) -export class PageTwoComponent { - component = PageThreeComponent; - - constructor(private nav: IonNav) {} - - navigateToPageThree() { - this.nav.push(PageThreeComponent); - } -} -``` diff --git a/static/usage/nav/modal-navigation/demo.html b/static/usage/nav/modal-navigation/demo.html deleted file mode 100644 index 6485f99618c..00000000000 --- a/static/usage/nav/modal-navigation/demo.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - Nav | Modal Navigation - - - - - - - - - - - Modal Navigation - - - - Open Modal - - - - Modal - - Close - - - - - - - - - - - - - diff --git a/static/usage/nav/modal-navigation/index.md b/static/usage/nav/modal-navigation/index.md deleted file mode 100644 index 55cfafaeeda..00000000000 --- a/static/usage/nav/modal-navigation/index.md +++ /dev/null @@ -1,55 +0,0 @@ -import Playground from '@site/src/components/global/Playground'; - -import javascript from './javascript.md'; - -import angular_app_module_ts from './angular/app_module_ts.md'; -import angular_example_component_ts from './angular/example_component_ts.md'; -import angular_example_component_html from './angular/example_component_html.md'; -import angular_page_one_component_ts from './angular/page_one_component_ts.md'; -import angular_page_two_component_ts from './angular/page_two_component_ts.md'; -import angular_page_three_component_ts from './angular/page_three_component_ts.md'; - -import react_main_tsx from './react/main_tsx.md'; -import react_page_one_tsx from './react/page_one_tsx.md'; -import react_page_two_tsx from './react/page_two_tsx.md'; -import react_page_three_tsx from './react/page_three_tsx.md'; - -import vue_example from './vue/example_vue.md'; -import vue_page_one from './vue/page_one_vue.md'; -import vue_page_two from './vue/page_two_vue.md'; -import vue_page_three from './vue/page_three_vue.md'; - - diff --git a/static/usage/nav/modal-navigation/javascript.md b/static/usage/nav/modal-navigation/javascript.md deleted file mode 100644 index 5fd4e9ef13a..00000000000 --- a/static/usage/nav/modal-navigation/javascript.md +++ /dev/null @@ -1,86 +0,0 @@ -```html - - - - Modal Navigation - - - - Open Modal - - - - Modal - - Close - - - - - - - - - - - -``` diff --git a/static/usage/nav/modal-navigation/react/main_tsx.md b/static/usage/nav/modal-navigation/react/main_tsx.md deleted file mode 100644 index fc6901b3d6d..00000000000 --- a/static/usage/nav/modal-navigation/react/main_tsx.md +++ /dev/null @@ -1,60 +0,0 @@ -```tsx -import React, { useRef } from 'react'; -import { - IonNav, - IonPage, - IonHeader, - IonToolbar, - IonTitle, - IonButton, - IonButtons, - IonContent, - IonModal, -} from '@ionic/react'; - -import PageOne from './page-one'; - -function Example() { - const nav = useRef(null); - const modal = useRef(null); - - const didPresent = () => { - if (nav.current) { - nav.current.setRoot(PageOne, { nav: nav.current }); - } - }; - - const dismiss = () => { - if (modal.current) { - modal.current.dismiss(); - } - }; - - return ( - - - - Modal Navigation - - - - Open Modal - - - - Modal - - Close - - - - - - - - - - ); -} -export default Example; -``` diff --git a/static/usage/nav/modal-navigation/react/page_one_tsx.md b/static/usage/nav/modal-navigation/react/page_one_tsx.md deleted file mode 100644 index ce5c266e21b..00000000000 --- a/static/usage/nav/modal-navigation/react/page_one_tsx.md +++ /dev/null @@ -1,18 +0,0 @@ -```tsx -import React from 'react'; -import { IonButton, IonContent } from '@ionic/react'; - -import PageTwo from './page-two'; - -function PageOne({ nav }: { nav: HTMLIonNavElement }) { - const navigateToPageTwo = () => nav.push(PageTwo, { nav }); - return ( - -

Page One

- Go to Page Two -
- ); -} - -export default PageOne; -``` diff --git a/static/usage/nav/modal-navigation/react/page_three_tsx.md b/static/usage/nav/modal-navigation/react/page_three_tsx.md deleted file mode 100644 index 3613967edfd..00000000000 --- a/static/usage/nav/modal-navigation/react/page_three_tsx.md +++ /dev/null @@ -1,19 +0,0 @@ -```tsx -import React from 'react'; -import { IonButton, IonContent } from '@ionic/react'; - -function PageThree({ nav }: { nav: HTMLIonNavElement }) { - const navigateBack = () => nav.pop(); - const navigateToRoot = () => nav.popToRoot(); - - return ( - -

Page Three

- Go Back - Go to Root -
- ); -} - -export default PageThree; -``` diff --git a/static/usage/nav/modal-navigation/react/page_two_tsx.md b/static/usage/nav/modal-navigation/react/page_two_tsx.md deleted file mode 100644 index 48562bd23cd..00000000000 --- a/static/usage/nav/modal-navigation/react/page_two_tsx.md +++ /dev/null @@ -1,19 +0,0 @@ -```tsx -import React from 'react'; -import { IonButton, IonContent } from '@ionic/react'; - -import PageThree from './page-three'; - -function PageTwo({ nav }: { nav: HTMLIonNavElement }) { - const navigateToPageThree = () => nav.push(PageThree, { nav }); - - return ( - -

Page Two

- Go to Page Three -
- ); -} - -export default PageTwo; -``` diff --git a/static/usage/nav/modal-navigation/vue/example_vue.md b/static/usage/nav/modal-navigation/vue/example_vue.md deleted file mode 100644 index ad5242e5c06..00000000000 --- a/static/usage/nav/modal-navigation/vue/example_vue.md +++ /dev/null @@ -1,60 +0,0 @@ -```html - - - -``` diff --git a/static/usage/nav/modal-navigation/vue/page_one_vue.md b/static/usage/nav/modal-navigation/vue/page_one_vue.md deleted file mode 100644 index 94613725139..00000000000 --- a/static/usage/nav/modal-navigation/vue/page_one_vue.md +++ /dev/null @@ -1,24 +0,0 @@ -```html - - - -``` diff --git a/static/usage/nav/modal-navigation/vue/page_three_vue.md b/static/usage/nav/modal-navigation/vue/page_three_vue.md deleted file mode 100644 index 9dde8817996..00000000000 --- a/static/usage/nav/modal-navigation/vue/page_three_vue.md +++ /dev/null @@ -1,28 +0,0 @@ -```html - - - -``` diff --git a/static/usage/nav/modal-navigation/vue/page_two_vue.md b/static/usage/nav/modal-navigation/vue/page_two_vue.md deleted file mode 100644 index 737fa71158b..00000000000 --- a/static/usage/nav/modal-navigation/vue/page_two_vue.md +++ /dev/null @@ -1,24 +0,0 @@ -```html - - - -``` diff --git a/static/usage/nav/nav-link/angular/app_module_ts.md b/static/usage/nav/nav-link/angular/app_module_ts.md deleted file mode 100644 index d3b8b44f6ce..00000000000 --- a/static/usage/nav/nav-link/angular/app_module_ts.md +++ /dev/null @@ -1,21 +0,0 @@ -```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 { ExampleComponent } from './example.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, ExampleComponent, PageOneComponent, PageTwoComponent, PageThreeComponent], - bootstrap: [AppComponent], -}) -export class AppModule {} -``` diff --git a/static/usage/nav/nav-link/angular/example_component_html.md b/static/usage/nav/nav-link/angular/example_component_html.md deleted file mode 100644 index 1534ea3a6ec..00000000000 --- a/static/usage/nav/nav-link/angular/example_component_html.md +++ /dev/null @@ -1,3 +0,0 @@ -```html - -``` diff --git a/static/usage/nav/nav-link/angular/example_component_ts.md b/static/usage/nav/nav-link/angular/example_component_ts.md deleted file mode 100644 index b123a4858ce..00000000000 --- a/static/usage/nav/nav-link/angular/example_component_ts.md +++ /dev/null @@ -1,13 +0,0 @@ -```ts -import { Component } from '@angular/core'; - -import { PageOneComponent } from './page-one.component'; - -@Component({ - selector: 'app-example', - templateUrl: 'example.component.html', -}) -export class ExampleComponent { - component = PageOneComponent; -} -``` diff --git a/static/usage/nav/nav-link/angular/page_one_component_ts.md b/static/usage/nav/nav-link/angular/page_one_component_ts.md deleted file mode 100644 index 06c42b342cf..00000000000 --- a/static/usage/nav/nav-link/angular/page_one_component_ts.md +++ /dev/null @@ -1,25 +0,0 @@ -```ts -import { Component } from '@angular/core'; - -import { PageTwoComponent } from './page-two.component'; - -@Component({ - selector: 'app-page-one', - template: ` - - - Page One - - - -

Page One

- - Go to Page Two - -
- `, -}) -export class PageOneComponent { - component = PageTwoComponent; -} -``` diff --git a/static/usage/nav/nav-link/angular/page_three_component_ts.md b/static/usage/nav/nav-link/angular/page_three_component_ts.md deleted file mode 100644 index d9e95ed7218..00000000000 --- a/static/usage/nav/nav-link/angular/page_three_component_ts.md +++ /dev/null @@ -1,21 +0,0 @@ -```ts -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-page-one', - template: ` - - - - - - Page Three - - - -

Page Three

-
- `, -}) -export class PageThreeComponent {} -``` diff --git a/static/usage/nav/nav-link/angular/page_two_component_ts.md b/static/usage/nav/nav-link/angular/page_two_component_ts.md deleted file mode 100644 index d6edd90a593..00000000000 --- a/static/usage/nav/nav-link/angular/page_two_component_ts.md +++ /dev/null @@ -1,30 +0,0 @@ -```ts -import { Component } from '@angular/core'; - -import { PageThreeComponent } from './page-three.component'; - -@Component({ - selector: 'app-page-two', - template: ` - - - - - - Page Two - - - -

Page Two

-
- - Go to Page Three - -
-
- `, -}) -export class PageTwoComponent { - component = PageThreeComponent; -} -``` diff --git a/static/usage/nav/nav-link/demo.html b/static/usage/nav/nav-link/demo.html deleted file mode 100644 index 171067273b3..00000000000 --- a/static/usage/nav/nav-link/demo.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - Nav | NavLink - - - - - - - - - - - - - - diff --git a/static/usage/nav/nav-link/index.md b/static/usage/nav/nav-link/index.md deleted file mode 100644 index 535155750f0..00000000000 --- a/static/usage/nav/nav-link/index.md +++ /dev/null @@ -1,54 +0,0 @@ -import Playground from '@site/src/components/global/Playground'; - -import javascript from './javascript.md'; - -import angular_app_module_ts from './angular/app_module_ts.md'; -import angular_example_component_html from './angular/example_component_html.md'; -import angular_example_component_ts from './angular/example_component_ts.md'; -import angular_page_one_component_ts from './angular/page_one_component_ts.md'; -import angular_page_two_component_ts from './angular/page_two_component_ts.md'; -import angular_page_three_component_ts from './angular/page_three_component_ts.md'; - -import react_main_tsx from './react/main_tsx.md'; -import react_page_one_tsx from './react/page_one_tsx.md'; -import react_page_two_tsx from './react/page_two_tsx.md'; -import react_page_three_tsx from './react/page_three_tsx.md'; - -import vue_example from './vue/example_vue.md'; -import vue_page_one from './vue/page_one_vue.md'; -import vue_page_two from './vue/page_two_vue.md'; -import vue_page_three from './vue/page_three_vue.md'; - - diff --git a/static/usage/nav/nav-link/javascript.md b/static/usage/nav/nav-link/javascript.md deleted file mode 100644 index faf19dc3ca7..00000000000 --- a/static/usage/nav/nav-link/javascript.md +++ /dev/null @@ -1,67 +0,0 @@ -```html - - - - - -``` diff --git a/static/usage/nav/nav-link/react/main_tsx.md b/static/usage/nav/nav-link/react/main_tsx.md deleted file mode 100644 index f6196a362e9..00000000000 --- a/static/usage/nav/nav-link/react/main_tsx.md +++ /dev/null @@ -1,11 +0,0 @@ -```tsx -import React from 'react'; -import { IonNav } from '@ionic/react'; - -import PageOne from './page-one'; - -function Example() { - return }>; -} -export default Example; -``` diff --git a/static/usage/nav/nav-link/react/page_one_tsx.md b/static/usage/nav/nav-link/react/page_one_tsx.md deleted file mode 100644 index 303ad18547a..00000000000 --- a/static/usage/nav/nav-link/react/page_one_tsx.md +++ /dev/null @@ -1,26 +0,0 @@ -```tsx -import React from 'react'; -import { IonButton, IonHeader, IonContent, IonNavLink, IonToolbar, IonTitle } from '@ionic/react'; - -import PageTwo from './page-two'; - -function PageOne() { - return ( - <> - - - Page One - - - -

Page One

- }> - Go to Page Two - -
- - ); -} - -export default PageOne; -``` diff --git a/static/usage/nav/nav-link/react/page_three_tsx.md b/static/usage/nav/nav-link/react/page_three_tsx.md deleted file mode 100644 index 451d30db85d..00000000000 --- a/static/usage/nav/nav-link/react/page_three_tsx.md +++ /dev/null @@ -1,24 +0,0 @@ -```tsx -import React from 'react'; -import { IonBackButton, IonButtons, IonHeader, IonContent, IonToolbar, IonTitle } from '@ionic/react'; - -function PageThree() { - return ( - <> - - - - - - Page Three - - - -

Page Three

-
- - ); -} - -export default PageThree; -``` diff --git a/static/usage/nav/nav-link/react/page_two_tsx.md b/static/usage/nav/nav-link/react/page_two_tsx.md deleted file mode 100644 index fd3f8764873..00000000000 --- a/static/usage/nav/nav-link/react/page_two_tsx.md +++ /dev/null @@ -1,38 +0,0 @@ -```tsx -import React from 'react'; -import { - IonBackButton, - IonButtons, - IonButton, - IonHeader, - IonContent, - IonNavLink, - IonToolbar, - IonTitle, -} from '@ionic/react'; - -import PageThree from './page-three'; - -function PageTwo() { - return ( - <> - - - - - - Page Two - - - -

Page Two

- }> - Go to Page Three - -
- - ); -} - -export default PageTwo; -``` diff --git a/static/usage/nav/nav-link/vue/example_vue.md b/static/usage/nav/nav-link/vue/example_vue.md deleted file mode 100644 index ec054a80749..00000000000 --- a/static/usage/nav/nav-link/vue/example_vue.md +++ /dev/null @@ -1,19 +0,0 @@ -```html - - - -``` diff --git a/static/usage/nav/nav-link/vue/page_one_vue.md b/static/usage/nav/nav-link/vue/page_one_vue.md deleted file mode 100644 index f3635e1db37..00000000000 --- a/static/usage/nav/nav-link/vue/page_one_vue.md +++ /dev/null @@ -1,29 +0,0 @@ -```html - - - -``` diff --git a/static/usage/nav/nav-link/vue/page_three_vue.md b/static/usage/nav/nav-link/vue/page_three_vue.md deleted file mode 100644 index 54d6acf24c9..00000000000 --- a/static/usage/nav/nav-link/vue/page_three_vue.md +++ /dev/null @@ -1,23 +0,0 @@ -```html - - - -``` diff --git a/static/usage/nav/nav-link/vue/page_two_vue.md b/static/usage/nav/nav-link/vue/page_two_vue.md deleted file mode 100644 index 0d736d69c88..00000000000 --- a/static/usage/nav/nav-link/vue/page_two_vue.md +++ /dev/null @@ -1,50 +0,0 @@ -```html - - - -```