From 2eb198f0892a20e27b2b7ce64f641aaf3c357085 Mon Sep 17 00:00:00 2001 From: Nikita Choudhary Date: Sat, 6 Jun 2026 16:33:26 +0530 Subject: [PATCH 1/2] modified the css for responsiveness --- src/components/DashboardHeader.tsx | 173 +++++++++++++++-------------- src/components/ThemeToggle.tsx | 2 +- src/hooks/useIsMobile.ts | 21 ++++ 3 files changed, 114 insertions(+), 82 deletions(-) create mode 100644 src/hooks/useIsMobile.ts diff --git a/src/components/DashboardHeader.tsx b/src/components/DashboardHeader.tsx index 933fa8c5d..58420d891 100644 --- a/src/components/DashboardHeader.tsx +++ b/src/components/DashboardHeader.tsx @@ -19,6 +19,9 @@ import KeyboardShortcuts from "@/components/KeyboardShortcuts"; import { Moon, Sun } from "lucide-react"; import { toast } from "sonner"; +import { useIsMobile } from "@/hooks/useIsMobile"; + + type DashboardSyncContextValue = { lastSynced: Date | null; }; @@ -99,6 +102,8 @@ export default function DashboardHeader() { const [isNightOwl, setIsNightOwl] = useState(false); const [isEarlyBird, setIsEarlyBird] = useState(false); + const isMobile = useIsMobile(); + useEffect(() => { const computeCurrentGreeting = () => { const currentHour = new Date().getHours(); @@ -204,7 +209,7 @@ export default function DashboardHeader() {
-
+
{/* Left Section */}
@@ -260,92 +265,98 @@ export default function DashboardHeader() {
{/* Right Section */} -
-
- {isPublic === true && session?.githubLogin && ( - - Share Profile - - )} - -
-
- -
- -
- -
- -
- -
- -
- -
-
- -
-
-
-
- - {/* Mobile hamburger button */} + {!isMobile && +
+
+ {isPublic === true && session?.githubLogin && ( + + Share Profile + + )} + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
+ + +} +{/* Mobile hamburger button */} + {isMobile && + type="button" + className="inline-flex items-center justify-center self-start rounded-xl border border-[var(--border)] bg-[var(--card-muted)]/70 p-2 text-[var(--card-foreground)] shadow-sm transition-all duration-200 hover:border-[var(--accent)] hover:text-[var(--accent)] " + onClick={() => setMenuOpen((v) => !v)} + aria-label="Toggle menu" + aria-expanded={menuOpen} + > + {menuOpen ? ( + + ) : ( + + )} + +}
{/* Mobile dropdown */} {menuOpen && ( -
+
-
+
@@ -357,7 +368,7 @@ export default function DashboardHeader() {
-
+
diff --git a/src/components/ThemeToggle.tsx b/src/components/ThemeToggle.tsx index ae9531c86..27361b3e1 100644 --- a/src/components/ThemeToggle.tsx +++ b/src/components/ThemeToggle.tsx @@ -53,7 +53,7 @@ export default function ThemeToggle() { const currentDescription = themeDefinition?.description ?? "Customize the dashboard palette"; return ( -