1
1
'use client' ;
2
2
3
3
import { useMutation , useQuery , useQueryClient } from '@tanstack/react-query' ;
4
- import { usePathname , useRouter } from 'next/navigation' ;
4
+ import { usePathname } from 'next/navigation' ;
5
5
import { useEffect , useRef , useState } from 'react' ;
6
6
import Image from 'next/image' ;
7
7
import { revalidate } from '@/utils/revalidateUtil' ;
8
8
import { PATHS , SCREENS } from '@/constants' ;
9
9
import { NameType } from '@/components' ;
10
- import { useResponsive } from '@/hooks' ;
10
+ import { useCustomNavigation , useResponsive } from '@/hooks' ;
11
11
import { logout , me } from '@/apis' ;
12
12
import { useModal } from '@/hooks/useModal' ;
13
13
import { defaultStyle , Section , textStyle } from './Section' ;
@@ -33,7 +33,7 @@ export const Header = () => {
33
33
const { open : ModalOpen } = useModal ( ) ;
34
34
const menu = useRef < HTMLDivElement | null > ( null ) ;
35
35
const path = usePathname ( ) ;
36
- const router = useRouter ( ) ;
36
+ const { replace } = useCustomNavigation ( ) ;
37
37
const width = useResponsive ( ) ;
38
38
const barWidth = width < SCREENS . MBI ? 65 : 180 ;
39
39
const client = useQueryClient ( ) ;
@@ -43,7 +43,7 @@ export const Header = () => {
43
43
onSuccess : async ( ) => {
44
44
await revalidate ( ) ;
45
45
client . clear ( ) ;
46
- router . replace ( '/' ) ;
46
+ replace ( '/' ) ;
47
47
} ,
48
48
} ) ;
49
49
@@ -71,7 +71,7 @@ export const Header = () => {
71
71
< div className = "flex w-fit" >
72
72
< Section
73
73
clickType = "function"
74
- action = { ( ) => router . replace ( `/main${ PARAMS . MAIN } ` ) }
74
+ action = { ( ) => replace ( `/main${ PARAMS . MAIN } ` ) }
75
75
>
76
76
< Image
77
77
width = { 35 }
@@ -121,7 +121,7 @@ export const Header = () => {
121
121
< div className = "w-0 h-0 border-[15px] ml-3 mr-3 border-TRANSPARENT border-b-BG-SUB" />
122
122
< div className = "cursor-pointer h-fit flex-col rounded-[4px] bg-BG-SUB shadow-BORDER-MAIN shadow-md" >
123
123
< button
124
- className = "text-DESTRUCTIVE-SUB text-I3 p-5 max-MBI:p-4 flex whitespace-nowrap w-auto"
124
+ className = "text-DESTRUCTIVE-SUB text-I3 p-5 max-MBI:p-4 flex whitespace-nowrap w-auto hover:bg-BG-ALT "
125
125
onClick = { ( ) => out ( ) }
126
126
>
127
127
로그아웃
0 commit comments