diff --git a/src/components/layout/Header/Header.module.scss b/src/components/layout/Header/Header.module.scss index 5ac665656..c116a6c8e 100644 --- a/src/components/layout/Header/Header.module.scss +++ b/src/components/layout/Header/Header.module.scss @@ -23,6 +23,11 @@ width: 153px; } + &__right { + display: flex; + align-items: center; + } + &__login-link-button { display: flex; } @@ -30,6 +35,7 @@ &__profile { right: 40px; top: 20px; + margin: 0 0 0 1rem; border-radius: 50%; background-color: $gray-200; } diff --git a/src/components/layout/Header/Header.tsx b/src/components/layout/Header/Header.tsx index 2c806fdcf..4a4050b22 100644 --- a/src/components/layout/Header/Header.tsx +++ b/src/components/layout/Header/Header.tsx @@ -9,15 +9,17 @@ import imgProfile from '@assets/images/icons/ic_profile.svg'; import { useAuthStore } from '@store/useAuthStore'; import UIButton from '@core/ui/buttons/UIButton/UIButton'; import { useEffect, useState } from 'react'; +import useLogin from '@lib/hooks/auth/useLogin'; const Header = ({}) => { const { pathname, push } = useRouter(); const { accessToken } = useAuthStore(); + const { logout } = useLogin(); const [isClient, setIsClient] = useState(false); useEffect(() => { setIsClient(true); - }, []); + }, [accessToken]); return (
@@ -50,23 +52,29 @@ const Header = ({}) => { {isClient && accessToken && ( - - + + 프로필 + + - + type="box" + handleClick={logout} + > + 로그아웃 + + )} {isClient && !accessToken && ( -