File tree Expand file tree Collapse file tree 8 files changed +111
-1
lines changed Expand file tree Collapse file tree 8 files changed +111
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { SideMenuPage } from '../pages/side-menu/side-menu' ;
1
2
import { IonicOfficialComponentsPage } from '../pages/ionic-official-components/ionic-official-components' ;
2
3
import { LoginListPage } from '../pages/login/login' ;
3
4
import { ThemingPage } from '../pages/theming/theming' ;
@@ -37,6 +38,7 @@ export class MyApp {
37
38
{ title : 'Miscellaneous' , component : MiscellaneousListPage } ,
38
39
{ title : 'Popup Menu' , component : PopupMenuListPage } ,
39
40
{ title : 'Profile' , component : ProfileListPage } ,
41
+ { title : 'Side Menu' , component : SideMenuPage } ,
40
42
// Removed for now as there were breaking changes in slides
41
43
// { title: 'Slides', component: SlidesPage },
42
44
{ title : 'Theming' , component : ThemingPage } ,
Original file line number Diff line number Diff line change 1
1
< div class ="{{global.state['theme']}} ">
2
+ <!--Default Menu-->
2
3
< ion-menu [content] ="content " id ="menu-components " class ="animated-menu ">
3
4
< ion-header >
4
5
< ion-toolbar >
13
14
</ ion-list >
14
15
</ ion-content >
15
16
</ ion-menu >
17
+ <!--Side Menu with avatar-->
18
+ < ion-menu [content] ="content " id ="menu-avatar " class ="animated-menu ">
19
+ < ion-content >
20
+ < ion-row style ="align-items:center; ">
21
+ < ion-col width-25 >
22
+ < img class ="round " [src] ="chosenPicture || placeholder " onerror ="this.src='assets/img/avatar/girl-avatar.png' " />
23
+ </ ion-col >
24
+ < ion-col width-50 >
25
+ < img class ="round " [src] ="chosenPicture || placeholder " onerror ="this.src='assets/img/avatar/girl-avatar.png' " />
26
+ </ ion-col >
27
+ < ion-col width-25 >
28
+ < img class ="round " [src] ="chosenPicture || placeholder " onerror ="this.src='assets/img/avatar/girl-avatar.png' " />
29
+ </ ion-col >
30
+ </ ion-row >
31
+ < ion-row style ="justify-content: center; ">
32
+ < h3 > Paula Bolliger</ h3 >
33
+ </ ion-row >
34
+ < ion-list >
35
+ < button menuClose ion-item *ngFor ="let p of pages " (click) ="openPage(p) ">
36
+ {{p.title}}
37
+ </ button >
38
+ </ ion-list >
39
+ </ ion-content >
40
+ </ ion-menu >
41
+ <!--Right side menu-->
42
+ < ion-menu class ="right-side-menu " side ="right " [content] ="content " id ="menu-right ">
43
+ < ion-list >
44
+ <!--<button menuClose icon-only ion-item *ngFor="let p of pages">
45
+ </button>-->
46
+ < ion-icon ion-item *ngFor ="let p of pages " name ="home "> </ ion-icon >
47
+ </ ion-list >
48
+ </ ion-menu >
16
49
<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
17
50
< ion-nav [root] ="rootPage " #content swipeBackEnabled ="false "> </ ion-nav >
18
51
</ div >
Original file line number Diff line number Diff line change
1
+ import { SideMenuPage } from '../pages/side-menu/side-menu' ;
1
2
// Global state (used for theming)
2
3
import { AppState } from './app.global' ;
3
4
@@ -149,6 +150,9 @@ export const Pages = [
149
150
LoginInstagramPage ,
150
151
LoginSliderPage ,
151
152
153
+ // Side Menu
154
+ SideMenuPage ,
155
+
152
156
// Miscellaneous
153
157
MiscellaneousListPage ,
154
158
PopupMenuListPage ,
Original file line number Diff line number Diff line change 39
39
}
40
40
41
41
.round {
42
- border-radius : 3 % ;
42
+ border-radius : 50 % ;
43
43
}
44
44
45
45
.transparent-header {
65
65
}
66
66
// ---
67
67
}
68
+
69
+ // right side menu
70
+ .right-side-menu {
71
+ .menu-inner {
72
+ width : 10vh ;
73
+ background : rgba (120 , 40 , 215 , .8 );
74
+ }
75
+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ page-signup-modal {
2
2
.scroll-content {
3
3
overflow : hidden ;
4
4
}
5
+ .round {
6
+ border-radius : 3% ;
7
+ }
5
8
.swiper-pagination-bullet {
6
9
background-color : white ;
7
10
}
Original file line number Diff line number Diff line change
1
+ < ion-header >
2
+ < ion-navbar >
3
+ < ion-buttons start >
4
+ < button ion-button icon-only menuToggle >
5
+ < ion-icon name ="menu "> </ ion-icon >
6
+ </ button >
7
+ </ ion-buttons >
8
+ < ion-title > Side Menu</ ion-title >
9
+ < ion-buttons end >
10
+ < button ion-button icon-only >
11
+ < ion-icon name ="home "> </ ion-icon >
12
+ </ button >
13
+ </ ion-buttons >
14
+ </ ion-navbar >
15
+ </ ion-header >
16
+ < ion-content padding >
17
+ < h3 > Advanced Ionic 2 Components</ h3 >
18
+ < p >
19
+ This app aims to help developers speed up their development process and learn how components work. It would be really nice
20
+ if you checked out the < a href ="https://github.com/yannbf/ionic2-components "> repository</ a > and contribute!
21
+ </ p >
22
+ < button class ="pop-in " ion-button full color ="secondary " (click) ="changeMenu(MENU.DEFAULT) "> Default sidemenu</ button >
23
+ < button class ="pop-in " ion-button full color ="secondary " (click) ="changeMenu(MENU.AVATAR) "> Sidemenu with avatar</ button >
24
+ </ ion-content >
Original file line number Diff line number Diff line change
1
+ page-side-menu {
2
+
3
+ }
Original file line number Diff line number Diff line change
1
+ import { Component } from '@angular/core' ;
2
+ import { MenuController , NavController } from 'ionic-angular' ;
3
+
4
+ @Component ( {
5
+ selector : 'page-side-menu' ,
6
+ templateUrl : 'side-menu.html'
7
+ } )
8
+ export class SideMenuPage {
9
+
10
+ MENU = {
11
+ DEFAULT : "menu-components" ,
12
+ AVATAR : "menu-avatar"
13
+ }
14
+
15
+ constructor ( public navCtrl : NavController , public menuCtrl : MenuController ) { }
16
+
17
+ ionViewDidLoad ( ) {
18
+ }
19
+
20
+ changeMenu ( menu ) {
21
+ // Disables all other sidemenus
22
+ Object . keys ( this . MENU ) . map ( k => this . menuCtrl . enable ( false , this . MENU [ k ] ) ) ;
23
+
24
+ // Enables then open the selected menu
25
+ this . menuCtrl . enable ( true , menu ) ;
26
+ this . menuCtrl . open ( menu ) ;
27
+ }
28
+
29
+ toggleRightMenu ( ) {
30
+ this . menuCtrl . open ( "right" ) . then ( result => console . log ( result ) ) ;
31
+ }
32
+
33
+ }
You can’t perform that action at this time.
0 commit comments