From ade8ab0a374bb6561eafec449b0bbad933c6faa0 Mon Sep 17 00:00:00 2001 From: RookieAND Date: Sat, 2 Mar 2024 14:20:37 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20Path=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GlobalNavigationBar.tsx | 28 +++++++++++++++---- src/query-hooks/user/query.ts | 11 ++------ src/utils/tmap/tmapModule.tsx | 4 +-- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/components/global-navigation-bar/GlobalNavigationBar.tsx b/src/components/global-navigation-bar/GlobalNavigationBar.tsx index 65640e0..b9bd685 100644 --- a/src/components/global-navigation-bar/GlobalNavigationBar.tsx +++ b/src/components/global-navigation-bar/GlobalNavigationBar.tsx @@ -9,6 +9,7 @@ import SignOutModal from '@/features/auth/sign-out-modal'; import WithdrawModal from '@/features/auth/withdraw-modal'; import EditorList from '@/features/user/editor-list'; import { useModal } from '@/hooks/useModal'; +import { useGetUserInformation } from '@/query-hooks/user/query'; import { COLOR } from '@/styles/foundation'; import * as S from './GlobalNavigationBar.css'; @@ -20,10 +21,13 @@ const GlobalNavigationBar = () => { const [isSaving, setIsSaving] = useState(false); + const { data: userData } = useGetUserInformation({ throwOnError: false }); + const isCoursePage = pathname.split('/')[1] === 'course'; const handleSignOutButtonClick = () => openModal(); const handleWithdrawButtonClick = () => openModal(); + const handleLoginButtonClick = () => navigate('/login'); useEffect(() => { const isMac = navigator.userAgent.includes('Mac'); @@ -77,12 +81,24 @@ const GlobalNavigationBar = () => { - -

로그아웃

-
- -

회원탈퇴

-
+ {userData ? ( + <> + +

로그아웃

+
+ +

회원탈퇴

+
+ + ) : ( + +

로그인

+
+ )}
diff --git a/src/query-hooks/user/query.ts b/src/query-hooks/user/query.ts index b32abeb..d5c41e3 100644 --- a/src/query-hooks/user/query.ts +++ b/src/query-hooks/user/query.ts @@ -1,7 +1,4 @@ -import { - type UseSuspenseQueryOptions, - useSuspenseQuery, -} from '@tanstack/react-query'; +import { type UseQueryOptions, useQuery } from '@tanstack/react-query'; import type { AxiosError } from 'axios'; import { UserRepository } from '@/apis/user'; @@ -11,10 +8,8 @@ import { USER_QUERY_KEY } from './key'; export const useGetUserInformation = ({ ...options -}: { - options?: UseSuspenseQueryOptions; -}) => { - return useSuspenseQuery({ +}: Omit, 'queryKey'>) => { + return useQuery({ ...options, queryFn: () => UserRepository.getInformationAsync(), queryKey: USER_QUERY_KEY.info(), diff --git a/src/utils/tmap/tmapModule.tsx b/src/utils/tmap/tmapModule.tsx index 28c8a5e..60928d8 100644 --- a/src/utils/tmap/tmapModule.tsx +++ b/src/utils/tmap/tmapModule.tsx @@ -457,9 +457,9 @@ export class TMapModule { this.#duration = totalDuration; this.#polyline = new Tmapv3.Polyline({ path, - fillColor: '#FF0000', + fillColor: '#FF4D86', fillOpacity: 1, - strokeColor: '#FF0000', + strokeColor: '#FF4D86', strokeOpacity: 5, map: this.#mapInstance, });