diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.module.css b/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.module.css
index 36db845..fabc813 100644
--- a/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.module.css
+++ b/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.module.css
@@ -10,6 +10,10 @@
align-items: center;
}
+.moreButton:focus {
+ outline: none;
+}
+
.menuContainer {
position: absolute;
z-index: 999;
diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.tsx b/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.tsx
index 6528cfc..c60b57d 100644
--- a/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.tsx
+++ b/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/HeaderMenu.tsx
@@ -3,11 +3,11 @@ import type { Menu } from '@/types/menu';
import MenuDropdown from '@/components/MenuDropdown';
import { useMenu } from '@/hooks/useMenu';
import { deleteCard } from '@/lib/cardService';
-import { useRouter } from 'next/navigation';
-import useDashboardStore from '@/store/dashboardStore';
import useModalStore from '@/store/modalStore';
-import UpdateTaskModal from '../UpdateTaskModal';
+import UpdateCardModal from '../UpdateCardModal';
import styles from './HeaderMenu.module.css';
+import useTriggerStore from '@/store/triggerStore';
+import useCardStore from '@/store/cardStore';
interface HeaderMenuProps {
cardId: number;
@@ -15,19 +15,19 @@ interface HeaderMenuProps {
}
export default function HeaderMenu({ cardId, closeModal }: HeaderMenuProps) {
- const router = useRouter();
- const { dashboard } = useDashboardStore();
+ const { updateTrigger } = useTriggerStore();
const { isMenuVisible, toggleMenu } = useMenu();
const { openModal } = useModalStore();
const handleDeleteClick = async () => {
await deleteCard(cardId);
closeModal();
- router.replace(`/dashboard/${dashboard?.id}`);
+ useCardStore.getState().removeCard(cardId);
+ updateTrigger.card();
};
const handleUpdateClick = () => {
- openModal(
);
+ openModal(
);
};
const cardMenus: Menu[] = [
diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/comments/CommentDetail.tsx b/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/comments/CommentDetail.tsx
index d448371..7e41e92 100644
--- a/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/comments/CommentDetail.tsx
+++ b/src/app/(with-header-sidebar)/dashboard/[id]/components/card-detail/comments/CommentDetail.tsx
@@ -1,10 +1,4 @@
-import {
- useState,
- ChangeEvent,
- KeyboardEvent,
- MouseEvent,
- useRef,
-} from 'react';
+import { useState, ChangeEvent, KeyboardEvent, useRef } from 'react';
import Avatar from '@/components/Avatar';
import Button from '@/components/Button';
import { formatDateToCustomFormat } from '@/utils/dateUtils';
@@ -58,7 +52,6 @@ export default function CommentDetail({
e.preventDefault();
handleSave();
toggleEditing();
- // todo: 수정성공시 토스트 박스
}
};
@@ -80,7 +73,6 @@ export default function CommentDetail({
const handleDeleteOnClick = async () => {
await deleteComment(id);
onDelete(id);
- // todo: 삭제성공시 토스트 박스
};
return (
diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/DeleteButton.tsx b/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/DeleteButton.tsx
index 17957f2..9828eef 100644
--- a/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/DeleteButton.tsx
+++ b/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/DeleteButton.tsx
@@ -1,17 +1,21 @@
'use client';
import { useRouter } from 'next/navigation';
-import useIdStore from '@/store/idStore';
import Button from '@/components/Button';
import { deleteDashboard } from '@/lib/boardService';
import styles from './DeleteButton.module.css';
+import useDashboardStore from '@/store/dashboardStore';
+import useTriggerStore from '@/store/triggerStore';
export default function DeleteButton() {
- const id = useIdStore((state) => state.id);
+ const { dashboard, setDashboard } = useDashboardStore();
+ const { updateTrigger } = useTriggerStore();
const router = useRouter();
const handleClick = async () => {
- await deleteDashboard(id);
+ await deleteDashboard(dashboard!.id.toString());
+ setDashboard(null);
+ updateTrigger.dashboard();
router.replace('/mydashboard');
};
diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/EditForm.tsx b/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/EditForm.tsx
index 7e0a6ad..a6a25e4 100644
--- a/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/EditForm.tsx
+++ b/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/EditForm.tsx
@@ -7,9 +7,11 @@ import { getBoard, updateBoard } from '@/lib/boardService';
import { Dashboard, UpdateDashboardRequestParams } from '@/types/dashboards';
import Button from '@/components/Button';
import DashboardInput from '@/components/DashboardInput';
+import useTriggerStore from '@/store/triggerStore';
import styles from './EditForm.module.css';
export default function EditForm() {
+ const { updateTrigger } = useTriggerStore();
const [board, setBoard] = useState
();
const id = useIdStore((state) => state.id);
const {
@@ -26,6 +28,7 @@ export default function EditForm() {
const onSubmit = async (data: UpdateDashboardRequestParams) => {
const response = await updateBoard(id, data);
+ updateTrigger.dashboard();
setBoard(response);
};
diff --git a/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/InvitationModal.tsx b/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/InvitationModal.tsx
index c735dab..dc8e04e 100644
--- a/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/InvitationModal.tsx
+++ b/src/app/(with-header-sidebar)/dashboard/[id]/edit/_components/InvitationModal.tsx
@@ -18,10 +18,7 @@ export default function InvitationModal({
} = useForm<{ email: string }>({ mode: 'onChange' });
const { closeModal } = useModalStore();
- const onSubmit = async ({ email }: { email: string }) => {
- handleInvite(email);
- closeModal();
- };
+ const onSubmit = async ({ email }: { email: string }) => handleInvite(email);
return (