Skip to content

Commit

Permalink
Feat: 개인 프로필 수정은 아직 제공되지 않으므로 막아놓음
Browse files Browse the repository at this point in the history
  • Loading branch information
soulchicken committed Oct 23, 2023
1 parent 88472bb commit 574be24
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
37 changes: 26 additions & 11 deletions src/components/profile/UserRouteButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { css } from '@emotion/react';
import color from '@/styles/color';
import { signOut } from 'next-auth/react';
import Toast from '@/components/common/toast/Toast';
import { useState } from 'react';
import LogOutIcon from '../icons/LogoutIcon';
import ProfileSettingIcon from '../icons/ProfileSettingIcon';

const ProfileRouteButtons = () => {
const [toastMessage, setToastMessage] = useState('');

// TODO: 미들웨어로 로그인 여부를 컨트롤할 예정
// TODO: 백엔드 로그아웃 로직이 변경되고 있는 중이라 아직 쓸 수 없는 코드가 있음
// const { data: session }: any = useSession();
Expand All @@ -14,20 +18,31 @@ const ProfileRouteButtons = () => {
};

const profileEditHandler = () => {
console.log(1);
setToastMessage('개인 프로필 수정은 추후에 제공될 예정입니다. :)');
};

const handleToastClose = () => {
setToastMessage('');
};

return (
<div css={ButtonsWrapperCSS}>
<button onClick={profileEditHandler} css={buttonCSS} type="button">
<ProfileSettingIcon color={color.black} />
Profile Edit
</button>
<button onClick={signOutHandler} css={buttonCSS} type="button">
<LogOutIcon color={color.black} />
Log Out
</button>
</div>
<>
<div css={ButtonsWrapperCSS}>
<button onClick={profileEditHandler} css={buttonCSS} type="button">
<ProfileSettingIcon color={color.black} />
Profile Edit
</button>
<button onClick={signOutHandler} css={buttonCSS} type="button">
<LogOutIcon color={color.black} />
Log Out
</button>
</div>
{
toastMessage
? <Toast message={toastMessage} handleClose={handleToastClose} />
: null
}
</>
);
};

Expand Down
1 change: 0 additions & 1 deletion src/pages/profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import UserRouteButtons from '@/components/profile/UserRouteButtons';

const Profile = () => {
const { data: session }: any = useSession();
console.log(session);

return (
<>
Expand Down

0 comments on commit 574be24

Please sign in to comment.