1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

refactor: simplify flag rendering in AccountPane

- Removed unnecessary locale flag styles and updated flag rendering logic
- Changed flag representation to use a simpler structure with country code and name
This commit is contained in:
symonbaikov 2025-06-06 14:56:20 +03:00
parent 7b7743ef2a
commit 9ba6722bff

View file

@ -21,7 +21,6 @@ import selectors from '../../../../selectors';
import entryActions from '../../../../entry-actions';
import styles from './AccountPane.module.scss';
import localeFlagStyles from '../LocaleFlag.module.scss';
const AccountPane = React.memo(() => {
const user = useSelector(selectors.selectCurrentUser);
@ -71,21 +70,8 @@ const AccountPane = React.memo(() => {
},
...locales.map((locale) => ({
value: locale.language,
text: (
<>
{locale.country && (
<span className={localeFlagStyles.localeFlagWrapper}>
<img
src={`https://flagcdn.com/48x36/${locale.country.toLowerCase()}.png`}
alt={locale.country}
className={localeFlagStyles.localeFlag}
loading="lazy"
/>
</span>
)}
{locale.name}
</>
),
flag: locale.country,
text: locale.name,
})),
]}
value={user.language || 'auto'}