Skip to content

Commit

Permalink
chore(demo): fix icon resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin committed Aug 13, 2024
1 parent ef7e6f1 commit d7b4a94
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion projects/demo/src/modules/app/app.providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {inject, PLATFORM_ID, Provider} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {UrlTree} from '@angular/router';
import {environment} from '@demo/environments/environment';
import {SESSION_STORAGE} from '@ng-web-apis/common';
import {SESSION_STORAGE, WINDOW} from '@ng-web-apis/common';
import {
TUI_DOC_CODE_EDITOR,
TUI_DOC_DEFAULT_TABS,
Expand Down Expand Up @@ -40,6 +40,7 @@ import {
TUI_HINT_OPTIONS,
TUI_SANITIZER,
} from '@taiga-ui/core';
import {TUI_ICON_RESOLVER} from '@taiga-ui/experimental';
import {TuiLanguageName, tuiLanguageSwitcher} from '@taiga-ui/i18n';
import {NgDompurifySanitizer} from '@tinkoff/ng-dompurify';
import {HIGHLIGHT_OPTIONS} from 'ngx-highlightjs';
Expand Down Expand Up @@ -206,6 +207,18 @@ export const APP_PROVIDERS: Provider[] = [
},
tuiDocExampleOptionsProvider({fullsize: false}),
metrikaOptionsProvider({id: environment.ym}),
{
provide: TUI_ICON_RESOLVER,
deps: [WINDOW],
useFactory: (window: Window) => (icon: string) =>
!icon || icon.includes('/')
? icon
: `/assets/taiga-ui/icons/${
window.origin.includes('taiga-ui') || icon.includes('Outline')
? icon
: icon.replace('Large', '').concat('Outline')
}.svg`,
},
tuiLanguageSwitcher(
async (language: TuiLanguageName): Promise<unknown> =>
import(
Expand Down

0 comments on commit d7b4a94

Please sign in to comment.