-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): added the first draft of
ngx-auth-firebaseui-login
c…
…omp. #316
- Loading branch information
1 parent
ecda449
commit e5fec91
Showing
10 changed files
with
540 additions
and
228 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -125,7 +125,6 @@ | |
"component-selector": [ | ||
true, | ||
"element", | ||
"app", | ||
"kebab-case" | ||
], | ||
"no-output-on-prefix": true, | ||
|
76 changes: 76 additions & 0 deletions
76
src/module/components/ngx-auth-firebaseui-login/ngx-auth-firebaseui-login.component.html
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,76 @@ | ||
<div id="login" fxLayout="column"> | ||
|
||
<div id="login-form-wrapper" fxLayout="column" fxLayoutAlign="center center"> | ||
|
||
<!-- <div id="login-form" [@animate]="{value:'*',params:{duration:'300ms',y:'100px'}}">--> | ||
<div id="login-form"> | ||
|
||
<div class="logo"> | ||
<img src="assets/images/logos/fuse.svg"> | ||
</div> | ||
|
||
<div class="title">LOGIN TO YOUR ACCOUNT</div> | ||
|
||
<form name="loginForm" [formGroup]="loginForm" novalidate> | ||
|
||
<mat-form-field> | ||
<input matInput placeholder="Email" formControlName="email"> | ||
<mat-icon matSuffix color="primary">email</mat-icon> | ||
<mat-error *ngIf="loginForm.get('email').hasError('required')"> | ||
Email is required | ||
</mat-error> | ||
<mat-error | ||
*ngIf="!loginForm.get('email').hasError('required') && | ||
loginForm.get('email').hasError('email')"> | ||
Please enter a valid email address | ||
</mat-error> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<input matInput type="password" placeholder="Password" formControlName="password"> | ||
<mat-icon matSuffix color="primary">lock</mat-icon> | ||
<mat-error> | ||
Password is required | ||
</mat-error> | ||
</mat-form-field> | ||
|
||
<div class="remember-forgot-password" fxLayout="row" fxLayout.xs="column" | ||
fxLayoutAlign="space-between center"> | ||
<mat-checkbox class="remember-me" aria-label="Remember Me"> | ||
Remember Me | ||
</mat-checkbox> | ||
|
||
<button mat-button class="forgot-password" color="primary" type="button"> | ||
Forgot Password? | ||
</button> | ||
</div> | ||
|
||
<button mat-raised-button color="accent" class="submit-button" aria-label="LOG IN" | ||
[disabled]="loginForm.invalid"> | ||
LOGIN | ||
</button> | ||
|
||
</form> | ||
|
||
<div class="separator"> | ||
<span class="text">OR</span> | ||
</div> | ||
|
||
<button mat-raised-button class="google"> | ||
Log in with Google | ||
</button> | ||
|
||
<button mat-raised-button class="facebook"> | ||
Log in with Facebook | ||
</button> | ||
|
||
<div class="register" fxLayout="column" fxLayoutAlign="center center"> | ||
<span class="text">Don't have an account?</span> | ||
<button mat-button color="primary" type="button">Create an account</button> | ||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
</div> |
139 changes: 139 additions & 0 deletions
139
src/module/components/ngx-auth-firebaseui-login/ngx-auth-firebaseui-login.component.scss
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,139 @@ | ||
ngx-auth-firebaseui-login { | ||
|
||
#login-form-wrapper { | ||
flex: 1 0 auto; | ||
padding: 32px; | ||
|
||
@media screen and (max-width: 599px) { | ||
padding: 16px; | ||
} | ||
|
||
#login-form { | ||
width: 384px; | ||
max-width: 384px; | ||
padding: 32px; | ||
text-align: center; | ||
//@include mat-elevation(16); | ||
|
||
@media screen and (max-width: 599px) { | ||
padding: 24px; | ||
width: 100%; | ||
} | ||
|
||
.logo { | ||
width: 128px; | ||
margin: 32px auto; | ||
} | ||
|
||
.title { | ||
font-size: 20px; | ||
margin: 16px 0 32px 0; | ||
} | ||
|
||
form { | ||
width: 100%; | ||
text-align: left; | ||
|
||
mat-form-field { | ||
width: 100%; | ||
} | ||
|
||
mat-checkbox { | ||
margin: 0; | ||
} | ||
|
||
.remember-forgot-password { | ||
font-size: 13px; | ||
margin-top: 8px; | ||
|
||
.remember-me { | ||
margin-bottom: 16px | ||
} | ||
|
||
.forgot-password { | ||
font-size: 13px; | ||
font-weight: 500; | ||
margin-bottom: 16px | ||
} | ||
} | ||
|
||
.submit-button { | ||
width: 220px; | ||
margin: 16px auto; | ||
display: block; | ||
|
||
@media screen and (max-width: 599px) { | ||
width: 90%; | ||
} | ||
} | ||
} | ||
|
||
.register { | ||
margin: 32px auto 24px auto; | ||
font-weight: 500; | ||
|
||
.text { | ||
margin-right: 8px; | ||
} | ||
} | ||
|
||
.separator { | ||
font-size: 15px; | ||
font-weight: 600; | ||
margin: 24px auto; | ||
position: relative; | ||
overflow: hidden; | ||
width: 100px; | ||
|
||
.text { | ||
display: inline-flex; | ||
position: relative; | ||
padding: 0 8px; | ||
z-index: 9999; | ||
|
||
&:before, | ||
&:after { | ||
content: ''; | ||
display: block; | ||
width: 30px; | ||
position: absolute; | ||
top: 10px; | ||
border-top: 1px solid; | ||
} | ||
|
||
&:before { | ||
right: 100%; | ||
} | ||
|
||
&:after { | ||
left: 100%; | ||
} | ||
} | ||
} | ||
|
||
button { | ||
|
||
&.google, | ||
&.facebook { | ||
width: 192px; | ||
text-transform: none; | ||
color: #FFFFFF; | ||
font-size: 13px; | ||
margin-bottom: 8px; | ||
} | ||
|
||
@media screen and (max-width: 599px) { | ||
width: 80%; | ||
} | ||
|
||
&.google { | ||
background-color: #D73D32; | ||
} | ||
|
||
&.facebook { | ||
background-color: rgb(63, 92, 154); | ||
} | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/module/components/ngx-auth-firebaseui-login/ngx-auth-firebaseui-login.component.spec.ts
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { NgxAuthFirebaseuiLoginComponent } from './ngx-auth-firebaseui-login.component'; | ||
|
||
describe('NgxAuthFirebaseuiLoginComponent', () => { | ||
let component: NgxAuthFirebaseuiLoginComponent; | ||
let fixture: ComponentFixture<NgxAuthFirebaseuiLoginComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ NgxAuthFirebaseuiLoginComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(NgxAuthFirebaseuiLoginComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
src/module/components/ngx-auth-firebaseui-login/ngx-auth-firebaseui-login.component.ts
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 {Component, OnInit, ViewEncapsulation} from '@angular/core'; | ||
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'ngx-auth-firebaseui-login', | ||
templateUrl: './ngx-auth-firebaseui-login.component.html', | ||
styleUrls: ['./ngx-auth-firebaseui-login.component.scss'], | ||
encapsulation: ViewEncapsulation.None, | ||
}) | ||
export class NgxAuthFirebaseuiLoginComponent implements OnInit { | ||
|
||
loginForm: FormGroup; | ||
|
||
constructor(private _formBuilder: FormBuilder) { | ||
} | ||
|
||
ngOnInit() { | ||
this.loginForm = this._formBuilder.group({ | ||
email: ['', [Validators.required, Validators.email]], | ||
password: ['', Validators.required] | ||
}); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/module/components/ngx-auth-firebaseui-login/ngx-auth-firebaseui-login.theme.scss
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,35 @@ | ||
@mixin login-theme($theme) { | ||
|
||
$background: map-get($theme, background); | ||
$foreground: map-get($theme, foreground); | ||
$is-dark: map-get($theme, is-dark); | ||
|
||
ngx-auth-firebaseui-login { | ||
|
||
#login { | ||
|
||
#login-form-wrapper { | ||
|
||
#login-form { | ||
@if ($is-dark) { | ||
background: mat-color($mat-indigo, 600); | ||
} @else { | ||
background: map-get($background, card); | ||
} | ||
|
||
.separator { | ||
color: map-get($foreground, divider); | ||
|
||
.text { | ||
|
||
&:before, | ||
&:after { | ||
border-top-color: map-get($foreground, divider); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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