Skip to content

Commit 4a832a4

Browse files
authored
Merge pull request #156 from hhjin1/card-hj
[Feat, Style] Modal: 카드 상세모달 삭제시 토스트알림 / Card: 프로필이미지 띄우기
2 parents 83b53f7 + 73a9738 commit 4a832a4

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

src/components/columnCard/Card.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function Card({
1919
<div
2020
onClick={onClick}
2121
className={`
22-
flex flex-col md:flex-row lg:flex-col
22+
flex flex-col md:flex-row lg:flex-col cursor-pointer
2323
items-start rounded-md bg-white border border-gray-200 p-4
2424
w-[284px] sm:w-full md:w-[544px] md:h-[93px] lg:w-[314px] lg:h-auto
2525
`}
@@ -97,9 +97,19 @@ export default function Card({
9797
/>
9898
<span>{dueDate}</span>
9999
</div>
100-
<div className="w-6 h-6 flex items-center justify-center bg-[#A3C4A2] text-white font-bold rounded-full text-xs">
101-
{assignee.nickname[0]}
102-
</div>
100+
{assignee.profileImageUrl ? (
101+
<Image
102+
src={assignee.profileImageUrl}
103+
alt="프로필 이미지"
104+
width={24}
105+
height={24}
106+
className="w-6 h-6 rounded-full object-cover"
107+
/>
108+
) : (
109+
<div className="w-6 h-6 flex items-center justify-center bg-[#A3C4A2] text-white font-bold rounded-full text-xs">
110+
{assignee.nickname[0]}
111+
</div>
112+
)}
103113
</div>
104114
</div>
105115
</div>

src/components/columnCard/Column.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import Image from "next/image";
44
import { CardType } from "@/types/task";
55
import TodoModal from "@/components/modalInput/ToDoModal";
66
import TodoButton from "@/components/button/TodoButton";
7-
import ColumnManageModal from "@/components/columncard/ColumnManageModal";
8-
import ColumnDeleteModal from "@/components/columncard/ColumnDeleteModal";
7+
import ColumnManageModal from "@/components/columnCard/ColumnManageModal";
8+
import ColumnDeleteModal from "@/components/columnCard/ColumnDeleteModal";
99
import { updateColumn, deleteColumn } from "@/api/columns";
1010
import { getDashboardMembers, getCardDetail } from "@/api/card";
1111
import { MemberType } from "@/types/users";

src/components/modalDashboard/CardDetailModal.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import TaskModal from "@/components/modalInput/TaskModal";
1212
import { useClosePopup } from "@/hooks/useClosePopup";
1313
import { getColumn } from "@/api/columns";
1414
import { useRouter } from "next/router";
15+
import { toast } from "react-toastify";
1516

1617
interface CardDetailModalProps {
1718
card: CardDetailType;
@@ -65,7 +66,12 @@ export default function CardDetailPage({
6566
mutationFn: () => deleteCard(card.id),
6667
onSuccess: () => {
6768
queryClient.invalidateQueries({ queryKey: ["cards"] });
69+
toast.success("카드가 삭제되었습니다.");
6870
onClose();
71+
72+
setTimeout(() => {
73+
router.reload();
74+
}, 1500);
6975
},
7076
});
7177

0 commit comments

Comments
 (0)