From fbf31facd84eb38526f3ab86c245560fea813805 Mon Sep 17 00:00:00 2001 From: v0 Date: Thu, 15 Jan 2026 17:04:43 +0000 Subject: [PATCH] feat: switch theme toggle to cycle button Change theme toggle from dropdown to cycle button for three modes. Co-authored-by: Simon <85533298+handsomezhuzhu@users.noreply.github.com> --- app/layout.tsx | 8 +++++++- app/page.tsx | 45 ++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index bdeedff..d62a37a 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -27,7 +27,13 @@ export default function RootLayout({ return ( - + {children} diff --git a/app/page.tsx b/app/page.tsx index ddd4077..5548c3d 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -485,6 +485,17 @@ export default function TwoFactorAuth() { } }) + // Cycle through themes + const cycleTheme = () => { + if (theme === "light") { + setTheme("dark") + } else if (theme === "dark") { + setTheme("system") + } else { + setTheme("light") + } + } + return (
{/* Header */} @@ -501,29 +512,17 @@ export default function TwoFactorAuth() {
- - - - - - setTheme("light")}> - - {t.themeLight} - - setTheme("dark")}> - - {t.themeDark} - - setTheme("system")}> - - {t.themeSystem} - - - +