-
Notifications
You must be signed in to change notification settings - Fork 4
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 authentication providers' component
- Loading branch information
1 parent
69ccdd1
commit f18533a
Showing
9 changed files
with
150 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,3 +300,4 @@ | |
|
||
</ngb-tab> | ||
</ngb-tabset> | ||
<ngb-auth-firebaseui-providers class="mt-2"></ngb-auth-firebaseui-providers> |
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
9 changes: 9 additions & 0 deletions
9
src/auth/module/components/progress-bar/progress-bar.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,9 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ngb-auth-firebaseui-progress-bar', | ||
templateUrl: './progress-bar.component.html', | ||
styleUrls: ['./progress-bar.component.scss'] | ||
}) | ||
export class ProgressBarComponent { | ||
} |
30 changes: 30 additions & 0 deletions
30
src/auth/module/components/providers/auth.providers.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,30 @@ | ||
<div class="container"> | ||
|
||
<div class="row "> | ||
<button *ngIf="providers === authProvider.ALL || providers.includes(authProvider.Google)" | ||
class="btn btn-google my-1 mx-sm-0 col-md-3 col-sm-6 col-xs-12 text-center" | ||
(click)="authProcess.signInWith(authProvider.Google)"> | ||
<span class="fa fa-google"></span> | ||
</button> | ||
<button *ngIf="providers === authProvider.ALL || providers.includes(authProvider.Facebook)" | ||
class="btn btn-facebook my-1 mx-sm-0 col-md-3 col-sm-6 col-xs-12 text-center" | ||
(click)="authProcess.signInWith(authProvider.Facebook)"> | ||
<span class="fa fa-facebook"></span> | ||
</button> | ||
<button *ngIf="providers === authProvider.ALL || providers.includes(authProvider.Twitter)" | ||
class="btn btn-twitter my-1 mx-sm-0 col-md-3 col-sm-6 col-xs-12 text-center" | ||
(click)="authProcess.signInWith(authProvider.Twitter)"> | ||
<span class="fa fa-twitter"></span> | ||
</button> | ||
<button *ngIf="providers === authProvider.ALL || providers.includes(authProvider.Github)" | ||
class="btn btn-github my-1 mx-sm-0 col-md-3 col-sm-6 col-xs-12 text-center" | ||
(click)="authProcess.signInWith(authProvider.Github)"> | ||
<span class="fa fa-github"></span> | ||
GitHub | ||
</button> | ||
</div> | ||
|
||
</div> |
54 changes: 54 additions & 0 deletions
54
src/auth/module/components/providers/auth.providers.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,54 @@ | ||
$google: #db4437; | ||
$facebook: #385899; | ||
$facebook-hover: #2d4373; | ||
$twitter: #1da1f2; | ||
$twitter-hover: #2795e9; | ||
$github: #444; | ||
$github-hover: #000000; | ||
|
||
:host { | ||
display: block; | ||
} | ||
|
||
.space-full-xs { | ||
width: 100%; | ||
margin: .4rem; | ||
} | ||
|
||
.btn { | ||
color: white; | ||
} | ||
|
||
.btn-google { | ||
background-color: $google; | ||
} | ||
|
||
.btn-google:hover { | ||
background-color: #c23321; | ||
} | ||
|
||
.btn-facebook { | ||
background-color: $facebook; | ||
} | ||
|
||
.btn-facebook:hover { | ||
background-color: $facebook-hover; | ||
} | ||
|
||
.btn-twitter { | ||
background-color: $twitter; | ||
} | ||
|
||
.btn-twitter:hover { | ||
background-color: $twitter-hover; | ||
} | ||
|
||
.btn-github { | ||
background-color: $github; | ||
} | ||
|
||
.btn-github:hover { | ||
background-color: $github-hover; | ||
} | ||
|
||
|
28 changes: 28 additions & 0 deletions
28
src/auth/module/components/providers/auth.providers.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,28 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {AuthProcessService, AuthProvider} from '../../services/auth-process.service'; | ||
|
||
export enum Layout { | ||
ROW = 'row', | ||
COLUMN = 'column' | ||
} | ||
|
||
@Component({ | ||
selector: 'ngb-auth-firebaseui-providers', | ||
templateUrl: 'auth.providers.component.html', | ||
styleUrls: ['auth.providers.component.scss'] | ||
}) | ||
|
||
export class AuthProvidersComponent { | ||
|
||
@Input() | ||
layout: string = Layout.ROW; | ||
|
||
@Input() | ||
providers: string[] | string = AuthProvider.ALL; // google, facebook, twitter, github | ||
|
||
authProvider = AuthProvider; | ||
|
||
constructor(public authProcess: AuthProcessService) { | ||
} | ||
|
||
} |
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