diff --git a/apps/infoalloggi/src/components/IconComponents.tsx b/apps/infoalloggi/src/components/IconComponents.tsx index 60911dc..c3149ab 100644 --- a/apps/infoalloggi/src/components/IconComponents.tsx +++ b/apps/infoalloggi/src/components/IconComponents.tsx @@ -378,3 +378,22 @@ const CheckCircleIcon = ({ className }: { className?: string }) => ( /> ); + +export const Moon2 = ({ className }: { className?: string }) => ( + + Moon + + +); diff --git a/apps/infoalloggi/src/components/navbar/login-button.tsx b/apps/infoalloggi/src/components/navbar/login-button.tsx index 191aa7d..4ed9268 100644 --- a/apps/infoalloggi/src/components/navbar/login-button.tsx +++ b/apps/infoalloggi/src/components/navbar/login-button.tsx @@ -83,7 +83,7 @@ export const UserHeaderSection = ({ diff --git a/apps/infoalloggi/src/components/navbar/settings-modal.tsx b/apps/infoalloggi/src/components/navbar/settings-modal.tsx deleted file mode 100644 index 6b21345..0000000 --- a/apps/infoalloggi/src/components/navbar/settings-modal.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { Settings } from "lucide-react"; -import { LangToggle } from "~/components/navbar/lang-toggle"; -import { Button } from "~/components/ui/button"; - -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "~/components/ui/popover"; -import { ThemeSwitch } from "./theme-toggle"; - -export const SettingsPopover = () => { - return ( - - - - - - - - - - ); -}; diff --git a/apps/infoalloggi/src/components/navbar/site-header.tsx b/apps/infoalloggi/src/components/navbar/site-header.tsx index 77daad1..1c96186 100644 --- a/apps/infoalloggi/src/components/navbar/site-header.tsx +++ b/apps/infoalloggi/src/components/navbar/site-header.tsx @@ -5,7 +5,8 @@ import { UserHeaderSection } from "~/components/navbar/login-button"; import { MainNav } from "~/components/navbar/main-nav"; import { MobileNav } from "~/components/navbar/mobile-nav"; import { RicercaCommand } from "~/components/navbar/ricerca_command"; -import { SettingsPopover } from "./settings-modal"; +import { LangToggle } from "./lang-toggle"; +import { ThemeSwitch } from "./theme-toggle"; export function SiteHeader() { const pathname = usePathname(); @@ -22,7 +23,7 @@ export function SiteHeader() { }; return (
-
+
-
+
- + +
{ const [mounted, setMounted] = useState(false); @@ -14,7 +22,7 @@ export const ThemeSwitch = () => { return ; } - return ; + return ; }; const ThemeSwitchSkeleton = () => ( @@ -24,51 +32,89 @@ const ThemeSwitchSkeleton = () => ( /> ); -const ThemeSwitchContent = () => { +// const ThemeSwitchContent = () => { +// const { theme, setTheme } = useTheme(); + +// const spring: Transition = { +// damping: 20, +// stiffness: 300, +// type: "spring", +// }; + +// return ( +// +// ); +// }; + +const ThemeSwitchContent2 = () => { const { theme, setTheme } = useTheme(); - const spring: Transition = { - damping: 20, - stiffness: 300, - type: "spring", - }; + const { t } = useTranslation(); return ( - + + + + + setTheme("light")}> + {t.theme.light} + + setTheme("dark")}> + {t.theme.dark} + + setTheme("system")}> + {t.theme.system} + + + + ); }; diff --git a/apps/infoalloggi/src/i18n/en.ts b/apps/infoalloggi/src/i18n/en.ts index a471a18..b711a3b 100644 --- a/apps/infoalloggi/src/i18n/en.ts +++ b/apps/infoalloggi/src/i18n/en.ts @@ -184,6 +184,11 @@ export const en: LangDict = { accedi_per_procedere: "Log in to proceed", accetta: "Accept", acconto: "Dwn. Paym.", + theme: { + light: "Light", + dark: "Dark", + system: "System", + }, account: { cognome: "Surname", email: "Email", diff --git a/apps/infoalloggi/src/i18n/it.ts b/apps/infoalloggi/src/i18n/it.ts index 6171f55..febca9c 100644 --- a/apps/infoalloggi/src/i18n/it.ts +++ b/apps/infoalloggi/src/i18n/it.ts @@ -184,6 +184,11 @@ export const it: LangDict = { sottotitolo: "Un errore interno, riprova più tardi", titolo: "Errore imprevisto", }, + theme: { + light: "Chiaro", + dark: "Scuro", + system: "Sistema", + }, accedi_per_procedere: "Accedi per procedere", accetta: "Accetta", acconto: "Acconto", diff --git a/apps/infoalloggi/src/i18n/locales.ts b/apps/infoalloggi/src/i18n/locales.ts index 4c1bbc5..fc9207b 100644 --- a/apps/infoalloggi/src/i18n/locales.ts +++ b/apps/infoalloggi/src/i18n/locales.ts @@ -71,6 +71,11 @@ export type LangDict = { contatti: string; guida: string; prezzi_titolo: string; + theme: { + light: string; + dark: string; + system: string; + }; notifiche: { titolo_popup: string; diff --git a/apps/infoalloggi/src/pages/contatti.tsx b/apps/infoalloggi/src/pages/contatti.tsx index f0276c2..27e14cf 100644 --- a/apps/infoalloggi/src/pages/contatti.tsx +++ b/apps/infoalloggi/src/pages/contatti.tsx @@ -162,7 +162,10 @@ const Contatto: NextPage = () => { render={({ field }) => (
- + {t.contact_form.telefono}