From 9e353ecc01a11ffb1055d587bd0a6f80bec219f6 Mon Sep 17 00:00:00 2001 From: Daniel Villatoro <57822891+DanielVillatoro@users.noreply.github.com> Date: Sun, 26 Jan 2025 22:32:41 -0600 Subject: [PATCH] =?UTF-8?q?Developed=20User=20Menu=20with=20dynamic=20them?= =?UTF-8?q?e=20switching,=20language=20dropdown=20w=E2=80=A6=20(#115)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Developed User Menu with dynamic theme switching, language dropdown with flags, updated icons, and improved UI consistency. -Integrated dynamic theme switching (Light/Dark mode) using next-themes with a Switch component and dynamic Sun/Moon icons. -Added language dropdown with flags (en-flag.svg and es-flag.svg) for English and Spanish, displaying the selected language in the menu trigger. -Replaced History icon with FileDollar for the Transactions option. -Improved alignment, spacing, and transitions. -Refactored imports logic for maintainability. * Changes on DropdownMenuSubContent for languaje. --- .../shared/header/action-buttons.tsx | 4 - .../components/shared/header/user-menu.tsx | 106 ++++++++++++++++-- 2 files changed, 99 insertions(+), 11 deletions(-) diff --git a/apps/frontend/app/components/shared/header/action-buttons.tsx b/apps/frontend/app/components/shared/header/action-buttons.tsx index 5a30930..13e27bf 100644 --- a/apps/frontend/app/components/shared/header/action-buttons.tsx +++ b/apps/frontend/app/components/shared/header/action-buttons.tsx @@ -3,7 +3,6 @@ import { Bell, ShoppingCart, Wallet } from "lucide-react"; import { Button } from "@/app/components/ui/button"; -import { ThemeToggle } from "../../ui/theme-toggle"; import { UserMenu } from "./user-menu"; import * as Tooltip from "@radix-ui/react-tooltip"; import { ConnectWalletModal } from "./connect-wallet-modal"; @@ -47,9 +46,6 @@ export const ActionButtons = () => { - - - - + + {/* Profile Options */} - Profile + Profile - My Listings + My Products - - Transaction History + + Transactions - Settings + Settings + + + {/* Divider Line */} +
+ + {/* Dark Mode Toggle */} + +
+
+ {isDarkMode ? ( + + ) : ( + + )} + {isDarkMode ? "Dark Mode" : "Light Mode"} +
+ + setTheme(checked ? "dark" : "light") + } + className="ml-2" + /> +
+ + {/* Language Dropdown */} + + +
+
+ + Language +
+
+ {language} + {language} +
+
+
+ {/* */} + {/* */} + + + {/* */} + + + + + setLanguage("EN")}> +
+ English + EN +
+
+ setLanguage("ES")}> +
+ EspaƱol + ES +
+
+
+
);