Skip to content

Commit

Permalink
feat: add logout to mypage
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinho1011 committed Mar 7, 2024
1 parent 988359a commit f090838
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/routes/MyPage/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import ProfileImg from '@components/commons/ProfileImg/ProfileImg';
import Text from '@components/commons/Text/Text';
import useActionSheet from '@hooks/useModal/useActionSheet';

import { useAuthStore } from '@store/auth';

import { colors } from '@styles/theme';

import { AlbumIcon, CameraIcon, RightChevronIcon, TrashIcon } from '@icons/index';
Expand All @@ -29,6 +31,7 @@ import {

const MyPage = () => {
const navigate = useNavigate();
const logout = useAuthStore((state) => state.logout);

const profileImageInputRef = useRef<HTMLInputElement>(null);

Expand Down Expand Up @@ -156,6 +159,10 @@ const MyPage = () => {
],
});

const handleLogout = () => {
logout();
};

return (
<Layout
hasBottomNavigation={true}
Expand Down Expand Up @@ -217,15 +224,17 @@ const MyPage = () => {
</Row>
<Divider />
<Row>
<Text
style={{ padding: '0 7px' }}
size={16}
weight={400}
color={colors.white}
align="start"
>
로그아웃
</Text>
<button onClick={handleLogout}>
<Text
style={{ padding: '0 7px' }}
size={16}
weight={400}
color={colors.white}
align="start"
>
로그아웃
</Text>
</button>
</Row>
</Col>
</Col>
Expand Down

0 comments on commit f090838

Please sign in to comment.