diff --git a/docs/app/shared/components/material-theme-link/material-theme-link.component.html b/docs/app/shared/components/material-theme-link/material-theme-link.component.html index 737fce2e..b69caa37 100644 --- a/docs/app/shared/components/material-theme-link/material-theme-link.component.html +++ b/docs/app/shared/components/material-theme-link/material-theme-link.component.html @@ -1,12 +1,16 @@ +
+ Material Theme +

New theme is available!

diff --git a/docs/app/shared/components/material-theme-link/material-theme-link.component.scss b/docs/app/shared/components/material-theme-link/material-theme-link.component.scss index 5f29cf16..6f101d09 100644 --- a/docs/app/shared/components/material-theme-link/material-theme-link.component.scss +++ b/docs/app/shared/components/material-theme-link/material-theme-link.component.scss @@ -5,7 +5,6 @@ @include nb-install-component() { $menu-item-fg: nb-theme(color-fg-heading-light); $menu-item-fg-active: nb-theme(header-menu-fg-active); - $header-font-weight: nb-theme(header-font-weight); :host { display: flex; @@ -15,7 +14,7 @@ a { text-decoration: none; - font-weight: $header-font-weight; + font-weight: 600; font-size: 13px; line-height: 1.5rem; padding: 0.675rem 1.375rem; diff --git a/docs/app/shared/landing-shared.module.ts b/docs/app/shared/landing-shared.module.ts index 2ed3ea40..7f2f51b7 100644 --- a/docs/app/shared/landing-shared.module.ts +++ b/docs/app/shared/landing-shared.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import {NbPopoverModule} from '@nebular/theme'; +import {NbBadgeModule, NbPopoverModule} from '@nebular/theme'; import { MaterialThemeLinkComponent } from './components/material-theme-link/material-theme-link.component'; import { CapitalizePipe } from './pipes/capitalize.pipe'; import { EvaIconsPipe } from './pipes/eva-icons.pipe'; @@ -9,7 +9,7 @@ const component = [MaterialThemeLinkComponent]; const pipes = [CapitalizePipe, EvaIconsPipe]; @NgModule({ - imports: [RouterModule, NbPopoverModule], + imports: [RouterModule, NbPopoverModule, NbBadgeModule], declarations: [...component, ...pipes], exports: [NbPopoverModule, ...component, ...pipes], }) diff --git a/src/app/@core/utils/theme.service.ts b/src/app/@core/utils/theme.service.ts index e1dcef33..8b663ecc 100644 --- a/src/app/@core/utils/theme.service.ts +++ b/src/app/@core/utils/theme.service.ts @@ -20,6 +20,10 @@ export class CurrentThemeService implements OnDestroy { localStorage.setItem('theme', JSON.stringify(currentTheme)); } + getCurrentTheme(): string { + return JSON.parse(localStorage.theme).themeName; + } + calculateExpiration(iat: number): number { const currentDate = new Date().getTime(); const timestamp = iat || Math.floor(Date.now() / 1000); diff --git a/src/app/@theme/components/header/header.component.ts b/src/app/@theme/components/header/header.component.ts index a6432dbe..10a45648 100644 --- a/src/app/@theme/components/header/header.component.ts +++ b/src/app/@theme/components/header/header.component.ts @@ -16,7 +16,7 @@ import {CurrentThemeService} from '../../../@core/utils/theme.service'; export class HeaderComponent implements OnInit, OnDestroy { private destroy$: Subject = new Subject(); - public readonly materialTheme$: Observable; + public materialTheme$: Observable; userPictureOnly: boolean = false; user: any; @@ -62,14 +62,15 @@ export class HeaderComponent implements OnInit, OnDestroy { private analytics: AnalyticsService, private currentThemeService: CurrentThemeService, ) { - this.materialTheme$ = this.themeService.onThemeChange() - .pipe(map(theme => { - const themeName: string = theme?.name || ''; - return themeName.startsWith('material'); - })); } ngOnInit() { + this.materialTheme$ = new Observable(subscriber => { + const themeName: string = this.currentThemeService.getCurrentTheme(); + + subscriber.next(themeName.startsWith('material')); + }); + this.currentTheme = this.themeService.currentTheme; this.userService.getUsers() diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 05d7ba82..fac5d875 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -18,7 +18,7 @@ import { SeoService } from './@core/utils/seo.service'; }) export class AppComponent implements OnInit { - themes = ['default', 'cosmic', 'corporate', 'dark']; + themes = ['default', 'cosmic', 'corporate', 'dark', 'material-dark', 'material-light']; constructor(private analytics: AnalyticsService, private seoService: SeoService, diff --git a/src/app/themes-screen/starter.component.html b/src/app/themes-screen/starter.component.html index ca2fd2af..ecd6f085 100644 --- a/src/app/themes-screen/starter.component.html +++ b/src/app/themes-screen/starter.component.html @@ -2,14 +2,14 @@
- +
- Support us: + Support us: