File tree Expand file tree Collapse file tree 3 files changed +47
-6
lines changed
Expand file tree Collapse file tree 3 files changed +47
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515 getLoginInfo ,
1616 getSelectedThemeId ,
1717 getStatus ,
18+ removeAccessToken ,
1819 removeThemeId ,
1920} from "@/utils/storageUtil" ;
2021import { useSelectedThemeReset } from "@/components/atoms/selectedTheme.atom" ;
@@ -58,10 +59,16 @@ export default function Sidebar(props: Props) {
5859 setLoginInfo ( { adminCode, shopName } ) ; // 상태 업데이트
5960 } , [ ] ) ;
6061
61- // const handleLogout = () => {
62- // removeAccessToken();
63- // setIsLoggedIn(false);
64- // };
62+ const handleLogout = ( ) => {
63+ removeAccessToken ( ) ;
64+ resetSelectedTheme ( ) ;
65+ setLoginInfo ( {
66+ adminCode : "" ,
67+ shopName : "" ,
68+ } ) ;
69+ // router.push("/login");
70+ window . location . href = "/login" ;
71+ } ;
6572 useEffect ( ( ) => {
6673 if ( selectedThemeId && selectedThemeId !== "0" )
6774 router . push (
@@ -105,7 +112,15 @@ export default function Sidebar(props: Props) {
105112 < div className = "sidebar" >
106113 < div className = "sidebar__top" >
107114 < div className = "sidebar__shop-info" >
108- < Image { ...logoProps } className = "sidebar__shop-logo" />
115+ < div className = "sidebar__shop-info-img-box" >
116+ < Image { ...logoProps } className = "sidebar__shop-logo" />
117+ < button
118+ className = "sidebar__shop-info-logout-btn"
119+ onClick = { handleLogout }
120+ >
121+ 로그아웃
122+ </ button >
123+ </ div >
109124 < span className = "sidebar__shop-name" >
110125 { loginInfo . shopName ?. replaceAll ( `"` , "" ) }
111126 </ span >
Original file line number Diff line number Diff line change 2424 align-items : center
2525 margin-bottom : 24px
2626
27+ & __shop-info-img-box
28+ position : relative
29+ width : 36px
30+ height : 36px
31+ margin-right : 6px
32+ border-radius : 10px
33+ border : 1px solid $color-white20
34+ padding-top : 1px
35+ padding-left : 1px
36+ button
37+ visibility : hidden
38+
39+ & __shop-info-img-box :hover
40+ button
41+ visibility : visible
42+ position : absolute
43+ top : 40px
44+ left : 0
45+ width : 129px
46+ height : 36px
47+ color : $color-white
48+ @include body14M
49+ background-color : $color-sub1
50+ border : 1px solid $color-white5
51+ border-radius : 8px
52+
2753 & __shop-logo
2854 width : 32px
2955 height : 32px
30- margin-right : 6px
3156 border-radius : 8px
3257 border : 1px solid $color-white8
3358
Original file line number Diff line number Diff line change 323323 background-color : $color-white5
324324.theme-image-title
325325 display : flex
326+ align-items : center
326327 span
327328 @include title16SB
328329 margin-right : 2px
You can’t perform that action at this time.
0 commit comments