Skip to content

Commit 3cc4179

Browse files
committed
STEP2 認証ページモックの作成
1 parent 0214b9e commit 3cc4179

11 files changed

+175
-2
lines changed

src/app/app-routing.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ const routes: Routes = [
55
{
66
path: '',
77
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
8-
}
8+
},
9+
{
10+
path: 'auth',
11+
loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule),
12+
},
913
];
1014
@NgModule({
1115
imports: [

src/app/auth/auth.module.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { FormsModule } from '@angular/forms';
4+
import { Routes, RouterModule } from '@angular/router';
5+
import { IonicModule } from '@ionic/angular';
6+
import { SignupPage } from './signup/signup.page';
7+
import { SigninPage } from './signin/signin.page';
8+
9+
const routes: Routes = [
10+
{
11+
path: 'signup',
12+
component: SignupPage
13+
},
14+
{
15+
path: 'signin',
16+
component: SigninPage
17+
}
18+
];
19+
20+
@NgModule({
21+
imports: [
22+
CommonModule,
23+
FormsModule,
24+
IonicModule,
25+
RouterModule.forChild(routes)
26+
],
27+
declarations: [SignupPage, SigninPage]
28+
})
29+
export class AuthModule {}

src/app/auth/signin/signin.page.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<ion-header>
2+
<ion-toolbar>
3+
<ion-title>ログイン</ion-title>
4+
</ion-toolbar>
5+
</ion-header>
6+
7+
<ion-content>
8+
<form class="ion-padding">
9+
<ion-list class="ion-no-margin">
10+
<ion-item>
11+
<ion-label position="floating">メールアドレス</ion-label>
12+
<ion-input type="email" required></ion-input>
13+
</ion-item>
14+
<ion-item>
15+
<ion-label position="floating">パスワード</ion-label>
16+
<ion-input type="password" required></ion-input>
17+
</ion-item>
18+
</ion-list>
19+
<div class="ion-text-center ion-padding-top">
20+
<ion-button type="submit" shape="round" routerLink="/">ログイン</ion-button>
21+
</div>
22+
<div class="ion-text-center ion-padding-top">
23+
<ion-button size="small" fill="clear" routerLink="/auth/signup">新規登録はこちら</ion-button>
24+
</div>
25+
</form>
26+
</ion-content>

src/app/auth/signin/signin.page.scss

Whitespace-only changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
4+
import { SigninPage } from './signin.page';
5+
6+
describe('SigninPage', () => {
7+
let component: SigninPage;
8+
let fixture: ComponentFixture<SigninPage>;
9+
10+
beforeEach(async(() => {
11+
TestBed.configureTestingModule({
12+
declarations: [ SigninPage ],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
})
15+
.compileComponents();
16+
}));
17+
18+
beforeEach(() => {
19+
fixture = TestBed.createComponent(SigninPage);
20+
component = fixture.componentInstance;
21+
fixture.detectChanges();
22+
});
23+
24+
it('should create', () => {
25+
expect(component).toBeTruthy();
26+
});
27+
});

src/app/auth/signin/signin.page.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-signin',
5+
templateUrl: './signin.page.html',
6+
styleUrls: ['./signin.page.scss'],
7+
})
8+
export class SigninPage implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

src/app/auth/signup/signup.page.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<ion-header>
2+
<ion-toolbar>
3+
<ion-buttons slot="start">
4+
<ion-back-button defaultHref="/auth/signin"></ion-back-button>
5+
</ion-buttons>
6+
<ion-title>アカウント作成</ion-title>
7+
</ion-toolbar>
8+
</ion-header>
9+
10+
<ion-content>
11+
<form class="ion-padding">
12+
<ion-list class="ion-no-margin">
13+
<ion-item>
14+
<ion-label position="floating">メールアドレス</ion-label>
15+
<ion-input type="email" required></ion-input>
16+
</ion-item>
17+
<ion-item>
18+
<ion-label position="floating">パスワード</ion-label>
19+
<ion-input type="password" required></ion-input>
20+
</ion-item>
21+
</ion-list>
22+
<div class="ion-text-center ion-padding-top">
23+
<ion-button type="submit" shape="round" routerLink="/">新規登録</ion-button>
24+
</div>
25+
</form>
26+
</ion-content>

src/app/auth/signup/signup.page.scss

Whitespace-only changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
4+
import { SignupPage } from './signup.page';
5+
6+
describe('SignupPage', () => {
7+
let component: SignupPage;
8+
let fixture: ComponentFixture<SignupPage>;
9+
10+
beforeEach(async(() => {
11+
TestBed.configureTestingModule({
12+
declarations: [ SignupPage ],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
})
15+
.compileComponents();
16+
}));
17+
18+
beforeEach(() => {
19+
fixture = TestBed.createComponent(SignupPage);
20+
component = fixture.componentInstance;
21+
fixture.detectChanges();
22+
});
23+
24+
it('should create', () => {
25+
expect(component).toBeTruthy();
26+
});
27+
});

src/app/auth/signup/signup.page.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-signup',
5+
templateUrl: './signup.page.html',
6+
styleUrls: ['./signup.page.scss'],
7+
})
8+
export class SignupPage implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

src/app/tab2/tab2.page.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
</ion-toolbar>
77
</ion-header>
88

9-
<ion-content></ion-content>
9+
<ion-content>
10+
<ion-list>
11+
<ion-item routerLink="/auth/signin" routerDirection="root"><ion-label>ログアウト</ion-label></ion-item>
12+
</ion-list>
13+
</ion-content>

0 commit comments

Comments
 (0)