Browse Source

turn it off and turn it back on again

Rachelle 6 years ago
parent
commit
645547a9cd

+ 6
- 4
MyPassionProjectClient/src/app/app.module.ts View File

1
 import { BrowserModule } from '@angular/platform-browser';
1
 import { BrowserModule } from '@angular/platform-browser';
2
 import { ErrorHandler, NgModule } from '@angular/core';
2
 import { ErrorHandler, NgModule } from '@angular/core';
3
-import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
3
+import { IonicApp, IonicErrorHandler, IonicModule, IonicPage, Menu } from 'ionic-angular';
4
 import { SplashScreen } from '@ionic-native/splash-screen';
4
 import { SplashScreen } from '@ionic-native/splash-screen';
5
 import { StatusBar } from '@ionic-native/status-bar';
5
 import { StatusBar } from '@ionic-native/status-bar';
6
 import { MyApp } from './app.component';
6
 import { MyApp } from './app.component';
13
 import { Camera } from '../../node_modules/@ionic-native/camera';
13
 import { Camera } from '../../node_modules/@ionic-native/camera';
14
 import { FilePath } from '../../node_modules/@ionic-native/file-path';
14
 import { FilePath } from '../../node_modules/@ionic-native/file-path';
15
 import {File} from '../../node_modules/@ionic-native/file';
15
 import {File} from '../../node_modules/@ionic-native/file';
16
+import { MenuPage } from '../pages/menu/menu';
16
 
17
 
17
 
18
 
18
 @NgModule({
19
 @NgModule({
19
   declarations: [
20
   declarations: [
20
     MyApp,
21
     MyApp,
21
     ProfileModalPage,
22
     ProfileModalPage,
22
-    PictureModalPage
23
+    PictureModalPage,
24
+    MenuPage
23
   ],
25
   ],
24
   imports: [
26
   imports: [
25
     BrowserModule,
27
     BrowserModule,
26
     IonicModule.forRoot(MyApp),
28
     IonicModule.forRoot(MyApp),
27
-    MenuPageModule,
28
     HttpClientModule,
29
     HttpClientModule,
29
   ],
30
   ],
30
   bootstrap: [IonicApp],
31
   bootstrap: [IonicApp],
31
   entryComponents: [
32
   entryComponents: [
32
     MyApp,
33
     MyApp,
33
     ProfileModalPage,
34
     ProfileModalPage,
34
-    PictureModalPage
35
+    PictureModalPage,
36
+    MenuPage
35
    ],
37
    ],
36
   providers: [
38
   providers: [
37
     StatusBar,
39
     StatusBar,

+ 3
- 1
MyPassionProjectClient/src/pages/friends/friends.html View File

13
 
13
 
14
 
14
 
15
 <ion-content padding>
15
 <ion-content padding>
16
-
16
+    <button ion-item (click)="get()">
17
+        GetUserName
18
+      </button>
17
   <ion-searchbar placeholder="Search People"></ion-searchbar>
19
   <ion-searchbar placeholder="Search People"></ion-searchbar>
18
   <ion-list>
20
   <ion-list>
19
     <ion-item-sliding>
21
     <ion-item-sliding>

+ 4
- 1
MyPassionProjectClient/src/pages/friends/friends.ts View File

1
 import { Component } from '@angular/core';
1
 import { Component } from '@angular/core';
2
 import {IonicPage, NavController, NavParams, ToastController} from 'ionic-angular';
2
 import {IonicPage, NavController, NavParams, ToastController} from 'ionic-angular';
3
+import { UsersService } from '../../providers/users-service';
3
 
4
 
4
 @IonicPage()
5
 @IonicPage()
5
 @Component({
6
 @Component({
8
 })
9
 })
9
 export class FriendsPage {
10
 export class FriendsPage {
10
 
11
 
11
-  constructor(public navCtrl: NavController, public navParams: NavParams, public toastCtrl: ToastController) {
12
+  constructor(public navCtrl: NavController, public navParams: NavParams, public toastCtrl: ToastController, public usersService: UsersService) {
12
   }
13
   }
13
 
14
 
14
   addToFriendList() {
15
   addToFriendList() {
23
 
24
 
24
   viewFriendDetails() {}
25
   viewFriendDetails() {}
25
 
26
 
27
+  get(){console.log(this.usersService.user)}
28
+
26
 }
29
 }

+ 8
- 2
MyPassionProjectClient/src/pages/menu/menu.ts View File

1
-import {ProfilePage} from "../profile/profile";
2
 import {GamesPage} from "../games/games";
1
 import {GamesPage} from "../games/games";
3
 import {FriendsPage} from "../friends/friends";
2
 import {FriendsPage} from "../friends/friends";
3
+import {SummaryPage} from "../summary/summary";
4
 import { TabsPage } from './../tabs/tabs';
4
 import { TabsPage } from './../tabs/tabs';
5
 import {Component, ViewChild} from '@angular/core';
5
 import {Component, ViewChild} from '@angular/core';
6
 import { IonicPage, NavController, Nav, NavParams, MenuController } from 'ionic-angular';
6
 import { IonicPage, NavController, Nav, NavParams, MenuController } from 'ionic-angular';
28
   @ViewChild(Nav) nav: Nav;
28
   @ViewChild(Nav) nav: Nav;
29
 
29
 
30
   pages: PageInterface[] = [
30
   pages: PageInterface[] = [
31
-    { title: 'Home', pageName: 'TabsPage', tabComponent: 'ProfilePage', index: 0, icon: 'home' },
31
+    { title: 'MyPage', pageName: 'TabsPage', tabComponent: 'SummaryPage', index: 0, icon: 'home' },
32
     { title: 'MyGames', pageName: 'TabsPage', tabComponent: 'GamesPage', index: 1, icon: 'search' },
32
     { title: 'MyGames', pageName: 'TabsPage', tabComponent: 'GamesPage', index: 1, icon: 'search' },
33
     { title: 'Game Search', pageName: 'TabsPage', tabComponent: 'GameSearchPage', index: 2, icon: 'search' },
33
     { title: 'Game Search', pageName: 'TabsPage', tabComponent: 'GameSearchPage', index: 2, icon: 'search' },
34
     { title: 'Friends', pageName: 'TabsPage', tabComponent: 'FriendsPage', index: 3, icon: 'contacts' },
34
     { title: 'Friends', pageName: 'TabsPage', tabComponent: 'FriendsPage', index: 3, icon: 'contacts' },
45
     // The index is equal to the order of our tabs inside tabs.ts
45
     // The index is equal to the order of our tabs inside tabs.ts
46
     if (page.index) {
46
     if (page.index) {
47
       params = { tabIndex: page.index};
47
       params = { tabIndex: page.index};
48
+      console.log(params);
49
+      console.log("param1");
50
+      console.log(this.usersService.user);
48
     }
51
     }
49
 
52
 
50
     // The active child nav is our Tabs Navigation
53
     // The active child nav is our Tabs Navigation
53
     } else {
56
     } else {
54
       // Tabs are not active, so reset the root page
57
       // Tabs are not active, so reset the root page
55
       // In this case: moving to or from SpecialPage
58
       // In this case: moving to or from SpecialPage
59
+      console.log(params);
60
+      console.log("param2");
61
+      console.log(this.usersService.user);
56
       this.nav.setRoot(page.pageName, params);
62
       this.nav.setRoot(page.pageName, params);
57
     }
63
     }
58
   }
64
   }

+ 0
- 69
MyPassionProjectClient/src/pages/profile/profile.html View File

1
-<ion-header>
2
-
3
-  <ion-navbar>
4
-    <ion-buttons start>
5
-      <button ion-button menuToggle>
6
-        <ion-icon name="menu"></ion-icon>
7
-      </button>
8
-    </ion-buttons>
9
-    <ion-title>Profile</ion-title>
10
-  </ion-navbar>
11
-
12
-</ion-header>
13
-
14
-
15
-<ion-content padding>
16
-  <ion-card>
17
-
18
-    <ion-card-header>
19
-      <strong>My Profile</strong>
20
-    </ion-card-header>
21
-    <img src="/assets/imgs/avatar.png"/>
22
-
23
-    <ion-card-content>
24
-      <ion-card-title>
25
-        {{user.profileName}}
26
-      </ion-card-title>
27
-      <p>
28
-        {{user.summary}}
29
-      </p>
30
-    </ion-card-content>
31
-
32
-  </ion-card>
33
-
34
-  <ion-card>
35
-
36
-    <ion-card-header>
37
-      <strong>My Games</strong>
38
-    </ion-card-header>
39
-
40
-    <ion-card-content>
41
-      <ion-card-title>
42
-        Descent: Journeys in the Dark
43
-      </ion-card-title>
44
-      <p>
45
-        Adventure, Modular Board
46
-      </p>
47
-
48
-      <ion-card-title>
49
-        Dominion
50
-      </ion-card-title>
51
-      <p>
52
-        Strategy, Deck-Builder
53
-      </p>
54
-
55
-      <ion-card-title>
56
-        Sushi Go!
57
-      </ion-card-title>
58
-      <p>
59
-        Family, Card Drafting
60
-      </p>
61
-    </ion-card-content>
62
-
63
-  </ion-card>
64
-</ion-content>
65
-
66
-
67
-
68
-
69
-

+ 0
- 17
MyPassionProjectClient/src/pages/profile/profile.module.ts View File

1
-import { NgModule } from '@angular/core';
2
-import { IonicPageModule } from 'ionic-angular';
3
-import { ProfilePage } from './profile';
4
-import { UsersService } from '../../providers/users-service';
5
-
6
-@NgModule({
7
-  declarations: [
8
-    ProfilePage
9
-  ],
10
-  imports: [
11
-    IonicPageModule.forChild(ProfilePage),
12
-  ],
13
-  providers: [
14
-    UsersService,
15
-  ],
16
-})
17
-export class ProfilePageModule {}

+ 0
- 3
MyPassionProjectClient/src/pages/profile/profile.scss View File

1
-page-profile {
2
-
3
-}

+ 0
- 34
MyPassionProjectClient/src/pages/profile/profile.ts View File

1
-import { Component } from '@angular/core';
2
-import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
-import { User, UsersService } from '../../providers/users-service';
4
-
5
-@IonicPage()
6
-@Component({
7
-  selector: 'page-profile',
8
-  templateUrl: 'profile.html',
9
-})
10
-export class ProfilePage {
11
-  user: User;
12
-
13
-  constructor(public navCtrl: NavController, public navParams: NavParams, public usersService: UsersService) {
14
-    console.log("profile"); 
15
-    console.log(navParams.data);
16
-    console.log(this.navParams.get("user"));
17
-    console.log("passed in from param");
18
-
19
-    console.log(this.usersService.user);
20
-    this.user = this.usersService.getUser();
21
-    console.log(this.user);
22
-    if (!this.user) {
23
-      this.user = new User(1, "test", "test1", "test");
24
-    }
25
-  }
26
-
27
-  ionViewDidLoad() { 
28
-  }
29
-
30
-  getProfile(){
31
-    console.log(this.usersService.user);
32
-  }
33
-}
34
- 

+ 0
- 1
MyPassionProjectClient/src/pages/settings/settings.module.ts View File

1
 import { NgModule } from '@angular/core';
1
 import { NgModule } from '@angular/core';
2
 import { IonicPageModule } from 'ionic-angular';
2
 import { IonicPageModule } from 'ionic-angular';
3
 import { SettingsPage } from './settings';
3
 import { SettingsPage } from './settings';
4
-import { ProfileModalPage } from './profile-modal';
5
 
4
 
6
 @NgModule({
5
 @NgModule({
7
   declarations: [
6
   declarations: [

+ 0
- 1
MyPassionProjectClient/src/pages/settings/settings.ts View File

2
 import { IonicPage, NavController, NavParams, ModalController, ViewController } from 'ionic-angular';
2
 import { IonicPage, NavController, NavParams, ModalController, ViewController } from 'ionic-angular';
3
 import { ProfileModalPage } from './profile-modal';
3
 import { ProfileModalPage } from './profile-modal';
4
 import { PictureModalPage } from './picture-modal';
4
 import { PictureModalPage } from './picture-modal';
5
-import { ProfilePage } from '../profile/profile';
6
 
5
 
7
 @IonicPage()
6
 @IonicPage()
8
 @Component({
7
 @Component({

+ 0
- 1
MyPassionProjectClient/src/pages/signup/signup.ts View File

2
 import { IonicPage, NavController, NavParams, Menu } from 'ionic-angular';
2
 import { IonicPage, NavController, NavParams, Menu } from 'ionic-angular';
3
 import {MenuPage} from "../menu/menu";
3
 import {MenuPage} from "../menu/menu";
4
 import { UsersService } from '../../providers/users-service';
4
 import { UsersService } from '../../providers/users-service';
5
-import { ProfilePage } from '../profile/profile';
6
 
5
 
7
 @IonicPage()
6
 @IonicPage()
8
 @Component({
7
 @Component({

+ 67
- 0
MyPassionProjectClient/src/pages/summary/summary.html View File

1
+<ion-header>
2
+  <ion-navbar>
3
+      <ion-buttons start>
4
+          <button ion-button menuToggle>
5
+            <ion-icon name="menu"></ion-icon>
6
+          </button>
7
+        </ion-buttons>
8
+    <ion-title>MyPage</ion-title>
9
+  </ion-navbar>
10
+</ion-header>
11
+
12
+
13
+<ion-content padding>
14
+    <ion-card>
15
+  
16
+        <ion-card-header>
17
+          <strong>My Profile</strong>
18
+        </ion-card-header>
19
+        <img src="/assets/imgs/avatar.png"/>
20
+    
21
+        <ion-card-content>
22
+          <ion-card-title>
23
+            profilename
24
+          </ion-card-title>
25
+          <p>
26
+            summary
27
+          </p>
28
+    
29
+          <button ion-item (click)="get()">
30
+            GetUserName
31
+          </button>
32
+    
33
+        </ion-card-content>
34
+    
35
+      </ion-card>
36
+    
37
+      <ion-card>
38
+    
39
+        <ion-card-header>
40
+          <strong>My Games</strong>
41
+        </ion-card-header>
42
+    
43
+        <ion-card-content>
44
+          <ion-card-title>
45
+            Descent: Journeys in the Dark
46
+          </ion-card-title>
47
+          <p>
48
+            Adventure, Modular Board
49
+          </p>
50
+    
51
+          <ion-card-title>
52
+            Dominion
53
+          </ion-card-title>
54
+          <p>
55
+            Strategy, Deck-Builder
56
+          </p>
57
+    
58
+          <ion-card-title>
59
+            Sushi Go!
60
+          </ion-card-title>
61
+          <p>
62
+            Family, Card Drafting
63
+          </p>
64
+        </ion-card-content>
65
+    
66
+      </ion-card>
67
+</ion-content>

+ 13
- 0
MyPassionProjectClient/src/pages/summary/summary.module.ts View File

1
+import { NgModule } from '@angular/core';
2
+import { IonicPageModule } from 'ionic-angular';
3
+import { SummaryPage } from './summary';
4
+
5
+@NgModule({
6
+  declarations: [
7
+    SummaryPage,
8
+  ],
9
+  imports: [
10
+    IonicPageModule.forChild(SummaryPage),
11
+  ],
12
+})
13
+export class SummaryPageModule {}

+ 3
- 0
MyPassionProjectClient/src/pages/summary/summary.scss View File

1
+page-summary {
2
+
3
+}

+ 22
- 0
MyPassionProjectClient/src/pages/summary/summary.ts View File

1
+import { Component } from '@angular/core';
2
+import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+import { UsersService } from '../../providers/users-service';
4
+
5
+@IonicPage()
6
+@Component({
7
+  selector: 'page-summary',
8
+  templateUrl: 'summary.html',
9
+})
10
+export class SummaryPage {
11
+  user: any;
12
+
13
+  constructor(public navCtrl: NavController, public navParams: NavParams, public usersService: UsersService) {
14
+    this.user = this.usersService.user;
15
+  }
16
+
17
+  get() {
18
+    console.log(this.usersService.user);
19
+  }
20
+
21
+}
22
+ 

+ 2
- 1
MyPassionProjectClient/src/pages/tabs/tabs.html View File

1
 <ion-tabs>
1
 <ion-tabs>
2
-    <ion-tab [root]="profileRoot" tabTitle="Home" tabIcon="home"></ion-tab>
2
+    
3
+    <ion-tab [root]="summaryRoot" tabTitle="MyPage" tabIcon="home"></ion-tab>
3
     <ion-tab [root]="gamesRoot" tabTitle="MyGames" tabIcon="search"></ion-tab>
4
     <ion-tab [root]="gamesRoot" tabTitle="MyGames" tabIcon="search"></ion-tab>
4
     <ion-tab [root]="gameSearchRoot" tabTitle="Game Search" tabIcon="search"></ion-tab>
5
     <ion-tab [root]="gameSearchRoot" tabTitle="Game Search" tabIcon="search"></ion-tab>
5
     <ion-tab [root]="friendsRoot" tabTitle="Friends" tabIcon="contacts"></ion-tab>
6
     <ion-tab [root]="friendsRoot" tabTitle="Friends" tabIcon="contacts"></ion-tab>

+ 1
- 9
MyPassionProjectClient/src/pages/tabs/tabs.ts View File

1
 import { Component } from '@angular/core';
1
 import { Component } from '@angular/core';
2
 import {IonicPage, NavController, NavParams} from 'ionic-angular';
2
 import {IonicPage, NavController, NavParams} from 'ionic-angular';
3
 
3
 
4
-/**
5
- * Generated class for the TabsPage tabs.
6
- *
7
- * See https://ionicframework.com/docs/components/#navigation for more info on
8
- * Ionic pages and navigation.
9
- */
10
-
11
 @IonicPage()
4
 @IonicPage()
12
 @Component({
5
 @Component({
13
   selector: 'page-tabs',
6
   selector: 'page-tabs',
14
   templateUrl: 'tabs.html'
7
   templateUrl: 'tabs.html'
15
 })
8
 })
16
 export class TabsPage {
9
 export class TabsPage {
17
-
18
-  profileRoot: any = 'ProfilePage';
10
+  summaryRoot: any = 'SummaryPage';
19
   friendsRoot: any = 'FriendsPage';
11
   friendsRoot: any = 'FriendsPage';
20
   gamesRoot: any = 'GamesPage';
12
   gamesRoot: any = 'GamesPage';
21
   gameSearchRoot: any = 'GameSearchPage';
13
   gameSearchRoot: any = 'GameSearchPage';