Skip to content

Commit

Permalink
fix(addon-doc): provide languages icon
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Sep 27, 2024
1 parent ce4f05d commit 6afd88b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion projects/addon-doc/components/language-switcher/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

<button
appearance="whiteblock"
iconStart="@tui.languages"
size="s"
tuiButtonSelect
tuiIconButton
type="button"
[formControl]="language"
[iconStart]="icons.languages"
>
Language
<tui-data-list *tuiTextfieldDropdown>
Expand Down
2 changes: 2 additions & 0 deletions projects/addon-doc/components/language-switcher/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {NgForOf, NgIf, TitleCasePipe} from '@angular/common';
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
import {FormControl, ReactiveFormsModule} from '@angular/forms';
import {TUI_DOC_ICONS} from '@taiga-ui/addon-doc/tokens';
import {TuiButton} from '@taiga-ui/core/components/button';
import {TuiDataList} from '@taiga-ui/core/components/data-list';
import {tuiScrollbarOptionsProvider} from '@taiga-ui/core/components/scrollbar';
Expand Down Expand Up @@ -34,6 +35,7 @@ import {TuiButtonSelect} from '@taiga-ui/kit/directives/button-select';
providers: [tuiScrollbarOptionsProvider({mode: 'hover'})],
})
export class TuiDocLanguageSwitcher {
protected readonly icons = inject(TUI_DOC_ICONS);
protected readonly switcher = inject(TuiLanguageSwitcherService);
protected readonly language = new FormControl(capitalize(this.switcher.language));

Expand Down
2 changes: 2 additions & 0 deletions projects/addon-doc/tokens/doc-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface TuiDocIcons {
readonly copy: string;
readonly check: string;
readonly link: string;
readonly languages: string;
}

export const TUI_DOC_DEFAULT_ICONS: TuiDocIcons = {
Expand All @@ -21,6 +22,7 @@ export const TUI_DOC_DEFAULT_ICONS: TuiDocIcons = {
copy: '@tui.copy',
check: '@tui.check',
link: '@tui.link',
languages: '@tui.languages',
};

export const TUI_DOC_ICONS = tuiCreateToken(TUI_DOC_DEFAULT_ICONS);
Expand Down

0 comments on commit 6afd88b

Please sign in to comment.