Skip to content

Commit 946a71e

Browse files
committed
Adds separate menu item for ionic official components
1 parent b20470d commit 946a71e

39 files changed

+107
-57
lines changed

src/app/app.component.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
import { IonicOfficialComponentsPage } from '../pages/ionic-official-components/ionic-official-components';
12
import { LoginListPage } from '../pages/login/login';
23
import { ThemingPage } from '../pages/theming/theming';
34
import { AppState } from './app.global';
45
import { SlidesPage } from '../pages/slide/slide';
5-
import { AlertsPage } from '../pages/alert/alert';
66
import { ModalsPage } from '../pages/modal/modal';
77
import { ListsPage } from '../pages/list/list';
8-
import { ButtonsListPage } from '../pages/button/button';
9-
import { CardListPage } from '../pages/card/card';
108
import { PopupMenuListPage } from '../pages/popup-menu/popup-menu';
119
import { MiscellaneousListPage } from '../pages/miscellaneous/miscellaneous';
1210
import { ProfileListPage } from '../pages/profile/profile';
@@ -32,18 +30,16 @@ export class MyApp {
3230

3331
this.pages = [
3432
{ title: 'Home', component: HomePage },
35-
{ title: 'Theming', component: ThemingPage },
36-
{ title: 'Buttons', component: ButtonsListPage },
37-
{ title: 'Alerts', component: AlertsPage },
33+
{ title: 'Ionic Official Components', component: IonicOfficialComponentsPage },
34+
{ title: 'Login', component: LoginListPage },
3835
{ title: 'Lists', component: ListsPage },
39-
{ title: 'Cards', component: CardListPage },
4036
{ title: 'Modals', component: ModalsPage },
41-
// Removed for now as there were breaking changes in slides
42-
{ title: 'Slides', component: SlidesPage },
37+
{ title: 'Miscellaneous', component: MiscellaneousListPage },
4338
{ title: 'Popup Menu', component: PopupMenuListPage },
4439
{ title: 'Profile', component: ProfileListPage },
45-
{ title: 'Login', component: LoginListPage },
46-
{ title: 'Miscellaneous', component: MiscellaneousListPage }
40+
// Removed for now as there were breaking changes in slides
41+
// { title: 'Slides', component: SlidesPage },
42+
{ title: 'Theming', component: ThemingPage },
4743
];
4844

4945
}

src/app/app.imports.ts

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { IonicOfficialComponentsPage } from '../pages/ionic-official-components/ionic-official-components';
12
import { ChartsPage } from '../pages/miscellaneous/charts/charts';
23
// Global state (used for theming)
34
import { AppState } from './app.global';
@@ -32,18 +33,18 @@ import { PopupMenuListPage } from '../pages/popup-menu/popup-menu';
3233
import { PopupMenuOnePage } from '../pages/popup-menu/popup-menu-one/popup-menu-one';
3334

3435
// Cards list
35-
import { CardListPage } from '../pages/card/card';
36-
import { CardSocialPage } from '../pages/card/card-social/card-social';
37-
import { CardImagePage } from '../pages/card/card-image/card-image';
38-
import { CardMapPage } from '../pages/card/card-map/card-map';
39-
import { CardBackgroundPage } from '../pages/card/card-background/card-background';
40-
import { CardBadgePage } from '../pages/card/card-badge/card-badge';
36+
import { CardListPage } from '../pages/ionic-official-components/card/card';
37+
import { CardSocialPage } from '../pages/ionic-official-components/card/card-social/card-social';
38+
import { CardImagePage } from '../pages/ionic-official-components/card/card-image/card-image';
39+
import { CardMapPage } from '../pages/ionic-official-components/card/card-map/card-map';
40+
import { CardBackgroundPage } from '../pages/ionic-official-components/card/card-background/card-background';
41+
import { CardBadgePage } from '../pages/ionic-official-components/card/card-badge/card-badge';
4142

4243
// Buttons list
43-
import { ButtonsListPage } from '../pages/button/button';
44-
import { ButtonStylesPage } from '../pages/button/button-styles/button-styles';
45-
import { IconButtonsPage } from '../pages/button/icon-buttons/icon-buttons';
46-
import { ButtonComponentsPage } from '../pages/button/button-components/button-components';
44+
import { ButtonsListPage } from '../pages/ionic-official-components/button/button';
45+
import { ButtonStylesPage } from '../pages/ionic-official-components/button/button-styles/button-styles';
46+
import { IconButtonsPage } from '../pages/ionic-official-components/button/icon-buttons/icon-buttons';
47+
import { ButtonComponentsPage } from '../pages/ionic-official-components/button/button-components/button-components';
4748

4849
// Modals
4950
import { ModalsPage } from '../pages/modal/modal';
@@ -56,7 +57,7 @@ import { SignupModalPage } from '../pages/modal/small-modal/signup-modal/signup-
5657
import { WalkthroughModalPage } from '../pages/modal/small-modal/walkthrough-modal/walkthrough-modal';
5758

5859
// Alerts
59-
import { AlertsPage } from '../pages/alert/alert';
60+
import { AlertsPage } from '../pages/ionic-official-components/alert/alert';
6061

6162
// Slides
6263
import { SlidesPage } from '../pages/slide/slide';
@@ -112,6 +113,31 @@ export const Pages = [
112113
// Theming
113114
ThemingPage,
114115

116+
// Ionic Official Components
117+
IonicOfficialComponentsPage,
118+
119+
// Buttons
120+
ButtonsListPage,
121+
IconButtonsPage,
122+
ButtonComponentsPage,
123+
ButtonStylesPage,
124+
125+
// Lists
126+
ListsPage,
127+
SettingsListPage,
128+
SlidingItemListPage,
129+
130+
// Alerts
131+
AlertsPage,
132+
133+
// Cards
134+
CardListPage,
135+
CardBackgroundPage,
136+
CardMapPage,
137+
CardImagePage,
138+
CardSocialPage,
139+
CardBadgePage,
140+
115141
// Profile
116142
ProfileListPage,
117143
ProfileOnePage,
@@ -143,13 +169,6 @@ export const Pages = [
143169
ChartsPage,
144170
RuntimePermissionsPage,
145171

146-
// Cards
147-
CardListPage,
148-
CardBackgroundPage,
149-
CardMapPage,
150-
CardImagePage,
151-
CardSocialPage,
152-
CardBadgePage,
153172

154173
// Modals
155174
ModalsPage,
@@ -161,20 +180,6 @@ export const Pages = [
161180
WalkthroughModalPage,
162181
HintModalPage,
163182

164-
// Buttons
165-
ButtonsListPage,
166-
IconButtonsPage,
167-
ButtonComponentsPage,
168-
ButtonStylesPage,
169-
170-
// Lists
171-
ListsPage,
172-
SettingsListPage,
173-
SlidingItemListPage,
174-
175-
// Alerts
176-
AlertsPage,
177-
178183
// Slides
179184
SlidesPage,
180185
SlideCarouselPage,

src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { NgModule, ErrorHandler } from '@angular/core';
22
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
33
import { MyApp } from './app.component';
4-
import { Page1 } from '../pages/page1/page1';
5-
import { Page2 } from '../pages/page2/page2';
64
import { SwingModule } from 'angular2-swing';
75

86
import { Pages, Directives, Pipes, Providers } from './app.imports';

src/pages/alert/alert.ts renamed to src/pages/ionic-official-components/alert/alert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class AlertsPage {
6666
{
6767
text: 'Save',
6868
handler: (data: any) => {
69-
console.log('Saved clicked');
69+
console.log('Saved clicked', data);
7070
}
7171
}
7272
]
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<ion-header>
2-
<ion-navbar>
3-
<button ion-button menuToggle>
2+
<ion-navbar>
3+
<button ion-button menuToggle>
44
<ion-icon name="menu"></ion-icon>
55
</button>
6-
<ion-title>Profiles</ion-title>
7-
</ion-navbar>
6+
<ion-title>Profiles</ion-title>
7+
</ion-navbar>
88
</ion-header>
99
<!--<ion-menu [content]="profilecontent" id="menu-profile">
1010
@@ -19,11 +19,10 @@
1919
</ion-menu>
2020
2121
<ion-nav [root]="root" #profilecontent swipeBackEnabled="false"></ion-nav>-->
22-
2322
<ion-content>
24-
<ion-list>
25-
<button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">
23+
<ion-list>
24+
<button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">
2625
{{item.title}}
2726
</button>
28-
</ion-list>
29-
</ion-content>
27+
</ion-list>
28+
</ion-content>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<ion-header>
2+
<ion-navbar>
3+
<button ion-button menuToggle>
4+
<ion-icon name="menu"></ion-icon>
5+
</button>
6+
<ion-title>Ionic Official Components</ion-title>
7+
</ion-navbar>
8+
</ion-header>
9+
<ion-content>
10+
<ion-list>
11+
<button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">
12+
{{item.title}}
13+
</button>
14+
</ion-list>
15+
</ion-content>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { AlertsPage } from './alert/alert';
2+
import { ButtonsListPage } from './button/button';
3+
import { CardListPage } from './card/card';
4+
import { Component } from '@angular/core';
5+
6+
import { NavController } from 'ionic-angular';
7+
8+
@Component({
9+
selector: 'page-ionic-official-components',
10+
templateUrl: 'ionic-official-components.html'
11+
})
12+
export class IonicOfficialComponentsPage {
13+
rootPage: any;
14+
items: Array<{ title: string, page: any }>;
15+
16+
constructor(public navCtrl: NavController) {
17+
this.rootPage = CardListPage;
18+
19+
this.items = [
20+
{
21+
title: 'Buttons',
22+
page: ButtonsListPage
23+
},
24+
{
25+
title: 'Alerts',
26+
page: AlertsPage
27+
},
28+
{
29+
title: 'Cards',
30+
page: CardListPage
31+
},
32+
]
33+
}
34+
35+
itemTapped(event, item) {
36+
this.navCtrl.push(item.page);
37+
}
38+
}

src/pages/profile/profile-four/profile-four.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ToastService } from '../../../providers/util/toast.service';
2-
import { AlertService } from '../../../providers/util/alert.service';
32
import { Component } from '@angular/core';
43
import { NavController } from 'ionic-angular';
54

@@ -53,7 +52,7 @@ export class ProfileFourPage {
5352
ionViewDidLoad() {
5453
console.log('Hello ProfileFour Page');
5554
}
56-
55+
5756
follow() {
5857
this.following = !this.following;
5958
this.toastCtrl.create('Follow user clicked');

0 commit comments

Comments
 (0)