From 8b6347194aec13c27e9b775a154819dc0560172c Mon Sep 17 00:00:00 2001 From: Park Sumin Date: Thu, 18 Jul 2024 01:30:22 +0900 Subject: [PATCH] =?UTF-8?q?Style:=20=EB=A9=94=EC=9D=B8=ED=99=94=EB=A9=B4?= =?UTF-8?q?=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95=20=EB=B0=8F?= =?UTF-8?q?=20=EB=8B=A4=ED=81=AC=EB=AA=A8=EB=93=9C=20=ED=86=A0=EA=B8=80=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Lander/AllActivities.tsx | 8 ++-- components/Lander/Main.tsx | 2 +- components/Layout/NavigationBar.tsx | 46 +++++++++++++++++++- components/PriceFilterBtn/PriceFilterBtn.tsx | 8 ++-- 4 files changed, 54 insertions(+), 10 deletions(-) diff --git a/components/Lander/AllActivities.tsx b/components/Lander/AllActivities.tsx index 46923ca..98f6b8b 100644 --- a/components/Lander/AllActivities.tsx +++ b/components/Lander/AllActivities.tsx @@ -33,7 +33,7 @@ export function AllActivity({ return (
-
+
{title}
@@ -174,7 +174,7 @@ function AllActivities() {
) : ( -
+
{allActivitiesData?.activities.map((data) => ( )} -
+
{allActivitiesData && allActivitiesData.totalCount > 0 && (
-

+

{BestOfmonth?.activities[0].title}

diff --git a/components/Layout/NavigationBar.tsx b/components/Layout/NavigationBar.tsx index 203ead2..653fa25 100644 --- a/components/Layout/NavigationBar.tsx +++ b/components/Layout/NavigationBar.tsx @@ -3,7 +3,7 @@ import Link from 'next/link'; import Logo from '@/public/icon/logo_small.svg'; import notificationIcon from '@/public/icon/icon_notification.svg'; import { useUserData } from '@/hooks/useUserData'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import NavigationDropdown from '../NavigationDropdown/NavigationDropdown'; import useClickOutside from '@/hooks/useClickOutside'; import useGetNotification from '@/hooks/useGetNotification'; @@ -13,6 +13,22 @@ import Spinner from '../Spinner/Spinner'; import profileThumbnail from '@/public/image/profile-circle-icon-512x512-zxne30hp.png'; export default function NavigationBar() { + const [isDarkMode, setIsDarkMode] = useState(false); + + useEffect(() => { + // Check if dark mode is already enabled in the user's preference + const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches; + setIsDarkMode(isDark); + if (isDark) { + document.body.classList.add('dark'); + } + }, []); + + const toggleDarkMode = () => { + document.body.classList.toggle('dark'); + setIsDarkMode(!isDarkMode); + }; + const { userData, isLoading } = useUserData(); const [isDropdownOpen, setIsDropdownOpen] = useState(false); const { isLoggedIn } = useLoginState(); @@ -54,6 +70,34 @@ export default function NavigationBar() {
{isLoggedIn ? (
+
+ +