Replace "my account" button by the user icon.
This commit is contained in:
@@ -17,8 +17,16 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item dropdown" dropdown *ngIf="isAuthenticated()">
|
<li class="nav-item dropdown" dropdown *ngIf="isAuthenticated()">
|
||||||
<a dropdownToggle mdbRippleRadius type="button" class="nav-link dropdown-toggle waves-light" mdbRippleRadius>
|
<a dropdownToggle
|
||||||
<i class="fa fa-user-circle"></i> Mon Compte
|
mdbRippleRadius
|
||||||
|
type="button"
|
||||||
|
class="nav-link waves-light"
|
||||||
|
mdbTooltip="Mon compte"
|
||||||
|
placement="bottom"
|
||||||
|
mdbRippleRadius>
|
||||||
|
<img id="user-profile-img"
|
||||||
|
[src]="getConnectedUserImage()"
|
||||||
|
(error)="onUserProfileLoadingError($event)"/>
|
||||||
</a>
|
</a>
|
||||||
<div *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown dropdown-primary" role="menu">
|
<div *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown dropdown-primary" role="menu">
|
||||||
<a class="dropdown-item waves-light" mdbRippleRadius routerLink="/myPosts">
|
<a class="dropdown-item waves-light" mdbRippleRadius routerLink="/myPosts">
|
||||||
@@ -47,7 +55,10 @@
|
|||||||
<i class="fa fa-chevron-left"></i>
|
<i class="fa fa-chevron-left"></i>
|
||||||
</a>
|
</a>
|
||||||
<div *ngFor="let category of listCategories">
|
<div *ngFor="let category of listCategories">
|
||||||
<a [id]="'category-' + category.id" class="collapsible" *ngIf="category.listSubCategories.length" (click)="openCategoriesLinks(category)">
|
<a [id]="'category-' + category.id"
|
||||||
|
class="collapsible"
|
||||||
|
*ngIf="!!category.listSubCategories && category.listSubCategories.length"
|
||||||
|
(click)="openCategoriesLinks(category)">
|
||||||
{{category.name}} <i class="fa {{accordionOpenned[category.id] ? 'fa-chevron-down' : 'fa-chevron-right'}} float-right"></i>
|
{{category.name}} <i class="fa {{accordionOpenned[category.id] ? 'fa-chevron-down' : 'fa-chevron-right'}} float-right"></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="categoriesLinks" >
|
<div class="categoriesLinks" >
|
||||||
|
|||||||
@@ -27,42 +27,48 @@
|
|||||||
overflow-x: hidden; /* Disable horizontal scroll */
|
overflow-x: hidden; /* Disable horizontal scroll */
|
||||||
padding-top: 20px; /* Place content 60px from the top */
|
padding-top: 20px; /* Place content 60px from the top */
|
||||||
transition: 0.3s; /* 0.5 second transition effect to slide in the sidenav */
|
transition: 0.3s; /* 0.5 second transition effect to slide in the sidenav */
|
||||||
}
|
|
||||||
|
|
||||||
/* The navigation menu links */
|
/* The navigation menu links */
|
||||||
.sidenav a {
|
a {
|
||||||
padding: 8px 32px 8px 32px;
|
padding: 8px 32px 8px 32px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
display: block;
|
display: block;
|
||||||
transition: 0.3s;
|
transition: 0.3s;
|
||||||
}
|
|
||||||
|
|
||||||
/* When you mouse over the navigation links, change their color */
|
/* When you mouse over the navigation links, change their color */
|
||||||
.sidenav a:hover {
|
&:hover {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
background-color: #5c6bc0;
|
background-color: #5c6bc0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.sidenav h3 {
|
h3 {
|
||||||
padding: 8px 8px 8px 32px;
|
padding: 8px 8px 8px 32px;
|
||||||
color: white;
|
color: white;
|
||||||
padding-bottom: 25px;
|
padding-bottom: 25px;
|
||||||
border-bottom: 1px solid #5c6bc0;
|
border-bottom: 1px solid #5c6bc0;
|
||||||
}
|
}
|
||||||
/* Position and style the close button (top right corner) */
|
|
||||||
.sidenav .closebtn {
|
/* Position and style the close button (top right corner) */
|
||||||
position: absolute;
|
.closebtn {
|
||||||
top: 25px;
|
position: absolute;
|
||||||
right: 25px;
|
top: 25px;
|
||||||
margin-left: 50px;
|
right: 25px;
|
||||||
padding: 8px;
|
margin-left: 50px;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
|
/* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
|
||||||
@media screen and (max-height: 450px) {
|
@media screen and (max-height: 450px) {
|
||||||
.sidenav {padding-top: 15px;}
|
.sidenav {
|
||||||
.sidenav a {font-size: 18px;}
|
padding-top: 15px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#overlay {
|
#overlay {
|
||||||
@@ -74,8 +80,8 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: rgba(0,0,0,0.5); /* Black background with opacity */
|
background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
|
||||||
z-index: 999; /* Specify a stack order in case you're using a different order for other elements */
|
z-index: 1031; /* Specify a stack order in case you're using a different order for other elements */
|
||||||
transition: 0.5s;
|
transition: 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +90,10 @@
|
|||||||
max-height: 0;
|
max-height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: max-height 0.2s ease-out;
|
transition: max-height 0.2s ease-out;
|
||||||
|
|
||||||
|
a {
|
||||||
|
padding-left: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-item.danger-color-dark:hover {
|
.dropdown-item.danger-color-dark:hover {
|
||||||
@@ -93,3 +103,15 @@
|
|||||||
.collapsible i.fa {
|
.collapsible i.fa {
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#user-profile-img {
|
||||||
|
filter: opacity(1);
|
||||||
|
transition: filter 0.3s;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 35px;
|
||||||
|
height: 35px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
filter: opacity(0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { HeaderService } from './header.service';
|
|||||||
import { environment } from '../../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
|
|
||||||
const SIDENAV_WIDTH = '300px';
|
const SIDENAV_WIDTH = '300px';
|
||||||
|
const DEFAULT_USER_ICON = '../../assets/images/default_user_icon.png';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
@@ -80,4 +81,13 @@ export class HeaderComponent implements OnInit {
|
|||||||
this.accordionOpenned[category.id] = true;
|
this.accordionOpenned[category.id] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getConnectedUserImage() {
|
||||||
|
const userImage = this.authService.getUser().image;
|
||||||
|
return !!userImage ? `./api/images/loadAvatar/${userImage}` : DEFAULT_USER_ICON;
|
||||||
|
}
|
||||||
|
|
||||||
|
onUserProfileLoadingError(event): void {
|
||||||
|
event.target.src = DEFAULT_USER_ICON;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user