From 6ee19905427649be74c6dc7760cba7b98b67bfbc Mon Sep 17 00:00:00 2001 From: EvanLin3141 Date: Thu, 6 Feb 2025 00:57:46 +0000 Subject: [PATCH] DESIGN: Light/Dark Mode Button --- frontend/src/components/Layout/Sidebar.tsx | 6 +++--- frontend/src/components/Layout/Theme.tsx | 24 +++++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Layout/Sidebar.tsx b/frontend/src/components/Layout/Sidebar.tsx index 9e5a1b1..97477f3 100644 --- a/frontend/src/components/Layout/Sidebar.tsx +++ b/frontend/src/components/Layout/Sidebar.tsx @@ -52,7 +52,7 @@ const Sidebar: React.FC = () => { const shownCategory = Object.entries(testCategory).map(([dummyCategory, {dummyLink, dummyImage}]) => { return (
  • + hover:bg-[#800020] hover:scale-110 hover:shadow-[-1px_1.5px_10px_white] transition-all duration-250 m-[0.25em]"> {dummyCategory} {dummyCategory}
  • @@ -66,11 +66,11 @@ const Sidebar: React.FC = () => { className={`fixed top-0 left-0 w-[250px] ${thisTheme ? " bg-[var(--sideBar-LightBG)] text-[var(--sideBar-LightText)]" : " bg-[var(--sideBar-DarkBG)] text-[var(--sideBar-DarkText)]" - } p-4 z-[90] h-screen overflow-y-auto + } py-4 px-3 z-[90] h-screen overflow-y-auto transition-transform duration-500 ease-in-out animate-burnIn`} onMouseLeave={() => setIsCursorOnSidebar(false)} style={{ scrollbarWidth: 'none', msOverflowStyle: 'none' }}> - +

    Followed

      diff --git a/frontend/src/components/Layout/Theme.tsx b/frontend/src/components/Layout/Theme.tsx index 1299083..cb79d9f 100644 --- a/frontend/src/components/Layout/Theme.tsx +++ b/frontend/src/components/Layout/Theme.tsx @@ -1,21 +1,31 @@ -import React from 'react'; -import { SunMoon as SunMoonIcon } from 'lucide-react'; +import React, { useState } from 'react'; +import { SunMoon as SunMoonIcon, Sun as SunIcon, + Moon as MoonIcon } from 'lucide-react'; interface ThemeProps { children?: React.ReactNode; onClick: () => void; + isMode: boolean; } -const Theme: React.FC = ({ onClick }) => { +const Theme: React.FC = ({ onClick, isMode }) => { + return (
      );