WEB-653 feat(login): add tenant-specific logo support for dark mode (#3074)
improve
This commit is contained in:
@@ -81,7 +81,12 @@
|
||||
@if (!themeDarkEnabled) {
|
||||
<img [src]="logoPath" (error)="onLogoError()" alt="{{ 'APP_NAME' | translate }} Logo" class="logo-image" />
|
||||
} @else {
|
||||
<img src="assets/images/white-mifos.png" alt="{{ 'APP_NAME' | translate }} Logo" class="logo-image" />
|
||||
<img
|
||||
[src]="logoPathDark"
|
||||
(error)="onLogoErrorDark()"
|
||||
alt="{{ 'APP_NAME' | translate }} Logo"
|
||||
class="logo-image"
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
/** Subscription to alerts. */
|
||||
alert$: Subscription;
|
||||
logoPath = 'assets/images/default_home.png';
|
||||
logoPathDark = 'assets/images/white-mifos.png';
|
||||
/** Subscription to theme changes. */
|
||||
theme$: Subscription;
|
||||
|
||||
@@ -205,19 +206,29 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
updateLogo(): void {
|
||||
const tenant = this.settingsService.tenantIdentifier;
|
||||
const isTenantSpecific = tenant && tenant !== 'default';
|
||||
|
||||
// Set light mode logo (env override takes priority)
|
||||
if (environment.tenantLogoUrl && environment.tenantLogoUrl.trim() !== '') {
|
||||
this.logoPath = environment.tenantLogoUrl;
|
||||
return;
|
||||
}
|
||||
const tenant = this.settingsService.tenantIdentifier;
|
||||
if (tenant && tenant !== 'default') {
|
||||
this.logoPath = `assets/images/${tenant}_home.png`;
|
||||
} else {
|
||||
this.logoPath = 'assets/images/default_home.png';
|
||||
this.logoPath = isTenantSpecific ? `assets/images/${tenant}_home.png` : 'assets/images/default_home.png';
|
||||
}
|
||||
|
||||
// Set dark mode logo (env override takes priority)
|
||||
if (environment.tenantLogoUrlDark && environment.tenantLogoUrlDark.trim() !== '') {
|
||||
this.logoPathDark = environment.tenantLogoUrlDark;
|
||||
} else {
|
||||
this.logoPathDark = isTenantSpecific ? `assets/images/${tenant}_home_dark.png` : 'assets/images/white-mifos.png';
|
||||
}
|
||||
}
|
||||
|
||||
onLogoError(): void {
|
||||
this.logoPath = 'assets/images/default_home.png';
|
||||
}
|
||||
|
||||
onLogoErrorDark(): void {
|
||||
this.logoPathDark = 'assets/images/white-mifos.png';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user