Skip to content

Commit

Permalink
chore(demo): fix icon resolver (#8503)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Aug 13, 2024
2 parents 4ca4b66 + 4840434 commit 62cab02
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 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 @@ -39,6 +39,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 @@ -204,6 +205,20 @@ 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
: `${
window.origin.includes('taiga-ui.dev') ? '/v3' : ''
}/assets/taiga-ui/icons/${
icon.includes('Outline')
? icon
: icon.replace('Large', '').concat('Outline')
}.svg`,
},
tuiLanguageSwitcher(
async (language: TuiLanguageName): Promise<unknown> =>
import(
Expand Down

0 comments on commit 62cab02

Please sign in to comment.