diff --git a/src/components/global/GlobalNavigationBar.tsx b/src/components/global/GlobalNavigationBar.tsx index 62d6e02..f09c05e 100644 --- a/src/components/global/GlobalNavigationBar.tsx +++ b/src/components/global/GlobalNavigationBar.tsx @@ -19,7 +19,8 @@ const GlobalNavigationBar = (props: { children?: React.ReactNode }) => { const [isOverlayVisible, setIsOverlayVisible] = useState(false); const location = useLocation(); - const { loginNeeded, registerStatus, setLoginNeeded } = useRegisterStore(); + const { loginNeeded, registerStatus, setLoginNeededStatus } = + useRegisterStore(); useEffect(() => { if (registerStatus !== RegisterStatus.LOG_IN && loginNeeded) { @@ -34,12 +35,12 @@ const GlobalNavigationBar = (props: { children?: React.ReactNode }) => { }, [loginNeeded, registerStatus]); const handleClose = () => { - setLoginNeeded(false); + setLoginNeededStatus(false); setIsOverlayVisible(false); }; const handleLoginClick = () => { - setLoginNeeded(true); + setLoginNeededStatus(true); setIsOverlayVisible(true); }; @@ -54,7 +55,9 @@ const GlobalNavigationBar = (props: { children?: React.ReactNode }) => { -
+
{isHomeActive ? ( ) : ( @@ -63,8 +66,10 @@ const GlobalNavigationBar = (props: { children?: React.ReactNode }) => {
-
- {isExploreActive ? ( +
+ {isExploreActive ? ( ) : ( @@ -72,7 +77,9 @@ const GlobalNavigationBar = (props: { children?: React.ReactNode }) => {
-
+
diff --git a/src/components/userProfile/UserInfoBar.tsx b/src/components/userProfile/UserInfoBar.tsx index aa915ac..d06dcc1 100644 --- a/src/components/userProfile/UserInfoBar.tsx +++ b/src/components/userProfile/UserInfoBar.tsx @@ -14,7 +14,8 @@ const UserInfoBar = (props: { children?: React.ReactNode }) => { const [isLog, setIsLog] = useState(false); const [isOverlayVisible, setIsOverlayVisible] = useState(false); - const { loginNeeded, registerStatus, setLoginNeeded } = useRegisterStore(); + const { loginNeeded, registerStatus, setLoginNeededStatus } = + useRegisterStore(); const openFollowing = () => { setIsFollowingOpen(true); @@ -45,12 +46,12 @@ const UserInfoBar = (props: { children?: React.ReactNode }) => { }, [loginNeeded, registerStatus]); const handleClose = () => { - setLoginNeeded(false); + setLoginNeededStatus(false); setIsOverlayVisible(false); }; const handleLoginClick = () => { - setLoginNeeded(true); + setLoginNeededStatus(true); setIsOverlayVisible(true); }; diff --git a/src/pages/UserProfile/UserProfile.tsx b/src/pages/UserProfile/UserProfile.tsx index c2cef8b..ccfcab4 100644 --- a/src/pages/UserProfile/UserProfile.tsx +++ b/src/pages/UserProfile/UserProfile.tsx @@ -1,4 +1,4 @@ -import React,{ useState,useEffect } from 'react'; +import React, { useState, useEffect } from 'react'; import { Outlet, useParams } from 'react-router-dom'; import GlobalNavigationBar from '../../components/global/GlobalNavigationBar'; @@ -16,7 +16,7 @@ const UserProfile = () => { const [isLog, setIsLog] = useState(false); const [isOverlayVisible, setIsOverlayVisible] = useState(false); - const { loginNeeded, registerStatus, setLoginNeeded } = useRegisterStore(); + const { loginNeeded, registerStatus } = useRegisterStore(); useEffect(() => { if (registerStatus !== RegisterStatus.LOG_IN && loginNeeded) { @@ -30,7 +30,6 @@ const UserProfile = () => { } }, [loginNeeded, registerStatus]); - useEffect(() => { const titleElement = document.getElementsByTagName('title')[0]; titleElement.innerHTML = `@@@님의 페이지 | MAPU`; //api 호출 -> 사용자 타이틀에 추가