-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
238 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,12 @@ | ||
<nav class="menu"> | ||
<img class="logo" [src]="logo" i18n-alt alt="logo" /> | ||
<a | ||
mat-button | ||
*ngFor="let route of routeConfig" | ||
[routerLink]="[route.link]" | ||
[routerLinkActive]="['route-active']" | ||
[routerLinkActiveOptions]="{ exact: true }" | ||
> | ||
{{ route.label }} | ||
</a> | ||
</nav> |
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,71 @@ | ||
@use '../../../variables' as *; | ||
|
||
.menu { | ||
position: fixed; | ||
z-index: 9; | ||
top: 0; | ||
right: 0; | ||
left: 0; | ||
height: 68px; | ||
background: linear-gradient( | ||
90deg | ||
, #1b1f26 0%, #2b323d 100%); | ||
color: $white; | ||
|
||
.logo { | ||
margin: 20px 10px 0 25px; | ||
float: left; | ||
} | ||
} | ||
|
||
.mat-button { | ||
min-width: 0; | ||
padding: 0; | ||
margin: 0 16px 0 16px; | ||
line-height: 68px; | ||
|
||
&.route-active::after { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 4px; | ||
background-color: map-get($sormas-primary, 700); | ||
content: ''; | ||
} | ||
} | ||
|
||
@media (min-width: map-get($grid-breakpoints, md)) { | ||
.mat-button { | ||
margin: 0 12px; | ||
} | ||
} | ||
|
||
@media (min-width: map-get($grid-breakpoints, lg)) { | ||
.mat-button { | ||
margin: 0 16px; | ||
} | ||
} | ||
|
||
@media (max-width: map-get($grid-breakpoints, md)) { | ||
.menu { | ||
flex-direction: column; | ||
} | ||
|
||
.mat-button { | ||
display: block; | ||
width: 100%; | ||
padding: 1em; | ||
margin: 0; | ||
color: $white; | ||
line-height: 1; | ||
|
||
&.route-active { | ||
color: map-get($sormas-primary, 700); | ||
} | ||
|
||
&.route-active::after { | ||
display: none; | ||
} | ||
} | ||
} |
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,24 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MenuComponent } from './menu.component'; | ||
|
||
describe('MenuComponent', () => { | ||
let component: MenuComponent; | ||
let fixture: ComponentFixture<MenuComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [MenuComponent], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MenuComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,25 @@ | ||
import { Component } from '@angular/core'; | ||
import logoPath from '../../../assets/img/sormas-logo.svg'; | ||
|
||
export interface RouteItem { | ||
link: string; | ||
label: string; | ||
} | ||
|
||
export const routesConfig: RouteItem[] = [ | ||
{ link: '', label: $localize`Dashboard` }, | ||
{ link: 'about', label: $localize`About` }, | ||
{ link: 'tasks', label: $localize`Tasks` }, | ||
{ link: 'cases/list', label: $localize`Cases` }, | ||
{ link: 'user-profile', label: $localize`My profile` }, | ||
]; | ||
|
||
@Component({ | ||
selector: 'app-menu', | ||
templateUrl: './menu.component.html', | ||
styleUrls: ['./menu.component.scss'], | ||
}) | ||
export class MenuComponent { | ||
routeConfig: RouteItem[] = routesConfig; | ||
logo = logoPath; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<div [dir]="direction"> | ||
<app-layout> | ||
<router-outlet></router-outlet> | ||
</app-layout> | ||
<div [dir]="direction" class="main-wrapper"> | ||
<app-menu></app-menu> | ||
<router-outlet></router-outlet> | ||
</div> |
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,4 @@ | ||
.main-wrapper { | ||
height: 100%; | ||
padding-top: 68px; | ||
} |
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
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
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
Oops, something went wrong.