Browse Source

fixed home page

William Simkins 6 years ago
parent
commit
3fa6c375be

+ 6
- 1
src/app/app.module.ts View File

@@ -2,6 +2,7 @@ import { NgModule, ErrorHandler } from '@angular/core';
2 2
 import { BrowserModule } from '@angular/platform-browser';
3 3
 import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
4 4
 import { MyApp } from './app.component';
5
+import { HttpClientModule } from '@angular/common/http';
5 6
 
6 7
 import { AboutPage } from '../pages/about/about';
7 8
 import { ContactPage } from '../pages/contact/contact';
@@ -10,6 +11,7 @@ import { TopicPage } from '../pages/topic/topic';
10 11
 import { CreateTopicPage } from '../pages/create-topic/create-topic';
11 12
 import { CreateAccountPage } from '../pages/create-account/create-account';
12 13
 import { InboxPage } from '../pages/inbox/inbox';
14
+import { ForumPage } from '../pages/forum/forum';
13 15
 import { TabsPage } from '../pages/tabs/tabs';
14 16
 
15 17
 import { StatusBar } from '@ionic-native/status-bar';
@@ -25,11 +27,13 @@ import { SplashScreen } from '@ionic-native/splash-screen';
25 27
     CreateTopicPage,
26 28
     CreateAccountPage,
27 29
     InboxPage,
30
+    ForumPage,
28 31
     TabsPage
29 32
   ],
30 33
   imports: [
31 34
     BrowserModule,
32
-    IonicModule.forRoot(MyApp)
35
+    IonicModule.forRoot(MyApp),
36
+    HttpClientModule
33 37
   ],
34 38
   bootstrap: [IonicApp],
35 39
   entryComponents: [
@@ -41,6 +45,7 @@ import { SplashScreen } from '@ionic-native/splash-screen';
41 45
     CreateTopicPage,
42 46
     CreateAccountPage,
43 47
     InboxPage,
48
+    ForumPage,
44 49
     TabsPage
45 50
   ],
46 51
   providers: [

+ 18
- 0
src/app/users/user.ts View File

@@ -0,0 +1,18 @@
1
+import { Directive } from '@angular/core';
2
+
3
+/**
4
+ * Generated class for the UsersDirective directive.
5
+ *
6
+ * See https://angular.io/api/core/Directive for more info on Angular
7
+ * Directives.
8
+ */
9
+@Directive({
10
+  selector: '[users]' // Attribute selector
11
+})
12
+export class UsersDirective {
13
+
14
+  constructor() {
15
+    console.log('Hello UsersDirective Directive');
16
+  }
17
+
18
+}

+ 1
- 1
src/pages/create-account/create-account.html View File

@@ -24,7 +24,7 @@
24 24
           <input type="text" placeholder="Password">
25 25
         </label>
26 26
       </ion-list>
27
-      <button id="createAnAccount-button3" class="button button-dark button-block">Sign up</button>
27
+      <button ion-button block id="createAnAccount-button3" a (click)= "motivateMe()">Sign up</button>
28 28
     </form>
29 29
 
30 30
 </ion-content>

+ 5
- 0
src/pages/create-account/create-account.ts View File

@@ -27,4 +27,9 @@ export class CreateAccountPage {
27 27
     this.navCtrl.push(HomePage);
28 28
   }
29 29
 
30
+  motivateMe(){
31
+    
32
+    this.navCtrl.push(HomePage);
33
+  }
34
+
30 35
 }

+ 1
- 1
src/pages/create-topic/create-topic.html View File

@@ -25,5 +25,5 @@
25 25
     <label class="item item-input" id="createATopic-textarea4" name="Advice and Strategies">
26 26
       <span class="input-label"></span><textarea placeholder="Advice and Strategies"></textarea></label>
27 27
   </form>
28
-  <!-- <a (click)="topics()" id="createATopic-button11" class="button button-calm button-block">Save Topic</a> -->
28
+  <a (click)="topics()" id="createATopic-button11" class="button button-calm button-block">Save Topic</a>
29 29
 </ion-content>

+ 51
- 0
src/pages/forum/forum.html View File

@@ -0,0 +1,51 @@
1
+<!--
2
+  Generated template for the ForumPage page.
3
+
4
+  See http://ionicframework.com/docs/components/#navigation for more info on
5
+  Ionic pages and navigation.
6
+-->
7
+<ion-header>
8
+
9
+  <ion-navbar>
10
+    <ion-title>forum</ion-title>
11
+  </ion-navbar>
12
+
13
+</ion-header>
14
+
15
+
16
+<ion-content padding="true" class="has-header">
17
+  <form id="forum-form7" class="list">
18
+    <label class="item item-input" id="forum-textarea5">
19
+      <span class="input-label"></span><textarea placeholder="Leave a message here"></textarea></label>
20
+  </form>
21
+  <ion-list id="forum-list3">
22
+    <ion-item class="item-avatar" id="forum-list-item6">
23
+      <h2>Username</h2>
24
+      <p>Comment</p>
25
+    </ion-item>
26
+    <ion-item class="item-avatar" id="forum-list-item7">
27
+      <h2>Username</h2>
28
+      <p>Comment</p>
29
+    </ion-item>
30
+    <ion-item class="item-avatar" id="forum-list-item8">
31
+      <h2>Username</h2>
32
+      <p>Comment</p>
33
+    </ion-item>
34
+    <ion-item class="item-avatar" id="forum-list-item9">
35
+      <h2>Username</h2>
36
+      <p>Comment</p>
37
+    </ion-item>
38
+    <ion-item class="item-avatar" id="forum-list-item10">
39
+      <h2>Username</h2>
40
+      <p>Comment</p>
41
+    </ion-item>
42
+    <ion-item class="item-avatar" id="forum-list-item11">
43
+      <h2>Username</h2>
44
+      <p>Comment</p>
45
+    </ion-item>
46
+    <ion-item class="item-avatar" id="forum-list-item12">
47
+      <h2>Username</h2>
48
+      <p>Comment</p>
49
+    </ion-item>
50
+  </ion-list>
51
+</ion-content>

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

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

+ 3
- 0
src/pages/forum/forum.scss View File

@@ -0,0 +1,3 @@
1
+page-forum {
2
+
3
+}

+ 29
- 0
src/pages/forum/forum.ts View File

@@ -0,0 +1,29 @@
1
+import { Component } from '@angular/core';
2
+import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+
4
+/**
5
+ * Generated class for the ForumPage page.
6
+ *
7
+ * See https://ionicframework.com/docs/components/#navigation for more info on
8
+ * Ionic pages and navigation.
9
+ */
10
+
11
+@IonicPage()
12
+@Component({
13
+  selector: 'page-forum',
14
+  templateUrl: 'forum.html',
15
+})
16
+export class ForumPage {
17
+
18
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
19
+  }
20
+
21
+  ionViewDidLoad() {
22
+    console.log('ionViewDidLoad ForumPage');
23
+  }
24
+
25
+  forum(){
26
+    
27
+  }
28
+
29
+}

+ 14
- 12
src/pages/home/home.html View File

@@ -3,17 +3,19 @@
3 3
   <ion-navbar>
4 4
     <ion-title>MotivateMe</ion-title>
5 5
   </ion-navbar>
6
-
7 6
 </ion-header>
7
+
8 8
 <ion-content padding="true" class="page-home has-header">
9
-  <form id="motivateMe-form2" class="list">
10
-    <label class="item item-input" id="motivateMe-input3" name="Email">
11
-      <input type="email" placeholder="Email">
12
-    </label>
13
-    <label class="item item-input" id="motivateMe-input4" name="Password">
14
-      <input type="password" placeholder="Password">
15
-    </label>
16
-  </form>
17
-  <a (click)="topics()" id="motivateMe-button1" class="button">Login</a>
18
-  <a (click)="createAnAccount()" id="motivateMe-button2" class="button">Or create an account</a>
19
-</ion-content>
9
+  <div class="home-wrapper">
10
+    <form id="motivateMe-form2" class="list">
11
+      <label class="item item-input" id="motivateMe-input3" name="Email">
12
+        <input type="email" placeholder="Email" class="field">
13
+      </label>
14
+      <label class="item item-input" id="motivateMe-input4" name="Password">
15
+        <input type="password" placeholder="Password" class="field">
16
+      </label>
17
+    </form>
18
+    <button ion-button block id="motivateMe-button1" a (click)="topics()">Login</button>
19
+    <button ion-button block id="motivateMe-button2" a (click)="createAnAccount()">Or create an account</button>
20
+  </div>
21
+</ion-content>

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

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

+ 16
- 7
src/pages/home/home.scss View File

@@ -1,12 +1,21 @@
1 1
 .page-home {
2
-
3
-  display: block;
4
-
5
-  * {
6
-    display: block;
2
+  .home-wrapper {
3
+    max-width: 500px;
4
+    margin: auto;
5
+  }
6
+  .field {
7
+    width:100%;
8
+    margin-bottom: 10px;
9
+    padding: 5px;
7 10
   }
11
+  
12
+  // .button {
13
+  //   color: #FFF;
14
+  // }
8 15
 
9
-  .button {
10
-    color: #FFF;
16
+  .button-calm{
17
+    background-color: #FFF;
11 18
   }
12 19
 }
20
+
21
+

+ 20
- 3
src/pages/home/home.ts View File

@@ -1,6 +1,9 @@
1 1
 import { Component } from '@angular/core';
2 2
 import { NavController } from 'ionic-angular';
3
-import { TopicPage } from './../topic/topic'
3
+import { TopicPage } from './../topic/topic';
4
+import { CreateAccountPage } from './../create-account/create-account';
5
+// import { ApiProvider } from './../../providers/api/api';
6
+// import { User } from './../../app/users/user';
4 7
 
5 8
 @Component({
6 9
   selector: 'page-home',
@@ -8,16 +11,30 @@ import { TopicPage } from './../topic/topic'
8 11
 })
9 12
 export class HomePage {
10 13
 
11
-  constructor(public navCtrl: NavController) {
14
+  constructor(public navCtrl: NavController,) {
12 15
 
13 16
   }
14 17
 
18
+  // public apiProvider: ApiProvider
19
+
20
+//   ngOnInit() {
21
+//   this.loadUsers();
22
+// }
23
+
24
+// loadUsers() {
25
+//   this.apiProvider.getUsers().subscribe(
26
+//     data => this.users = data["_embedded"]["users"],
27
+//     err => {
28
+//         console.log(err);
29
+//     });
30
+// }
31
+
15 32
   topics(){
16 33
     this.navCtrl.push(TopicPage);
17 34
   }
18 35
 
19 36
   createAnAccount(){
20
-
37
+    this.navCtrl.push(CreateAccountPage);
21 38
   }
22 39
 
23 40
 }

+ 1
- 1
src/pages/topic/topic.html View File

@@ -13,7 +13,7 @@
13 13
 </ion-header>
14 14
 
15 15
 <ion-content padding="true" class="has-header">
16
-  <a (click)="createTopic()" class="button">Create Topic</a>
16
+  <a (click)="createTopic()" class="button ion-button block">Create Topic</a>
17 17
 
18 18
   <form id="topics-form5" class="list">
19 19
     <label class="item item-input" id="topics-search1">

+ 3
- 1
src/pages/topic/topic.scss View File

@@ -1,3 +1,5 @@
1 1
 page-topic {
2
-
2
+.button-calm{
3
+  background-color: #FFF;
4
+}
3 5
 }

+ 17
- 0
src/providers/api/api.ts View File

@@ -0,0 +1,17 @@
1
+import { HttpClient } from '@angular/common/http';
2
+import { Injectable } from '@angular/core';
3
+
4
+/*
5
+  Generated class for the ApiProvider provider.
6
+
7
+  See https://angular.io/guide/dependency-injection for more info on providers
8
+  and Angular DI.
9
+*/
10
+@Injectable()
11
+export class ApiProvider {
12
+
13
+  constructor(public http: HttpClient) {
14
+    console.log('Hello ApiProvider Provider');
15
+  }
16
+
17
+}