-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apps): create login page (#502)
Create the login page for the prs application. PR Close #502
- Loading branch information
1 parent
3e10e5f
commit 50857c6
Showing
9 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
flex-direction: row; | ||
|
||
.spacer { | ||
flex: 1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {RouterModule, Routes} from '@angular/router'; | ||
import {LoginComponent} from './login.component'; | ||
|
||
const routes: Routes = [{path: '', component: LoginComponent}]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class LoginRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<mat-card> | ||
<mat-card-title> | ||
Angular PR Management | ||
</mat-card-title> | ||
|
||
<!-- TODO: expand on welcome/login screen content. --> | ||
|
||
<mat-card-actions align="end"> | ||
<button mat-raised-button color="primary" (click)="signIn()">Sign In</button> | ||
</mat-card-actions> | ||
</mat-card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.mat-card { | ||
width: 500px; | ||
margin: 150px auto 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {LoginComponent} from './login.component'; | ||
|
||
describe('LoginComponent', () => { | ||
let component: LoginComponent; | ||
let fixture: ComponentFixture<LoginComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [LoginComponent], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(LoginComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {Component} from '@angular/core'; | ||
import {Router} from '@angular/router'; | ||
import {AccountService} from '../../../../shared/account/account.service'; | ||
|
||
@Component({ | ||
selector: 'app-login', | ||
templateUrl: './login.component.html', | ||
styleUrls: ['./login.component.scss'], | ||
}) | ||
export class LoginComponent { | ||
constructor(private account: AccountService, private router: Router) {} | ||
|
||
signIn() { | ||
this.account.signInWithGoogle().then((signedIn) => { | ||
if (signedIn) { | ||
this.router.navigateByUrl(''); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
|
||
import {LoginRoutingModule} from './login-routing.module'; | ||
import {LoginComponent} from './login.component'; | ||
|
||
import {MatCardModule} from '@angular/material/card'; | ||
import {MatButtonModule} from '@angular/material/button'; | ||
import {AccountModule} from '../../../../shared/account/account.module'; | ||
|
||
@NgModule({ | ||
declarations: [LoginComponent], | ||
imports: [CommonModule, LoginRoutingModule, MatCardModule, MatButtonModule, AccountModule], | ||
}) | ||
export class LoginModule {} |