X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fui%2Fconfirm-dialog.service.ts;h=297e67355a9dc2ddd57052590b5790519f64b9b5;hb=53f1fcf033e3a166d7203e0a1c5e0971f9c6bc16;hp=0eccc631b4fee8dcbd624f5d38bd455bd9cc7b74;hpb=480b67bbc8accad983e84d8d0e4e74b3fae2802d;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/services/ui/confirm-dialog.service.ts b/webapp-frontend/src/app/services/ui/confirm-dialog.service.ts index 0eccc631..297e6735 100644 --- a/webapp-frontend/src/app/services/ui/confirm-dialog.service.ts +++ b/webapp-frontend/src/app/services/ui/confirm-dialog.service.ts @@ -2,7 +2,7 @@ * ========================LICENSE_START================================= * O-RAN-SC * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * Copyright (C) 2019 AT&T Intellectual Property * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,34 @@ */ import { Injectable } from '@angular/core'; -import { MatDialog } from '@angular/material'; -import { ConfirmDialogComponent } from './../../ui/confirm-dialog/confirm-dialog.component' +import { MatDialog } from '@angular/material/dialog'; +import { ConfirmDialogComponent } from './../../ui/confirm-dialog/confirm-dialog.component'; +import { UiService } from './ui.service'; @Injectable({ providedIn: 'root' }) -export class ConfirmDialogService { +export class ConfirmDialogService { - constructor(private dialog: MatDialog) { } + darkMode: boolean; + panelClass: string = ""; - openConfirmDialog(msg) { + constructor(private dialog: MatDialog, + public ui: UiService) { } + + openConfirmDialog(msg: string) { + this.ui.darkModeState.subscribe((isDark) => { + this.darkMode = isDark; + }); + if (this.darkMode) { + this.panelClass = "dark-theme"; + } else { + this.panelClass = ""; + } return this.dialog.open(ConfirmDialogComponent, { + panelClass: this.panelClass, width: '480px', - position: { top: "100px" }, + position: { top: '100px' }, data: { message: msg }