+ {
+ e.currentTarget.style.color = 'var(--mantine-primary-color-filled)';
+ e.currentTarget.style.transform = 'translateX(-3px)';
+ }}
+ onMouseLeave={(e) => {
+ e.currentTarget.style.color = 'var(--mantine-color-dimmed)';
+ e.currentTarget.style.transform = 'translateX(0)';
+ }}
+ >
+
+ {t('common.back', 'Back')}
+
+
{t('signup.title', 'Create account')}
diff --git a/libs/ui/src/lib/layout/ColorSchemeToggle.tsx b/libs/ui/src/lib/layout/ColorSchemeToggle.tsx
index c31109394..b8790318a 100644
--- a/libs/ui/src/lib/layout/ColorSchemeToggle.tsx
+++ b/libs/ui/src/lib/layout/ColorSchemeToggle.tsx
@@ -1,45 +1,118 @@
-import { UnstyledButton, useMantineColorScheme, useComputedColorScheme, rem } from '@mantine/core';
-import { IconSun, IconMoon } from '@tabler/icons-react';
+import {
+ Menu,
+ UnstyledButton,
+ Text,
+ Group,
+ rem,
+ useMantineColorScheme,
+ useComputedColorScheme,
+} from '@mantine/core';
+import {
+ IconSun,
+ IconMoon,
+ IconDeviceDesktop,
+ IconCheck,
+} from '@tabler/icons-react';
import { useTranslation } from 'react-i18next';
export function ColorSchemeToggle() {
const { t } = useTranslation();
- const { setColorScheme } = useMantineColorScheme();
+ const { colorScheme, setColorScheme } = useMantineColorScheme();
const computed = useComputedColorScheme('light', { getInitialValueInEffect: true });
const isDark = computed === 'dark';
+ const themes = [
+ {
+ value: 'light' as const,
+ label: t('profile.appearance.light', 'Light'),
+ icon: IconSun,
+ color: '#e67e22',
+ },
+ {
+ value: 'dark' as const,
+ label: t('profile.appearance.dark', 'Dark'),
+ icon: IconMoon,
+ color: '#9b59b6',
+ },
+ {
+ value: 'auto' as const,
+ label: t('profile.appearance.system', 'System'),
+ icon: IconDeviceDesktop,
+ color: '#3498db',
+ },
+ ];
+
+ const CurrentIcon = colorScheme === 'auto' ? IconDeviceDesktop : isDark ? IconMoon : IconSun;
+
return (
- setColorScheme(isDark ? 'light' : 'dark')}
- style={{
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- width: rem(38),
- height: rem(38),
- borderRadius: rem(12),
- background: 'var(--mantine-color-body)',
- color: 'var(--mantine-color-gray-6)',
- boxShadow: '0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.06)',
- transition: 'all 150ms ease',
- cursor: 'pointer',
- border: 'none',
- }}
- onMouseEnter={(e) => {
- e.currentTarget.style.background = 'var(--mantine-primary-color-light)';
- e.currentTarget.style.color = 'var(--mantine-primary-color-6)';
- e.currentTarget.style.boxShadow =
- '0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px var(--mantine-primary-color-2)';
- }}
- onMouseLeave={(e) => {
- e.currentTarget.style.background = 'var(--mantine-color-body)';
- e.currentTarget.style.color = 'var(--mantine-color-gray-6)';
- e.currentTarget.style.boxShadow =
- '0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.06)';
- }}
- >
- {isDark ? : }
-
+
);
}
+
diff --git a/libs/ui/src/lib/layout/LanguageSwitcher.tsx b/libs/ui/src/lib/layout/LanguageSwitcher.tsx
index b1ec6305d..0e9df453d 100644
--- a/libs/ui/src/lib/layout/LanguageSwitcher.tsx
+++ b/libs/ui/src/lib/layout/LanguageSwitcher.tsx
@@ -1,83 +1,179 @@
-import { Menu, UnstyledButton, Text, rem } from '@mantine/core';
-import { IconWorld, IconCheck, IconChevronDown } from '@tabler/icons-react';
+import type { ComponentType, SVGProps } from 'react';
+import { Menu, UnstyledButton, Text, Group, rem } from '@mantine/core';
+import { IconCheck, IconChevronDown, IconWorld } from '@tabler/icons-react';
+import { GB, ET } from 'country-flag-icons/react/3x2';
import { useTranslation } from 'react-i18next';
interface LanguageSwitcherProps {
supportedLanguages: readonly string[];
- /** `icon` renders a compact globe button; `button` shows the language label. */
+ /** `icon` renders a compact flag button; `button` shows the language label. */
variant?: 'icon' | 'button';
}
-export function LanguageSwitcher({ supportedLanguages, variant = 'icon' }: LanguageSwitcherProps) {
+type FlagComponentType = ComponentType>;
+
+const LANGUAGE_CONFIG: Record<
+ string,
+ { Flag: FlagComponentType; nativeName: string; shortCode: string }
+> = {
+ en: { Flag: GB, nativeName: 'English', shortCode: 'EN' },
+ am: { Flag: ET, nativeName: 'አማርኛ', shortCode: 'AM' },
+};
+
+export function LanguageSwitcher({
+ supportedLanguages,
+ variant = 'icon',
+}: LanguageSwitcherProps) {
const { t, i18n } = useTranslation();
- const current = i18n.language;
+ const current = i18n.language || 'en';
const change = (lng: string) => {
if (lng !== current) i18n.changeLanguage(lng);
};
+ const currentConfig = LANGUAGE_CONFIG[current] || {
+ Flag: null,
+ nativeName: current.toUpperCase(),
+ shortCode: current.toUpperCase(),
+ };
+
+ const CurrentFlag = currentConfig.Flag;
+
return (
-