Skip to content

Commit c278f11

Browse files
committed
feat(Auth0): Log Out functionality
1 parent 515ccea commit c278f11

File tree

7 files changed

+107
-6
lines changed

7 files changed

+107
-6
lines changed
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1-
<div class="admin-bar-wrapper">
2-
admin bar
1+
<div class="admin-bar-wrapper" [ngClass]="{'admin-bar-expanded': expanded}">
2+
<div class="admin-bar-toggle">
3+
<span class="toggle-button fa-stack" *ngIf="expanded else collapsed" (click)="toggleSidenav()">
4+
<i class="fas fa-circle fa-stack-2x"></i>
5+
<i class="fas fa-angle-left fa-stack-1x dark-icon"></i>
6+
</span>
7+
<ng-template #collapsed>
8+
<span class="toggle-button fa-stack" (click)="toggleSidenav()">
9+
<i class="fas fa-circle fa-stack-2x"></i>
10+
<i class="fas fa-angle-right fa-stack-1x dark-icon"></i>
11+
</span>
12+
</ng-template>
13+
14+
</div>
15+
<div class="admin-bar-actions">
16+
<!-- admin actions-->
17+
</div>
18+
<div class="user-actions" (mouseover)="doorOpen = true" (mouseout)="doorOpen = false" (click)="auth.logout()">
19+
<i class="fas fa-door-open" *ngIf="doorOpen else doorClosed"></i>
20+
<ng-template #doorClosed>
21+
<div>
22+
<i class="fas fa-door-closed"></i>
23+
</div>
24+
</ng-template>
25+
</div>
326
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
// Core
22
import { Component } from '@angular/core';
33

4+
// App specific
5+
import { AuthService } from '../../shared/auth-service/auth.service';
6+
47
@Component({
58
selector: 'app-admin-bar',
69
templateUrl: 'admin-bar.component.html'
710
})
811
export class AdminBarComponent {
912

13+
expanded = false;
14+
doorOpen = false;
15+
16+
constructor(public auth: AuthService) {
17+
}
18+
19+
toggleSidenav(): void {
20+
this.expanded = !this.expanded;
21+
}
1022
}

src/app/shared/auth-service/auth.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class AuthService {
117117
// Call method to log out
118118
client.logout({
119119
client_id: environment.client_id,
120-
returnTo: `${window.location.origin}/kantun`
120+
returnTo: `${window.location.origin}`
121121
});
122122
});
123123
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { NavigationInteface } from './navigation.inteface';
2+
3+
export const AdminNavigation: NavigationInteface[] = [
4+
{
5+
linkIcon: 'fas fa-tachometer-alt',
6+
linkName: 'Dashboard',
7+
linkPath: ''
8+
},
9+
// {
10+
// linkIcon: 'fab fa-superpowers',
11+
// linkName: 'SUPERPOWERS',
12+
// linkPath: 'skills',
13+
// linkSubName: 'SKILLS'
14+
// }
15+
];
Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
.admin-bar-wrapper {
2-
width: 100%;
3-
height: 70px;
42
background-color: $back-vari-2;
3+
max-width: 300px;
4+
height: 100%;
5+
display: flex;
6+
flex-flow: column;
7+
width: 84px;
8+
transition: width 0.3s;
9+
10+
.admin-bar-toggle {
11+
padding: 1em 1.4em 1em 1em;
12+
13+
.toggle-button {
14+
font-size: 1.4em;
15+
cursor: pointer;
16+
color: $brand-secondary;
17+
transition: 0.3s;
18+
transform: translateX(0);
19+
float: right;
20+
21+
22+
&:hover {
23+
color: $neon-pink;
24+
transform: translateX(.3em);
25+
}
26+
}
27+
}
28+
29+
.admin-bar-actions {
30+
padding: 1em;
31+
border: solid 1px orange;
32+
}
33+
34+
.user-actions {
35+
padding: 1em;
36+
37+
i {
38+
font-size: 2em;
39+
cursor: pointer;
40+
color: $brand-primary;
41+
}
42+
43+
}
44+
}
45+
46+
.admin-bar-expanded {
47+
transition: width 0.3s;
48+
width: 300px;
549
}

src/assets/styles/components/_buttons.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ button {
3636
}
3737
}
3838
}
39+
40+
41+
.dark-icon {
42+
color: $base-background;
43+
}

src/assets/styles/layout/_admin-wrapper.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
left: 0;
66
right: 0;
77
background-color: $base-background;
8-
}
8+
display: flex;
9+
flex-flow: row;
10+
}

0 commit comments

Comments
 (0)