Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#507] [프로필] 로그아웃 햄버거 구현 #508

Merged
merged 2 commits into from
Apr 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions src/app/profile/me/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
'use client';

import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { checkAuthentication, removeAuth } from '@/utils/helpers';

import userAPI from '@/apis/user';
import TopHeader from '@/v1/base/TopHeader';
import ProfileInfo from '@/v1/profile/info/ProfileInfo';
import ProfileBookShelf from '@/v1/profile/bookShelf/ProfileBookShelf';
import ProfileGroup from '@/v1/profile/group/ProfileGroup';
import Avatar from '@/v1/base/Avatar';
import Link from 'next/link';

import { checkAuthentication, removeAuth } from '@/utils/helpers';

import { IconArrowRight } from '@public/icons';
import BookShelf from '@/v1/bookShelf/BookShelf';

import SSRSafeSuspense from '@/components/SSRSafeSuspense';
import Loading from '@/v1/base/Loading';

import Avatar from '@/v1/base/Avatar';
import Button from '@/v1/base/Button';
import Loading from '@/v1/base/Loading';
import Menu from '@/v1/base/Menu';
import TopHeader from '@/v1/base/TopHeader';
import BookShelf from '@/v1/bookShelf/BookShelf';
import ProfileBookShelf from '@/v1/profile/bookShelf/ProfileBookShelf';
import ProfileGroup from '@/v1/profile/group/ProfileGroup';
import ProfileInfo from '@/v1/profile/info/ProfileInfo';

const USER_ID = 'me';
const KAKAO_LOGIN_URL = `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorize/kakao?redirect_uri=${process.env.NEXT_PUBLIC_CLIENT_REDIRECT_URI}`;
Expand Down Expand Up @@ -80,7 +86,12 @@ const MyProfileForAuth = () => {
return (
<>
<TopHeader text="Profile">
<button onClick={handleLogoutButtonClick}>로그아웃</button>
<Menu>
<Menu.Toggle />
<Menu.DropdownList>
<Menu.Item onSelect={handleLogoutButtonClick}>로그아웃</Menu.Item>
Copy link
Member Author

@hanyugeon hanyugeon Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question;

line 80을 보면 핸들링 함수에 userAPI.logout()을 호출하여 로그아웃을 하고있어요

#499 이슈를 함께 해결해봐도 좋을 것 같은데 어떻게 생각하시나요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오! 너무 좋아요!! 👍🏻

</Menu.DropdownList>
</Menu>
</TopHeader>
<div className="flex flex-col gap-[2rem]">
<ProfileInfo userId={USER_ID} />
Expand Down
Loading