Skip to content

Commit

Permalink
feat: stop using emoji icons for language (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey authored Mar 18, 2024
1 parent e080602 commit 85c53e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 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: 4 additions & 16 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 @@ -59,7 +53,6 @@ const LangControl = (props: ControlProps) => {
? {
text: langData.name,
value: langData['1'],
icon: ICONS[code] || '',
}
: undefined;
})
Expand All @@ -68,12 +61,7 @@ const LangControl = (props: ControlProps) => {
return preparedLangs.length ? preparedLangs : LEGACY_LANG_ITEMS;
}, [langs]);
const renderItem = useCallback((item: ListItem) => {
return (
<button className={b('lang-item')}>
<div className={b('list-icon')}>{item.icon}</div>
{item.text}
</button>
);
return <button className={b('lang-item')}>{item.text}</button>;
}, []);
const onItemClick = useCallback(
(item: ListItem) => {
Expand Down

0 comments on commit 85c53e9

Please sign in to comment.