Skip to content

Commit

Permalink
feat: stop using emoji icons for language
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey committed Mar 18, 2024
1 parent e080602 commit 9529372
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/Controls/Controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
padding: 4px 0;

&_langs {
width: 120px;
width: 100px;
}
}

Expand Down
20 changes: 6 additions & 14 deletions src/components/Controls/single-controls/LangControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@ import {ControlsLayoutContext} from '../ControlsLayout';

import '../Controls.scss';

const ICONS: Record<string, string> = {
en: '🇬🇧',
ru: '🇷🇺',
he: '🇮🇱',
};
const DEFAULT_LANGS = ['en', 'ru', 'he'];
const LEGACY_LANG_ITEMS = [
{value: Lang.En, text: 'English', icon: '🇬🇧'},
{value: Lang.Ru, text: 'Русский', icon: '🇷🇺'},
{value: Lang.He, text: 'Hebrew', icon: '🇮🇱'},
{value: Lang.En, text: 'English'},
{value: Lang.Ru, text: 'Русский'},
{value: Lang.He, text: 'Hebrew'},
];

const b = block('dc-controls');
Expand All @@ -36,7 +31,6 @@ interface ControlProps {
interface ListItem {
value: string;
text: string;
icon?: string;
}

const LIST_ITEM_HEIGHT = 36;
Expand All @@ -57,10 +51,9 @@ const LangControl = (props: ControlProps) => {

return langData
? {
text: langData.name,
value: langData['1'],
icon: ICONS[code] || '',
}
text: langData.name,
value: langData['1'],
}
: undefined;
})
.filter(Boolean) as ListItem[];
Expand All @@ -70,7 +63,6 @@ const LangControl = (props: ControlProps) => {
const renderItem = useCallback((item: ListItem) => {
return (
<button className={b('lang-item')}>
<div className={b('list-icon')}>{item.icon}</div>
{item.text}
</button>
);
Expand Down

0 comments on commit 9529372

Please sign in to comment.