Skip to content

Commit

Permalink
fix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
shruti91sri committed Jul 30, 2024
1 parent 50c4d9b commit b13bc3d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
10 changes: 4 additions & 6 deletions apps/golden-sample-app/src/app/theme-switcher/theme-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { Injectable } from '@angular/core';

@Injectable()
export class ThemeManagerService {
public static THEMES = [
'theme-default',
'theme-premium',
];
public static THEMES = ['theme-default', 'theme-premium'];

setTheme(theme: string) {
const linkElement: HTMLLinkElement | null = window.document.head.querySelector('link[rel="stylesheet"]');
setTheme(theme: string) {
const linkElement: HTMLLinkElement | null =
window.document.head.querySelector('link[rel="stylesheet"]');
if (!linkElement) return;
linkElement.href = `${theme}.css`;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { DropdownMenuModule } from "@backbase/ui-ang/dropdown-menu";
import { ThemeSwitcherComponent } from "./theme-switcher.component";
import { NgModule } from "@angular/core";
import { DropdownMenuModule } from '@backbase/ui-ang/dropdown-menu';
import { ThemeSwitcherComponent } from './theme-switcher.component';
import { NgModule } from '@angular/core';

@NgModule({
declarations: [ ThemeSwitcherComponent ],
imports: [ DropdownMenuModule ],
exports: [ ThemeSwitcherComponent ],
declarations: [ThemeSwitcherComponent],
imports: [DropdownMenuModule],
exports: [ThemeSwitcherComponent],
})
export class ThemeSwitcherModule {
}
export class ThemeSwitcherModule {}
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { Component, Input } from "@angular/core";
import { ThemeManagerService } from "./theme-service";
import { Component, Input } from '@angular/core';
import { ThemeManagerService } from './theme-service';

@Component({
selector: 'app-theme-switcher',
templateUrl: './theme-switcher.component.html',
selector: 'app-theme-switcher',
templateUrl: './theme-switcher.component.html',
})
export class ThemeSwitcherComponent{
export class ThemeSwitcherComponent {
constructor(private themeManagerService: ThemeManagerService) {}

constructor(private themeManagerService: ThemeManagerService){}

@Input()theme = ThemeManagerService.THEMES[0];
@Input() theme = ThemeManagerService.THEMES[0];

themes = ThemeManagerService.THEMES;

onSelect(theme: string | object) {
if(typeof theme === 'string'){
if (typeof theme === 'string') {
this.themeManagerService.setTheme(theme);
this.theme = theme;
}
Expand Down

0 comments on commit b13bc3d

Please sign in to comment.