mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-30 13:15:16 +01:00
refactor(app): make a bit more neat structure
This commit is contained in:
parent
91c780c256
commit
44f2f562a9
20 changed files with 24 additions and 17 deletions
|
|
@ -0,0 +1,16 @@
|
|||
@mixin base-header-theme() {
|
||||
/deep/ base-header {
|
||||
.logo > a {
|
||||
color: $nga-color-secondary !important;
|
||||
|
||||
@include hover-focus-active {
|
||||
color: $nga-color-inverse !important;
|
||||
}
|
||||
}
|
||||
|
||||
.left > *,
|
||||
.right > * {
|
||||
border-color: rgba($nga-color-inverse, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
:host {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
i.control-icon {
|
||||
&::before {
|
||||
font-size: 2.3rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
& > * {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
> * {
|
||||
padding: 0 1.25rem;
|
||||
border-right-width: 1px;
|
||||
border-right-style: solid;
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.control-icon.ion-navicon {
|
||||
font-size: 2.8rem;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 1.7rem;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
|
||||
a {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
> * {
|
||||
padding: 0 1.25rem;
|
||||
border-left-width: 1px;
|
||||
border-left-style: solid;
|
||||
|
||||
&:first-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
import { NgaSidebarService, NgaMenuService } from '@nga/theme';
|
||||
import { NgaThemeService } from '@nga/theme/services/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'base-header',
|
||||
styleUrls: ['./base-header.component.scss'],
|
||||
template: `
|
||||
<div class="left">
|
||||
<i class="control-icon ion ion-navicon" (click)="toggleSidebar()"></i>
|
||||
<span class="logo" (click)="goToHome()">NgX <a>Admin</a></span>
|
||||
<button (click)="switchTheme()">Switch Theme!</button>
|
||||
</div>
|
||||
<div class="right">
|
||||
<search-input></search-input>
|
||||
<i class="control-icon ion ion-ios-email-outline"></i>
|
||||
<i class="control-icon ion ion-ios-bell-outline"></i>
|
||||
<nga-user></nga-user>
|
||||
<i class="control-icon ion ion-ios-gear-outline"></i>
|
||||
</div>
|
||||
`,
|
||||
})
|
||||
export class BaseHeaderComponent {
|
||||
constructor(private sidebarService: NgaSidebarService,
|
||||
private menuService: NgaMenuService,
|
||||
private themeService: NgaThemeService) {
|
||||
}
|
||||
|
||||
toggleSidebar() {
|
||||
this.sidebarService.toggle(true);
|
||||
}
|
||||
|
||||
goToHome() {
|
||||
this.menuService.navigateHome();
|
||||
}
|
||||
|
||||
switchTheme() {
|
||||
if (this.themeService.currentTheme == 'pure') {
|
||||
this.themeService.changeTheme('gorgeous');
|
||||
} else {
|
||||
this.themeService.changeTheme('pure');
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue