Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default function ProfilePopup({
}
}

if (open) document.addEventListener('mousedown', handleClickOutside);
if (open) {
document.addEventListener('mousedown', handleClickOutside);
}
return () => document.removeEventListener('mousedown', handleClickOutside);
}, [open, onClose]);

Expand Down Expand Up @@ -66,7 +68,7 @@ export default function ProfilePopup({

<div className="text-font-gray-3 mb-[1.6rem] flex items-center gap-[0.2rem]">
<Icon name="ic_clock_active" width={18} height={18} />
<span className="">리마인드 알람&nbsp;</span>
<span>리마인드 알람&nbsp;</span>
<span className="caption2-m">{formatRemindTime(remindTime)}</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { createPortal } from 'react-dom';
import ProfilePopup from './ProfilePopup';

interface ProfilePopupPortalProps {
open: boolean;
onClose: () => void;
profileImage: string | null;
email: string;
name: string;
remindTime?: string;
}

export default function ProfilePopupPortal({
open,
onClose,
profileImage,
email,
name,
remindTime,
}: ProfilePopupPortalProps) {
if (typeof document === 'undefined') return null;

return createPortal(
<ProfilePopup
open={open}
onClose={onClose}
profileImage={profileImage}
email={email}
Comment on lines +23 to +28
Copy link
Collaborator

Choose a reason for hiding this comment

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

아예 포탈로 처리해서 해결하셨군요! 굿굿 확인했습니다 :)

name={name}
remindTime={remindTime}
/>,
document.body
);
}
4 changes: 2 additions & 2 deletions apps/client/src/shared/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { useEffect, useState } from 'react';
import { useQueryClient } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
import ProfilePopup from '../profilePopup/ProfilePopup';
import ProfilePopupPortal from '../profilePopup/ProfilePopupPortal';

export function Sidebar() {
const [newCategoryName, setNewCategoryName] = useState('');
Expand Down Expand Up @@ -247,7 +247,7 @@ export function Sidebar() {

{/* 팝업 영역 */}

<ProfilePopup
<ProfilePopupPortal
open={profileOpen}
onClose={() => setProfileOpen(false)}
profileImage={chippiImageUrl}
Expand Down
Loading