feat: update default layout

This commit is contained in:
Sonny
2025-08-06 19:50:53 +02:00
parent d56bd1ef80
commit 97ba56b1e7
36 changed files with 627 additions and 119 deletions

View File

@@ -0,0 +1,21 @@
import { ActionIcon, Image } from '@mantine/core';
import { useTranslation } from 'react-i18next';
import { LS_LANG_KEY } from '~/constants';
export function LocaleSwitcher() {
const { i18n } = useTranslation();
const newLanguage = i18n.language === 'en' ? 'fr' : 'en';
return (
<ActionIcon
variant="light"
aria-label="Toggle color scheme"
onClick={() => {
i18n.changeLanguage(newLanguage);
localStorage.setItem(LS_LANG_KEY, newLanguage);
}}
size="lg"
>
<Image src={`/icons/${newLanguage}.svg`} alt={newLanguage} w={18} />
</ActionIcon>
);
}