-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
039be6c
commit da23dae
Showing
6 changed files
with
120 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
<p>Please login with your <strong>GitHub account</strong>.</p> | ||
<a href="{{ GITHUB_URL }}" class="login__btn login__btn--full" md-raised-button="primary"> Login </a> | ||
<ng-container *ngIf="enableFormLoginFromServer && !showFormLogin; else defaultGitHubLogin"> | ||
<div class="d-flex flex-column align-items-center login-container__buttons"> | ||
<h1 class="text-center text-muted">Select your sign in</h1> | ||
<div class="inner-container"> | ||
<a href="{{ GITHUB_URL }}" class="login__btn" md-raised-button="primary"> | ||
Sign in to GitHub | ||
<svg-icon class="github-logo" name="github-logo"></svg-icon> | ||
</a> | ||
<a (click)="clickLogin()" class="login__btn" md-raised-button="primary"> Sign in </a> | ||
</div> | ||
</div> | ||
</ng-container> | ||
<ng-template #defaultGitHubLogin> | ||
<div class="d-flex justify-content-center align-items-center"> | ||
<app-spinner></app-spinner> | ||
</div> | ||
</ng-template> | ||
<div *ngIf="showFormLogin"> | ||
<div class="d-flex justify-content-center flex-column container-form"> | ||
<img [src]="appLogo" class="logo" alt="Application logo" /> | ||
<h1 class="text-center text-muted mt-4">Sign in to Kamu</h1> | ||
<form> | ||
<div> | ||
<label for="login" class="fs-12">Login</label><span class="text-danger">*</span><br /> | ||
<input type="text" class="form-control d-inline" id="login" data-test-id="login" required /> | ||
</div> | ||
<div class="mt-4"> | ||
<label for="password" class="fs-12">Password</label><span class="text-danger">*</span><br /> | ||
<input type="text" class="form-control d-inline" id="password" data-test-id="password" required /> | ||
</div> | ||
<button class="button-sigh-in mt-4">Sign in</button> | ||
</form> | ||
</div> | ||
</div> |
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,53 @@ | ||
@import "../../../../src/assets/styles/var" | ||
|
||
a | ||
text-decoration: none | ||
color: $app-dark | ||
|
||
.login-container__buttons | ||
height: 100vh | ||
overflow: hidden | ||
margin-top: 200px | ||
.inner-container | ||
border: 1px solid $app-color-border-default | ||
padding: 40px 20px | ||
align-items: center | ||
display: flex | ||
justify-content: center | ||
flex-direction: column | ||
gap: 40px | ||
border-radius: 6px | ||
.login__btn | ||
align-items: center | ||
display: flex | ||
justify-content: center | ||
border: 1px solid $app-color-border-default | ||
width: 200px | ||
padding: 5px 15px | ||
border-radius: 6px | ||
background-color: #ebeef1 | ||
&:hover | ||
background: $app-background-btn | ||
.github-logo | ||
margin-left: 10px | ||
|
||
.container-form | ||
margin-top: 100px | ||
.logo | ||
width: 70px | ||
margin: 0 auto | ||
form | ||
width: 400px | ||
border: 1px solid $app-color-border-default | ||
margin: 0 auto | ||
border-radius: 6px | ||
padding: 20px | ||
background-color: #f6f8fa | ||
.button-sigh-in | ||
color: $app-white | ||
background-color: #1f883d | ||
text-align: center | ||
border: none | ||
border-radius: 6px | ||
padding: 8px 15px | ||
width: 100% |
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 |
---|---|---|
@@ -1,12 +1,26 @@ | ||
import { ChangeDetectionStrategy, Component } from "@angular/core"; | ||
import { ChangeDetectionStrategy, Component, OnInit } from "@angular/core"; | ||
import ProjectLinks from "src/app/project-links"; | ||
import AppValues from "src/app/common/app.values"; | ||
|
||
@Component({ | ||
selector: "app-login", | ||
templateUrl: "./login.component.html", | ||
styleUrls: ["./login.component.sass"], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class LoginComponent { | ||
export class LoginComponent implements OnInit { | ||
public readonly GITHUB_URL = ProjectLinks.GITHUB_URL; | ||
public appLogo = `/${AppValues.APP_LOGO}`; | ||
public enableFormLoginFromServer = true; | ||
public showFormLogin = false; | ||
|
||
ngOnInit(): void { | ||
if (!this.enableFormLoginFromServer) { | ||
window.location.href = this.GITHUB_URL; | ||
} | ||
} | ||
|
||
public clickLogin(): void { | ||
this.showFormLogin = true; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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