move dev menu slider and show it only in dev mode env

This commit is contained in:
Baptiste Lemoine 2020-10-21 17:02:01 +02:00
parent e5214fdd97
commit 6059533c36
4 changed files with 14 additions and 7 deletions

View File

@ -6,10 +6,14 @@
<mat-sidenav-content> <mat-sidenav-content>
<div id="big_container" [class]="themeClass"> <div id="big_container" [class]="themeClass">
<div class="container"> <div class="container">
<mat-slide-toggle (change)="sidenav.toggle()">Dev Menu</mat-slide-toggle>
<app-header [appTitle]="appTitle" [appLogo]="appLogo"></app-header> <app-header [appTitle]="appTitle" [appLogo]="appLogo"></app-header>
<main> <main>
<router-outlet></router-outlet> <router-outlet></router-outlet>
<div *ngIf="devModeEnabled">
<br />
<mat-slide-toggle (change)="sidenav.toggle()" label="dev menu"> </mat-slide-toggle> menu
développeur
</div>
</main> </main>
<app-footer></app-footer> <app-footer></app-footer>
<app-feedback></app-feedback> <app-feedback></app-feedback>

View File

@ -18,20 +18,18 @@ export class AppComponent implements OnInit, OnDestroy {
public appLogo: string = environment.appLogo; public appLogo: string = environment.appLogo;
public themeClass: string; public themeClass: string;
public isSidebarOpened = false; public isSidebarOpened = false;
public devModeEnabled = !environment.production;
private themeSubscription: Subscription; private themeSubscription: Subscription;
constructor( constructor(
private titleService: Title, private titleService: Title,
private themeService: ThemeService, private themeService: ThemeService,
private languageService: LanguageService private languageService: LanguageService // private mockingService: MockingService
) // private mockingService: MockingService ) {}
{}
ngOnInit(): void { ngOnInit(): void {
if (!environment.production) { if (!environment.production) {
this.appTitle += ' [DEV]'; this.appTitle += ' [DEV]';
// TODO: to be removed
// this.mockingService.init();
} }
this.titleService.setTitle(this.appTitle); this.titleService.setTitle(this.appTitle);
this.languageService.configureAndInitTranslations(); this.languageService.configureAndInitTranslations();

View File

@ -1,5 +1,8 @@
:host { :host {
header { header {
nav {
padding-right: 1em;
}
.container { .container {
padding: 0; padding: 0;
} }

View File

@ -18,5 +18,7 @@ export class UserPollsComponent implements OnInit {
ngOnInit(): void {} ngOnInit(): void {}
sendRetrieveEmail() {} sendRetrieveEmail() {
alert('TODO');
}
} }