@@ -8,6 +8,7 @@ import SelectedEvent from '../../..//design-system/icons/SelectedEvent.svg';
88import SelectedHost from '../../../public/assets/menu/SelectedHost.svg' ;
99import SelectedLogout from '../../../public/assets/menu/SelectedLogout.svg' ;
1010import SelectedSetting from '../../../public/assets/menu/SelectedSetting.svg' ;
11+ import useAuthStore from '../../app/provider/authStore' ;
1112
1213export interface buttonData {
1314 iconPath : string ; // 아이콘 경로
@@ -16,10 +17,22 @@ export interface buttonData {
1617 path : string ; // 경로
1718}
1819
19- export const buttonData : buttonData [ ] = [
20- { iconPath : Ticket , hoverIconPath : SelectedTicket , label : '구입한 티켓' , path : '/menu/myTicket' } ,
21- { iconPath : Host , hoverIconPath : SelectedHost , label : '내 호스트' , path : '/menu/myHost' } ,
22- { iconPath : Event , hoverIconPath : SelectedEvent , label : '이벤트 주최하기' , path : '/event-creation' } ,
23- { iconPath : Setting , hoverIconPath : SelectedSetting , label : '마이페이지' , path : '/menu/myPage' } ,
24- { iconPath : Logout , hoverIconPath : SelectedLogout , label : '로그아웃' , path : '/menu/logout' } ,
25- ] ;
20+ export const getButtonData = ( ) : buttonData [ ] => {
21+ const isLoggedIn = useAuthStore . getState ( ) . isLoggedIn ;
22+
23+ const baseButtons : buttonData [ ] = [
24+ { iconPath : Ticket , hoverIconPath : SelectedTicket , label : '구입한 티켓' , path : '/menu/myTicket' } ,
25+ { iconPath : Host , hoverIconPath : SelectedHost , label : '내 호스트' , path : '/menu/myHost' } ,
26+ { iconPath : Event , hoverIconPath : SelectedEvent , label : '이벤트 주최하기' , path : '/event-creation' } ,
27+ { iconPath : Setting , hoverIconPath : SelectedSetting , label : '마이페이지' , path : '/menu/myPage' } ,
28+ ] ;
29+
30+ if ( isLoggedIn ) {
31+ return [
32+ ...baseButtons ,
33+ { iconPath : Logout , hoverIconPath : SelectedLogout , label : '로그아웃' , path : '/menu/logout' } ,
34+ ] ;
35+ }
36+
37+ return baseButtons ;
38+ } ;
0 commit comments