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:
parent
7b7743ef2a
commit
9ba6722bff
1 changed files with 2 additions and 16 deletions
|
@ -21,7 +21,6 @@ import selectors from '../../../../selectors';
|
||||||
import entryActions from '../../../../entry-actions';
|
import entryActions from '../../../../entry-actions';
|
||||||
|
|
||||||
import styles from './AccountPane.module.scss';
|
import styles from './AccountPane.module.scss';
|
||||||
import localeFlagStyles from '../LocaleFlag.module.scss';
|
|
||||||
|
|
||||||
const AccountPane = React.memo(() => {
|
const AccountPane = React.memo(() => {
|
||||||
const user = useSelector(selectors.selectCurrentUser);
|
const user = useSelector(selectors.selectCurrentUser);
|
||||||
|
@ -71,21 +70,8 @@ const AccountPane = React.memo(() => {
|
||||||
},
|
},
|
||||||
...locales.map((locale) => ({
|
...locales.map((locale) => ({
|
||||||
value: locale.language,
|
value: locale.language,
|
||||||
text: (
|
flag: locale.country,
|
||||||
<>
|
text: locale.name,
|
||||||
{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}
|
|
||||||
</>
|
|
||||||
),
|
|
||||||
})),
|
})),
|
||||||
]}
|
]}
|
||||||
value={user.language || 'auto'}
|
value={user.language || 'auto'}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue