added modalnavbar
This commit is contained in:
@@ -1,46 +1,74 @@
|
|||||||
:host {
|
:host {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-layout {
|
.app-layout {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-nav {
|
.top-nav {
|
||||||
line-height: 64px;
|
line-height: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
float: left;
|
float: left;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
padding-right: 24px;
|
padding-right: 24px;
|
||||||
line-height: 64px;
|
line-height: 64px;
|
||||||
background: #001529;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo img {
|
.logo img {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo h1 {
|
.logo h1 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0 0 0 15px;
|
margin: 0 0 0 15px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif;
|
font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
nz-content {
|
nz-content {
|
||||||
padding: 24px 50px;
|
padding: 24px 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inner-content {
|
.inner-content {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-nav {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-icons {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 18px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-icons nz-icon:hover {
|
||||||
|
color: #40a9ff;
|
||||||
}
|
}
|
||||||
@@ -57,9 +57,15 @@
|
|||||||
<span>Utilisateur</span>
|
<span>Utilisateur</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li nz-menu-item><nz-icon nzType="bell" nzTheme="outline" /></li>
|
<li nz-menu-item>
|
||||||
<li nz-menu-item><nz-icon nzType="user" nzTheme="outline" /></li>
|
<app-modalNav nameIcon="bell" name="Notification"></app-modalNav>
|
||||||
<li nz-menu-item><nz-icon nzType="setting" nzTheme="outline" /></li>
|
</li>
|
||||||
|
<li nz-menu-item>
|
||||||
|
<app-modalNav nameIcon="user" name="Profil"></app-modalNav>
|
||||||
|
</li>
|
||||||
|
<li nz-menu-item>
|
||||||
|
<app-modalNav nameIcon="setting" name="Paramètres"></app-modalNav>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nz-header>
|
</nz-header>
|
||||||
<nz-content>
|
<nz-content>
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import { NzLayoutModule } from 'ng-zorro-antd/layout';
|
|||||||
import { NzMenuModule } from 'ng-zorro-antd/menu';
|
import { NzMenuModule } from 'ng-zorro-antd/menu';
|
||||||
import {NzFlexDirective} from "ng-zorro-antd/flex";
|
import {NzFlexDirective} from "ng-zorro-antd/flex";
|
||||||
import {NzIconDirective} from "ng-zorro-antd/icon";
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
||||||
|
import {ModalNav} from "./components/modalNav/modalNav";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzFlexDirective, NzIconDirective, RouterLinkActive, RouterLink],
|
imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzFlexDirective, NzIconDirective, RouterLinkActive, RouterLink, ModalNav],
|
||||||
templateUrl: './app.html',
|
templateUrl: './app.html',
|
||||||
styleUrl: './app.css'
|
styleUrl: './app.css'
|
||||||
})
|
})
|
||||||
|
|||||||
0
src/app/components/modalNav/modalNav.css
Normal file
0
src/app/components/modalNav/modalNav.css
Normal file
18
src/app/components/modalNav/modalNav.html
Normal file
18
src/app/components/modalNav/modalNav.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<div (click)="showModal()">
|
||||||
|
<nz-icon [nzType]="nameIcon" nzTheme="outline"></nz-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ng-template #modalContent>
|
||||||
|
<ng-content></ng-content>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<nz-modal
|
||||||
|
[(nzVisible)]="isVisible"
|
||||||
|
[nzTitle]="name"
|
||||||
|
(nzOnCancel)="handleCancel()"
|
||||||
|
(nzOnOk)="handleOk()"
|
||||||
|
[nzOkLoading]="isOkLoading"
|
||||||
|
[nzContent]="modalContent"
|
||||||
|
>
|
||||||
|
</nz-modal>
|
||||||
|
|
||||||
34
src/app/components/modalNav/modalNav.ts
Normal file
34
src/app/components/modalNav/modalNav.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import {Component, Input, input} from '@angular/core';
|
||||||
|
import { NzButtonModule } from 'ng-zorro-antd/button';
|
||||||
|
import { NzModalModule } from 'ng-zorro-antd/modal';
|
||||||
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-modalNav',
|
||||||
|
imports: [NzButtonModule, NzModalModule, NzIconDirective],
|
||||||
|
templateUrl: 'modalNav.html',
|
||||||
|
styleUrls: ['./modalNav.css'],
|
||||||
|
})
|
||||||
|
export class ModalNav {
|
||||||
|
@Input() nameIcon: string = '';
|
||||||
|
@Input() name: string = '';
|
||||||
|
|
||||||
|
isVisible = false;
|
||||||
|
isOkLoading = false;
|
||||||
|
|
||||||
|
showModal(): void {
|
||||||
|
this.isVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
handleOk(): void {
|
||||||
|
this.isOkLoading = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isVisible = false;
|
||||||
|
this.isOkLoading = false;
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleCancel(): void {
|
||||||
|
this.isVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
<p>welcome works!</p>
|
<p>hello work</p>
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import {ModalNav} from "../../components/modalNav/modalNav";
|
||||||
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-welcome',
|
selector: 'app-welcome',
|
||||||
imports: [],
|
imports: [
|
||||||
|
ModalNav,
|
||||||
|
NzIconDirective
|
||||||
|
],
|
||||||
templateUrl: './welcome.html',
|
templateUrl: './welcome.html',
|
||||||
styleUrl: './welcome.css'
|
styleUrl: './welcome.css'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user