Skip to content

Commit

Permalink
fix(addon-doc): provide languages icon (#9236)
Browse files Browse the repository at this point in the history
Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
splincode and taiga-family-bot authored Sep 27, 2024
1 parent d48b600 commit bc5caf7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion projects/cdk/constants/used-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const TUI_USED_ICONS = [
'@tui.uzcard',
'@tui.verve',
'@tui.external-link',
'@tui.languages',
'@tui.search',
'@tui.sun',
'@tui.moon',
Expand All @@ -29,6 +28,7 @@ export const TUI_USED_ICONS = [
'@tui.copy',
'@tui.check',
'@tui.link',
'@tui.languages',
'@tui.eye-off',
'@tui.eye',
'@tui.grip-vertical',
Expand Down

0 comments on commit bc5caf7

Please sign in to comment.