diff --git a/apps/member/src/components/application/ApplicationListSection/ApplicationListSection.tsx b/apps/member/src/components/application/ApplicationListSection/ApplicationListSection.tsx index 4bf79f63..2a62a5b8 100644 --- a/apps/member/src/components/application/ApplicationListSection/ApplicationListSection.tsx +++ b/apps/member/src/components/application/ApplicationListSection/ApplicationListSection.tsx @@ -8,7 +8,7 @@ import { Section } from '@components/common/Section'; import Select from '@components/common/Select/Select'; import { TABLE_HEAD } from '@constants/head'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { usePagination } from '@hooks/common/usePagination'; import { useApplicationAllMemberMutation, @@ -36,8 +36,8 @@ const ApplicationListSection = ({ recruitmentList, }: ApplicationListSectionProps) => { const navigate = useNavigate(); - const { openModal } = useModal(); - const [selectRecruitment, setSelectRecruitment] = useState( + const { open } = useModal(); + const [selectRecruitment, setSelectRecruitment] = useState( recruitmentList.length, // 가장 최신의 모집공고 ); const { page, size, handlePageChange } = usePagination(); @@ -53,28 +53,34 @@ const ApplicationListSection = ({ useEffect(() => { navigate(''); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectRecruitment]); const handleRecruitmentChange = (e: React.ChangeEvent) => { setSelectRecruitment(+e.target.value); }; + const handlePassButtonClick = (recruitmentId: number, studentId: string) => { applicationPassMutate({ recruitmentId, studentId }); }; + const handleNonePassButton = (recruitmentId: number, studentId: string) => { applicationNonePassMutate({ recruitmentId, studentId }); }; + const handleCreateMemberButton = ( recruitmentId: number, studentId: string, ) => { applicationMemberMutate({ recruitmentId, studentId }); }; + const handleCreateAllMemberButton = () => { applicationAllMemberMutate(selectRecruitment); }; + const handleViewButtonClick = (info: ApplicationMemberType) => { - return openModal({ + return open({ title: '지원서', content: , }); diff --git a/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx b/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx index 4edd56b4..8fc9465a 100644 --- a/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx +++ b/apps/member/src/components/calendar/CalendarSchedule/CalendarSchedule.tsx @@ -1,8 +1,6 @@ -import { useCallback } from 'react'; - import { cn } from '@clab-platforms/utils'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { formattedDatePeriod, now } from '@utils/date'; import dayjs from 'dayjs'; @@ -21,19 +19,20 @@ const CalendarSchedule = ({ startDateTime, endDateTime, }: CalendarScheduleProps) => { - const { openModal } = useModal(); + const { open } = useModal(); const isDateDiff = dayjs(startDateTime).diff(endDateTime, 'd'); const isBeforeToday = day.isBefore(today, 'day'); - const handleScheduleClick = useCallback( - (detail: string, startDateTime: string, endDateTime: string) => { - openModal({ - title: '📆 일정', - content: `일시: ${formattedDatePeriod(startDateTime, endDateTime)}\n내용: ${detail}`, - }); - }, - [openModal], - ); + const handleScheduleClick = ( + detail: string, + startDateTime: string, + endDateTime: string, + ) => { + open({ + title: '📆 일정', + content: `일시: ${formattedDatePeriod(startDateTime, endDateTime)}\n내용: ${detail}`, + }); + }; return ( ); diff --git a/apps/member/src/components/common/Modal/Modal.tsx b/apps/member/src/components/common/Modal/Modal.tsx index 21c3a009..235751bc 100644 --- a/apps/member/src/components/common/Modal/Modal.tsx +++ b/apps/member/src/components/common/Modal/Modal.tsx @@ -1,8 +1,9 @@ import { PropsWithChildren } from 'react'; +import { CloseOutline } from '@clab-platforms/icon'; import { cn } from '@clab-platforms/utils'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; interface ModalProps extends PropsWithChildren { disabled?: boolean; @@ -16,7 +17,7 @@ interface ModalButtonProps extends ModalProps { } const Modal = ({ children }: PropsWithChildren) => { - const { closeModal } = useModal(); + const { close } = useModal(); return (
{ >
-
+
{children} @@ -41,11 +39,16 @@ const Modal = ({ children }: PropsWithChildren) => { }; const Header = ({ className, children }: ModalProps) => { + const { close } = useModal(); + return ( -
+

{children}

+
); }; diff --git a/apps/member/src/components/common/Modal/ModalContainer.tsx b/apps/member/src/components/common/Modal/ModalContainer.tsx index 3fb57ebb..28136e7d 100644 --- a/apps/member/src/components/common/Modal/ModalContainer.tsx +++ b/apps/member/src/components/common/Modal/ModalContainer.tsx @@ -1,31 +1,31 @@ import { Suspense, useCallback, useLayoutEffect } from 'react'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useGetModalStore } from '@store/modal'; import Modal from './Modal'; const ModalContainer = () => { const { isOpen, title, content, custom, accept, cancel } = useGetModalStore(); - const { closeModal } = useModal(); + const { close } = useModal(); const handleKeyDown = useCallback( (event: KeyboardEvent) => { if (event.key === 'Escape') { - closeModal(); + close(); } }, - [closeModal], + [close], ); - const onClickAccept = () => { + const handleAcceptClick = () => { accept?.onClick(); - closeModal(); + close(); }; - const onClickCancel = () => { + const handleCancelClick = () => { cancel?.onClick(); - closeModal(); + close(); }; useLayoutEffect(() => { @@ -50,12 +50,12 @@ const ModalContainer = () => { {content} {accept && ( - + {accept.text} )} {cancel && ( - + {cancel.text} )} diff --git a/apps/member/src/components/common/Nav/Nav.tsx b/apps/member/src/components/common/Nav/Nav.tsx index 633159c6..c722766d 100644 --- a/apps/member/src/components/common/Nav/Nav.tsx +++ b/apps/member/src/components/common/Nav/Nav.tsx @@ -7,7 +7,7 @@ import { cn } from '@clab-platforms/utils'; import { IS_DEVELOPMENT } from '@constants/environment'; import { PATH } from '@constants/path'; import { ROLE_LEVEL } from '@constants/state'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useMyProfile } from '@hooks/queries'; import Sidebar from '../Sidebar/Sidebar'; @@ -15,7 +15,7 @@ import Sidebar from '../Sidebar/Sidebar'; const Nav = () => { const location = useLocation(); const navigate = useNavigate(); - const { openModal } = useModal(); + const { open } = useModal(); const { data } = useMyProfile(); @@ -24,7 +24,7 @@ const Nav = () => { const handleMenubarItemClick = (path: string) => navigate(path); const handleNotReadyClick = () => { - return openModal({ + return open({ content: '해당 기능은 준비중입니다.', }); }; diff --git a/apps/member/src/components/common/Notice/Notice.tsx b/apps/member/src/components/common/Notice/Notice.tsx index 917ff3c8..12a0134a 100644 --- a/apps/member/src/components/common/Notice/Notice.tsx +++ b/apps/member/src/components/common/Notice/Notice.tsx @@ -1,8 +1,7 @@ -import { useCallback } from 'react'; - import { cn } from '@clab-platforms/utils'; -import useModal from '@hooks/common/useModal'; +import { MODAL_TITLE } from '@constants/modal'; +import { useModal } from '@hooks/common/useModal'; import { calculateDDay, formattedDate } from '@utils/date'; interface Props { @@ -20,14 +19,14 @@ const Notice = ({ showDDay = false, className, }: Props) => { - const { openModal } = useModal(); + const { open } = useModal(); - const handleNoticeClick = useCallback(() => { - openModal({ - title: '📆 공지', + const handleNoticeClick = () => { + open({ + title: MODAL_TITLE.NOTICE, content, }); - }, [content, openModal]); + }; let renderDDay: React.ReactNode | null = null; if (showDDay) { diff --git a/apps/member/src/components/community/CommunityDeleteButton/CommunityDeleteButton.tsx b/apps/member/src/components/community/CommunityDeleteButton/CommunityDeleteButton.tsx index 5d4787f0..c9217607 100644 --- a/apps/member/src/components/community/CommunityDeleteButton/CommunityDeleteButton.tsx +++ b/apps/member/src/components/community/CommunityDeleteButton/CommunityDeleteButton.tsx @@ -1,7 +1,7 @@ import { Button } from '@clab-platforms/design-system'; import { MODAL_ACCEPT, MODAL_CONTENT, MODAL_TITLE } from '@constants/modal'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useBoardDeleteMutation } from '@hooks/queries'; interface Props { @@ -9,11 +9,11 @@ interface Props { } const CommunityDeleteButton = ({ id }: Props) => { - const { openModal } = useModal(); + const { open } = useModal(); const { boardDeleteMutate } = useBoardDeleteMutation(); const handleAccusesClick = () => { - return openModal({ + return open({ title: MODAL_TITLE.DELETE, content: MODAL_CONTENT.DELETE, accept: { diff --git a/apps/member/src/components/community/CommunityReportButton/CommunityReportButton.tsx b/apps/member/src/components/community/CommunityReportButton/CommunityReportButton.tsx index e4bc20bd..183b81db 100644 --- a/apps/member/src/components/community/CommunityReportButton/CommunityReportButton.tsx +++ b/apps/member/src/components/community/CommunityReportButton/CommunityReportButton.tsx @@ -1,7 +1,7 @@ import { Button } from '@clab-platforms/design-system'; import { MODAL_ACCEPT, MODAL_CONTENT, MODAL_TITLE } from '@constants/modal'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useAccusesMutation } from '@hooks/queries'; interface CommunityReportButtonProps { @@ -10,10 +10,10 @@ interface CommunityReportButtonProps { const CommunityReportButton = ({ id }: CommunityReportButtonProps) => { const { accusesMutate } = useAccusesMutation(); - const { openModal } = useModal(); + const { open } = useModal(); const handleAccusesClick = () => { - openModal({ + open({ title: MODAL_TITLE.REPORT, content: MODAL_CONTENT.REPORT, accept: { diff --git a/apps/member/src/components/group/ActivityConfigTableSection/ActivityConfigTableSection.tsx b/apps/member/src/components/group/ActivityConfigTableSection/ActivityConfigTableSection.tsx index f3597203..d8266ff7 100644 --- a/apps/member/src/components/group/ActivityConfigTableSection/ActivityConfigTableSection.tsx +++ b/apps/member/src/components/group/ActivityConfigTableSection/ActivityConfigTableSection.tsx @@ -4,7 +4,7 @@ import { Section } from '@components/common/Section'; import { ActivityBoardEditModal } from '@components/modal'; import { TABLE_HEAD } from '@constants/head'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useActivityGroupBoardDeleteMutation } from '@hooks/queries'; import { formattedDate, toKoreaISOString } from '@utils/date'; @@ -19,7 +19,7 @@ const ActivityConfigTableSection = ({ tableList, groupId, }: ActivityConfigTableSectionProps) => { - const { openModal } = useModal(); + const { open } = useModal(); const { activityGroupBoardDeleteMutate } = useActivityGroupBoardDeleteMutation(); @@ -27,7 +27,7 @@ const ActivityConfigTableSection = ({ activityGroupBoardDeleteMutate(activityGroupBoardId); }; const handleEditNoticeClick = (prevData: ActivityBoardType) => { - return openModal({ + return open({ title: '수정하기', custom: , }); diff --git a/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeSection.tsx b/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeSection.tsx index 71df756a..0c070ea8 100644 --- a/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeSection.tsx +++ b/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeSection.tsx @@ -6,7 +6,7 @@ import { cn } from '@clab-platforms/utils'; import DropdownButton from '@components/common/DropdownButton/DropdownButton'; import Section from '@components/common/Section/Section'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { formattedDate, toKoreaISOString } from '@utils/date'; import dayjs from 'dayjs'; @@ -15,11 +15,11 @@ import type { ResponseFile } from '@type/api'; import { ActivityNoticeModal } from './ActivityNoticeModal'; -interface ActivityNoticeSectionProps { +interface Props { data: Array; } -interface ActivityNoticeSectionItemProps { +interface ItemProps { className?: string; onClick: ( content: string, @@ -29,8 +29,8 @@ interface ActivityNoticeSectionItemProps { data: ActivityBoardType; } -const ActivityNoticeSection = ({ data }: ActivityNoticeSectionProps) => { - const { openModal } = useModal(); +const ActivityNoticeSection = ({ data }: Props) => { + const { open: openModal } = useModal(); const [open, setOpen] = useState(false); if (!data || data.length === 0) { @@ -44,7 +44,7 @@ const ActivityNoticeSection = ({ data }: ActivityNoticeSectionProps) => { const latestNotice = sortedNotices[0]; const otherNotices = sortedNotices.slice(1); - const onClickAlert = ( + const handleNoticeClick = ( content: string, title?: string, files?: Array, @@ -60,7 +60,7 @@ const ActivityNoticeSection = ({ data }: ActivityNoticeSectionProps) => {
{otherNotices.length > 0 && ( { ))}
@@ -91,11 +91,7 @@ const ActivityNoticeSection = ({ data }: ActivityNoticeSectionProps) => { ); }; -ActivityNoticeSection.Item = ({ - className, - data, - onClick, -}: ActivityNoticeSectionItemProps) => { +ActivityNoticeSection.Item = ({ className, data, onClick }: ItemProps) => { return (
{ const [mode, setMode] = useState(false); const { page, size, handlePageChange } = usePagination({ defaultSize: 10 }); - const { openModal, closeModal } = useModal(); + const { open, close } = useModal(); const { activityGroupApplicationMutate } = useActivityGroupApplicationMutation(); const { data: applyMemberList } = useActivityGroupApplication({ @@ -82,7 +82,7 @@ const ActivityParticipantEditor = ({ })), ); const handleOpenModal = (name: string, content: string) => { - openModal({ + open({ title: '📝 ' + name, content: content, }); @@ -133,7 +133,7 @@ const ActivityParticipantEditor = ({ .filter((member) => member.status === true) .map((member) => member.memberId); - openModal({ + open({ content: ( ), }); diff --git a/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx b/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx index 208414f8..bad5d815 100644 --- a/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx +++ b/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx @@ -9,7 +9,7 @@ import { ActivityBoardEditModal } from '@components/modal'; import { FORM_DATA_KEY } from '@constants/api.ts'; import { ACTIVITY_BOARD_CATEGORY_STATE } from '@constants/state.ts'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardDeleteMutation, @@ -40,17 +40,13 @@ const ActivityPostEditor = ({ assignments, }: ActivityPostEditorProps) => { const toast = useToast(); - const { openModal } = useModal(); + const { open } = useModal(); const [post, setPost] = useState(defaultPost); const [editAssignment, setEditAssignment] = useState( Array.from({ length: activities.length }, () => false), ); const uploaderRef = useRef(null); - useEffect(() => { - setEditAssignment(Array.from({ length: activities.length }, () => false)); - }, [activities]); - const { data: myProfile } = useMyProfile(); const { activityGroupBoardMutate, activityGroupBoardIsPending } = @@ -58,6 +54,10 @@ const ActivityPostEditor = ({ const { activityGroupBoardDeleteMutate } = useActivityGroupBoardDeleteMutation(); + useEffect(() => { + setEditAssignment(Array.from({ length: activities.length }, () => false)); + }, [activities]); + const handlePostChange = ( e: React.ChangeEvent, ) => { @@ -98,7 +98,7 @@ const ActivityPostEditor = ({ activityGroupBoardDeleteMutate(activityGroupBoardId); }; const handleEditWeeklyClick = (prevData: ActivityBoardType) => - openModal({ + open({ title: '수정하기', custom: , }); diff --git a/apps/member/src/components/group/AssignmentListSection/AssignmentFeedbackModal.tsx b/apps/member/src/components/group/AssignmentListSection/AssignmentFeedbackModal.tsx index dd0b131f..55feb457 100644 --- a/apps/member/src/components/group/AssignmentListSection/AssignmentFeedbackModal.tsx +++ b/apps/member/src/components/group/AssignmentListSection/AssignmentFeedbackModal.tsx @@ -4,7 +4,7 @@ import File from '@components/common/File/File'; import Modal from '@components/common/Modal/Modal'; import Textarea from '@components/common/Textarea/Textarea'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardMutation, @@ -25,7 +25,7 @@ const AssignmentFeedbackModal = ({ groupId, assignmentId, }: AssignmentFeedbackModalProps) => { - const { closeModal } = useModal(); + const { close } = useModal(); const toast = useToast(); const [feedback, setFeedback] = useState(''); const { data: myProfile } = useMyProfile(); @@ -65,7 +65,7 @@ const AssignmentFeedbackModal = ({ }, }); } - closeModal(); + close(); }; useEffect(() => { @@ -108,7 +108,7 @@ const AssignmentFeedbackModal = ({ > 입력 - + 취소 diff --git a/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx b/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx index 57cffc44..14605df1 100644 --- a/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx +++ b/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx @@ -8,7 +8,7 @@ import { Section } from '@components/common/Section'; import { TABLE_HEAD } from '@constants/head'; import { GROUP_MESSAGE } from '@constants/message'; import { ACTIVITY_MEMBER_ROLE, ACTIVITY_MEMBER_STATE } from '@constants/state'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useActivityGroupBoardByParent, useActivityGroupMemberList, @@ -21,7 +21,7 @@ import AssignmentFeedbackModal from './AssignmentFeedbackModal'; const AssignmentListSection = () => { const { id, assignmentId } = useParams(); - const { openModal } = useModal(); + const { open } = useModal(); if (!assignmentId || !id) { throw new Error(GROUP_MESSAGE.NO_ACTIVITY); @@ -50,7 +50,7 @@ const AssignmentListSection = () => { groupId: number, assignmentId: number, ) => { - return openModal({ + return open({ custom: ( { const [mode, setMode] = useState( ACTIVITY_STATE.WAITING, ); - const { openModal, closeModal } = useModal(); + const { open, close } = useModal(); const { page, size, handlePageChange } = usePagination({ defaultSize: 6, sectionName: 'activity', @@ -41,19 +41,21 @@ const ManageActivitySection = () => { }); const handleInfoButtonClick = (groupId: number) => { - return openModal({ + return open({ title: '그룹 정보', content: , }); }; + const handleMenubarItemClick = (mode: ActivityGroupStatusType) => { setMode(mode); }; + const handleApproveButtonClick = ( id: number, status: ActivityGroupStatusType, ) => { - openModal({ + open({ content: ( { activityGroupStatus: status, }); }} - handleClose={closeModal} + handleClose={close} /> ), }); }; + const handleRejectButtonClick = (id: number) => { - openModal({ + open({ content: ( { activityGroupDeleteMutate(id); }} - handleClose={closeModal} + handleClose={close} /> ), }); diff --git a/apps/member/src/components/manage/ManageAlertSection/ManagerAlertSection.tsx b/apps/member/src/components/manage/ManageAlertSection/ManagerAlertSection.tsx index 4bcffb7d..b7feda50 100644 --- a/apps/member/src/components/manage/ManageAlertSection/ManagerAlertSection.tsx +++ b/apps/member/src/components/manage/ManageAlertSection/ManagerAlertSection.tsx @@ -12,7 +12,7 @@ import CommunityBoardForm from '@components/community/CommunityBoardForm/Communi import { SERVICE_NAME } from '@constants/environment'; import { TABLE_HEAD, TABLE_HEAD_ACTION } from '@constants/head'; import { PATH_FINDER } from '@constants/path'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { usePagination } from '@hooks/common/usePagination'; import { useBoardByCategory, useBoardDeleteMutation } from '@hooks/queries'; import { getCategoryTitle } from '@utils/community'; @@ -28,7 +28,7 @@ type ModeState = 'view' | 'add'; const ManagerAlertSection = ({ category }: ManagerAlertSectionProps) => { const navigate = useNavigate(); - const { openModal } = useModal(); + const { open } = useModal(); const { boardDeleteMutate } = useBoardDeleteMutation(); const { data } = useBoardByCategory({ hasPermission: true, @@ -53,7 +53,7 @@ const ManagerAlertSection = ({ category }: ManagerAlertSectionProps) => { id: number, ) => { e.stopPropagation(); - return openModal({ + return open({ title: `${title} 삭제`, content: `해당 ${title}을 정말 삭제하시겠습니까?\n삭제된 데이터는 복구할 수 없습니다.`, accept: { diff --git a/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx b/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx index d77b739e..69047777 100644 --- a/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx +++ b/apps/member/src/components/manage/ManageCalendarSection/ManageCalendarSection.tsx @@ -11,7 +11,7 @@ import { Section } from '@components/common/Section'; import { TABLE_HEAD } from '@constants/head'; import { PATH } from '@constants/path'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { usePagination } from '@hooks/common/usePagination'; import { useSchedule, useScheduleDeleteMutation } from '@hooks/queries'; import { formattedDate, now } from '@utils/date'; @@ -21,7 +21,7 @@ type Mode = 'view' | 'add'; const ManageCalendarSection = () => { const navigate = useNavigate(); - const { openModal } = useModal(); + const { open } = useModal(); const [mode, setMode] = useState('view'); const { page, size, handlePageChange } = usePagination({ @@ -43,7 +43,7 @@ const ManageCalendarSection = () => { id: number, ) => { e.stopPropagation(); - return openModal({ + return open({ title: '스케줄 삭제', content: `해당 스케줄을 정말 삭제하시겠습니까?\n삭제된 데이터는 복구할 수 없습니다.`, accept: { diff --git a/apps/member/src/components/manage/ManageLibrarySection/ManageLibrarySection.tsx b/apps/member/src/components/manage/ManageLibrarySection/ManageLibrarySection.tsx index 79f48dba..2199c867 100644 --- a/apps/member/src/components/manage/ManageLibrarySection/ManageLibrarySection.tsx +++ b/apps/member/src/components/manage/ManageLibrarySection/ManageLibrarySection.tsx @@ -9,7 +9,7 @@ import BookLoanConditionStatusBadge from '@components/library/BookLoanConditionS import { MemberInfoModal } from '@components/modal'; import { TABLE_HEAD } from '@constants/head'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { usePagination } from '@hooks/common/usePagination'; import { useBookLoanRecordApproveMutation, @@ -24,7 +24,7 @@ const ManageLibrarySection = () => { const { page, size, handlePageChange } = usePagination({ sectionName: 'library', }); - const { openModal } = useModal(); + const { open } = useModal(); const [mode, setMode] = useState('condition'); @@ -49,7 +49,7 @@ const ManageLibrarySection = () => { }; const handleContactButtonClick = (id: string) => { - return openModal({ + return open({ title: '멤버 정보', content: , }); diff --git a/apps/member/src/components/modal/ActivityBoardEditModal.tsx b/apps/member/src/components/modal/ActivityBoardEditModal.tsx index a7684fc4..cc6050c3 100644 --- a/apps/member/src/components/modal/ActivityBoardEditModal.tsx +++ b/apps/member/src/components/modal/ActivityBoardEditModal.tsx @@ -9,7 +9,7 @@ import Textarea from '@components/common/Textarea/Textarea'; import { FORM_DATA_KEY } from '@constants/api'; import { ACTIVITY_BOARD_CATEGORY_STATE } from '@constants/state'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardPatchMutation } from '@hooks/queries'; @@ -27,7 +27,7 @@ interface FileUploaderProps { } export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { - const { closeModal } = useModal(); + const { close } = useModal(); const toast = useToast(); const [board, setBoard] = useState(prevData); @@ -75,7 +75,7 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { }, files: files?.length ? formData : undefined, }); - closeModal(); + close(); }; return ( @@ -122,7 +122,7 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { > 변경 - + 취소 diff --git a/apps/member/src/components/panels/AlarmPanel/AlarmPanel.tsx b/apps/member/src/components/panels/AlarmPanel/AlarmPanel.tsx index 34060bd5..d6dbad25 100644 --- a/apps/member/src/components/panels/AlarmPanel/AlarmPanel.tsx +++ b/apps/member/src/components/panels/AlarmPanel/AlarmPanel.tsx @@ -5,14 +5,14 @@ import { AboutColor } from '@clab-platforms/icon'; import Panel from '@components/common/Panel/Panel'; import { MODAL_TITLE } from '@constants/modal'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useMyNotifications } from '@hooks/queries'; const AlarmPanel = () => { const { data } = useMyNotifications({ size: 5 }); const [open, setOpen] = useState(true); - const { openModal } = useModal(); + const { open: openModal } = useModal(); const handleOpenClick = () => setOpen((prev) => !prev); diff --git a/apps/member/src/components/panels/BookPanel/BookPanel.tsx b/apps/member/src/components/panels/BookPanel/BookPanel.tsx index 8f66cbb8..84f2edb2 100644 --- a/apps/member/src/components/panels/BookPanel/BookPanel.tsx +++ b/apps/member/src/components/panels/BookPanel/BookPanel.tsx @@ -4,7 +4,7 @@ import Panel from '@components/common/Panel/Panel'; import ProgressBar from '@components/common/ProgressBar/ProgressBar'; import Select from '@components/common/Select/Select'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useBookLoanExtendMutation, useBookLoanRecordConditions, @@ -31,7 +31,7 @@ const ActionButton = ({ ); const BookPanel = () => { - const { openModal } = useModal(); + const { open } = useModal(); const { data: myProfile } = useMyProfile(); const { data } = useBookLoanRecordConditions({ @@ -52,7 +52,7 @@ const BookPanel = () => { const handleActionClick = (action: Action) => { let selectedBookId = selectOptions[0].value; // 기본값으로 첫 번째 책 선택 - openModal({ + open({ title: action, content: (