From 7265d90c8c62bcc7548f4c29e3e3a7a990bdd730 Mon Sep 17 00:00:00 2001 From: bicochan Date: Wed, 28 May 2025 16:32:53 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20useMenuStore,=20useUserStore=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EB=B6=80=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/features/app/(with-base-layout)/layout.tsx | 2 +- apps/common/features/app/(with-base-layout)/pst/layout.tsx | 2 +- apps/common/features/src/pages/(pst)/faq/ui/create-page.tsx | 2 +- apps/common/features/src/pages/(pst)/faq/ui/faq-page.tsx | 2 +- apps/common/features/src/pages/(pst)/faq/ui/modify-page.tsx | 2 +- apps/common/features/src/pages/(pst)/image/ui/create-page.tsx | 2 +- apps/common/features/src/pages/(pst)/image/ui/modify-page.tsx | 2 +- apps/common/features/src/pages/(pst)/movie/ui/create-page.tsx | 2 +- apps/common/features/src/pages/(pst)/movie/ui/modify-page.tsx | 2 +- .../common/features/src/pages/(pst)/normal/ui/create-page.tsx | 2 +- .../common/features/src/pages/(pst)/normal/ui/modify-page.tsx | 2 +- .../common/features/src/pages/(pst)/notice/ui/create-page.tsx | 2 +- .../common/features/src/pages/(pst)/notice/ui/modify-page.tsx | 2 +- .../features/src/widgets/post/ui/general-file-uploader.tsx | 2 +- apps/common/features/src/widgets/post/ui/post-action.tsx | 4 ++-- apps/common/features/src/widgets/post/ui/post-comment.tsx | 2 +- apps/common/features/src/widgets/post/ui/post-form.tsx | 4 ++-- apps/common/features/src/widgets/post/ui/post-page.tsx | 2 +- apps/common/features/src/widgets/post/ui/post.tsx | 4 ++-- .../src/widgets/post/ui/with-preview-file-uploader.tsx | 2 +- apps/cs/app/(with-base-layout)/layout.tsx | 2 +- apps/cs/src/pages/(post)/faq/ui/create-page.tsx | 2 +- apps/cs/src/pages/(post)/faq/ui/faq-page.tsx | 2 +- apps/cs/src/pages/(post)/faq/ui/modify-page.tsx | 2 +- apps/cs/src/pages/(post)/image/ui/create-page.tsx | 2 +- apps/cs/src/pages/(post)/image/ui/modify-page.tsx | 2 +- apps/cs/src/pages/(post)/movie/ui/create-page.tsx | 2 +- apps/cs/src/pages/(post)/movie/ui/modify-page.tsx | 2 +- apps/cs/src/pages/(post)/normal/ui/create-page.tsx | 2 +- apps/cs/src/pages/(post)/normal/ui/modify-page.tsx | 2 +- apps/cs/src/pages/(post)/notice/ui/create-page.tsx | 2 +- apps/cs/src/pages/(post)/notice/ui/modify-page.tsx | 2 +- apps/cs/src/pages/bbs/model/table-columns.tsx | 2 +- apps/cs/src/pages/image/ui/image-form.tsx | 4 +++- apps/cs/src/pages/popup/ui/create-page.tsx | 2 +- apps/cs/src/pages/popup/ui/modify-page.tsx | 2 +- apps/cs/src/shared/ui/page-layout.tsx | 2 +- apps/cs/src/widgets/post/ui/general-file-uploader.tsx | 2 +- apps/cs/src/widgets/post/ui/post-action.tsx | 4 ++-- apps/cs/src/widgets/post/ui/post-comment.tsx | 2 +- apps/cs/src/widgets/post/ui/post-form.tsx | 4 ++-- apps/cs/src/widgets/post/ui/with-preview-file-uploader.tsx | 2 +- 42 files changed, 49 insertions(+), 47 deletions(-) diff --git a/apps/common/features/app/(with-base-layout)/layout.tsx b/apps/common/features/app/(with-base-layout)/layout.tsx index bb1b7c0ba..970ccce5e 100644 --- a/apps/common/features/app/(with-base-layout)/layout.tsx +++ b/apps/common/features/app/(with-base-layout)/layout.tsx @@ -15,7 +15,7 @@ export default function WithBaseLayout({ const pathname = usePathname(); const queryClient = useQueryClient(); - const { setCurrentMenuInfo } = useMenuStore((state) => state); + const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo); const handleMenuClick = (item: MenuItem) => { setCurrentMenuInfo(item); diff --git a/apps/common/features/app/(with-base-layout)/pst/layout.tsx b/apps/common/features/app/(with-base-layout)/pst/layout.tsx index e0333f2d2..3f700d076 100644 --- a/apps/common/features/app/(with-base-layout)/pst/layout.tsx +++ b/apps/common/features/app/(with-base-layout)/pst/layout.tsx @@ -8,7 +8,7 @@ export default function PostLayout({ }: { children: React.ReactNode; }) { - const { bbsInfo } = useMenuStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); return ( state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/common/features/src/pages/(pst)/faq/ui/faq-page.tsx b/apps/common/features/src/pages/(pst)/faq/ui/faq-page.tsx index c0281504c..aa67a17c5 100644 --- a/apps/common/features/src/pages/(pst)/faq/ui/faq-page.tsx +++ b/apps/common/features/src/pages/(pst)/faq/ui/faq-page.tsx @@ -31,7 +31,7 @@ function FaqPage({ bbsId }: { bbsId: string }) { const router = useRouter(); const pathname = usePathname(); const { confirm } = useConfirm(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { bbsInfo, pageMenuAuthority } = useMenuStore((state) => state); diff --git a/apps/common/features/src/pages/(pst)/faq/ui/modify-page.tsx b/apps/common/features/src/pages/(pst)/faq/ui/modify-page.tsx index 244d30c4b..6987cb0bc 100644 --- a/apps/common/features/src/pages/(pst)/faq/ui/modify-page.tsx +++ b/apps/common/features/src/pages/(pst)/faq/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_USER, bbsId, pstNo], diff --git a/apps/common/features/src/pages/(pst)/image/ui/create-page.tsx b/apps/common/features/src/pages/(pst)/image/ui/create-page.tsx index 6931a96d0..dc5e4f894 100644 --- a/apps/common/features/src/pages/(pst)/image/ui/create-page.tsx +++ b/apps/common/features/src/pages/(pst)/image/ui/create-page.tsx @@ -10,7 +10,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function CreatePage({ bbsId }: { bbsId: string }) { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/common/features/src/pages/(pst)/image/ui/modify-page.tsx b/apps/common/features/src/pages/(pst)/image/ui/modify-page.tsx index 01fcd3055..d292fea42 100644 --- a/apps/common/features/src/pages/(pst)/image/ui/modify-page.tsx +++ b/apps/common/features/src/pages/(pst)/image/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_USER, bbsId, pstNo], diff --git a/apps/common/features/src/pages/(pst)/movie/ui/create-page.tsx b/apps/common/features/src/pages/(pst)/movie/ui/create-page.tsx index 2103bf6c8..b5e9af8a8 100644 --- a/apps/common/features/src/pages/(pst)/movie/ui/create-page.tsx +++ b/apps/common/features/src/pages/(pst)/movie/ui/create-page.tsx @@ -10,7 +10,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function CreatePage({ bbsId }: { bbsId: string }) { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/common/features/src/pages/(pst)/movie/ui/modify-page.tsx b/apps/common/features/src/pages/(pst)/movie/ui/modify-page.tsx index 90ad811ca..f9fc11f3d 100644 --- a/apps/common/features/src/pages/(pst)/movie/ui/modify-page.tsx +++ b/apps/common/features/src/pages/(pst)/movie/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_USER, bbsId, pstNo], diff --git a/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx b/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx index ce6bc6c8a..df2ab2a70 100644 --- a/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx +++ b/apps/common/features/src/pages/(pst)/normal/ui/create-page.tsx @@ -12,7 +12,7 @@ function CreatePage({ bbsId, pstNo }: { bbsId: string; pstNo?: string }) { const answerRegisterMode = !!pstNo; const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/common/features/src/pages/(pst)/normal/ui/modify-page.tsx b/apps/common/features/src/pages/(pst)/normal/ui/modify-page.tsx index 2c59ecff2..c47b1999c 100644 --- a/apps/common/features/src/pages/(pst)/normal/ui/modify-page.tsx +++ b/apps/common/features/src/pages/(pst)/normal/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_USER, bbsId, pstNo], diff --git a/apps/common/features/src/pages/(pst)/notice/ui/create-page.tsx b/apps/common/features/src/pages/(pst)/notice/ui/create-page.tsx index a0206f449..5033bff60 100644 --- a/apps/common/features/src/pages/(pst)/notice/ui/create-page.tsx +++ b/apps/common/features/src/pages/(pst)/notice/ui/create-page.tsx @@ -10,7 +10,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function CreatePage({ bbsId }: { bbsId: string }) { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx b/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx index 3c1c517dc..7a46a7d6b 100644 --- a/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx +++ b/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_USER, bbsId, pstNo], diff --git a/apps/common/features/src/widgets/post/ui/general-file-uploader.tsx b/apps/common/features/src/widgets/post/ui/general-file-uploader.tsx index 24998ec58..2012201da 100644 --- a/apps/common/features/src/widgets/post/ui/general-file-uploader.tsx +++ b/apps/common/features/src/widgets/post/ui/general-file-uploader.tsx @@ -18,7 +18,7 @@ function GeneralFileUploader({ setDeleteAttachmentIds: (deleteAttachmentIds: string[]) => void; }) { const alert = useAlertStore((state) => state.setMessage); - const { bbsInfo } = useMenuStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); const [attachments, setAttachments] = useState>( {}, diff --git a/apps/common/features/src/widgets/post/ui/post-action.tsx b/apps/common/features/src/widgets/post/ui/post-action.tsx index 0169e313c..4eaa960cb 100644 --- a/apps/common/features/src/widgets/post/ui/post-action.tsx +++ b/apps/common/features/src/widgets/post/ui/post-action.tsx @@ -14,8 +14,8 @@ function PostAction({ children, handleDelete }: PostActionProps) { const router = useRouter(); const pathname = usePathname(); const { confirm } = useConfirm(); - const { bbsInfo } = useMenuStore((state) => state); - const { userInfo } = useUserStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); + const userInfo = useUserStore((state) => state.userInfo); const onDelete = async () => { if (await confirm("삭제하시겠습니까?")) handleDelete(); diff --git a/apps/common/features/src/widgets/post/ui/post-comment.tsx b/apps/common/features/src/widgets/post/ui/post-comment.tsx index 8c08cfc88..df05afb9b 100644 --- a/apps/common/features/src/widgets/post/ui/post-comment.tsx +++ b/apps/common/features/src/widgets/post/ui/post-comment.tsx @@ -19,7 +19,7 @@ function PostComment({ bbsId, pstNo }: { bbsId: number; pstNo: number }) { const { prompt } = usePrompt(); const { confirm } = useConfirm(); const queryClient = useQueryClient(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const [editingCmntNo, setEditingCmntNo] = useState(null); const [editValue, setEditValue] = useState(""); diff --git a/apps/common/features/src/widgets/post/ui/post-form.tsx b/apps/common/features/src/widgets/post/ui/post-form.tsx index 928aef922..ae2a84856 100644 --- a/apps/common/features/src/widgets/post/ui/post-form.tsx +++ b/apps/common/features/src/widgets/post/ui/post-form.tsx @@ -40,8 +40,8 @@ function PostForm({ const router = useRouter(); const { confirm } = useConfirm(); - const { bbsInfo } = useMenuStore((state) => state); - const { userInfo } = useUserStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); + const userInfo = useUserStore((state) => state.userInfo); const [deleteAttachmentIds, setDeleteAttachmentIds] = useState([]); diff --git a/apps/common/features/src/widgets/post/ui/post-page.tsx b/apps/common/features/src/widgets/post/ui/post-page.tsx index c4bf33576..41d8584cf 100644 --- a/apps/common/features/src/widgets/post/ui/post-page.tsx +++ b/apps/common/features/src/widgets/post/ui/post-page.tsx @@ -33,7 +33,7 @@ function PostPage({ bbsId }: { bbsId: string }) { const router = useRouter(); const pathname = usePathname(); const { confirm } = useConfirm(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { bbsInfo, pageMenuAuthority } = useMenuStore((state) => state); const [postParams, setPostParams] = useState({ diff --git a/apps/common/features/src/widgets/post/ui/post.tsx b/apps/common/features/src/widgets/post/ui/post.tsx index e52a65d03..bd8db7c21 100644 --- a/apps/common/features/src/widgets/post/ui/post.tsx +++ b/apps/common/features/src/widgets/post/ui/post.tsx @@ -22,8 +22,8 @@ function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const { prompt } = usePrompt(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); - const { bbsInfo } = useMenuStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); + const bbsInfo = useMenuStore((state) => state.bbsInfo); const [filename, setFilename] = useState(""); diff --git a/apps/common/features/src/widgets/post/ui/with-preview-file-uploader.tsx b/apps/common/features/src/widgets/post/ui/with-preview-file-uploader.tsx index 1621b5227..760a3e7ef 100644 --- a/apps/common/features/src/widgets/post/ui/with-preview-file-uploader.tsx +++ b/apps/common/features/src/widgets/post/ui/with-preview-file-uploader.tsx @@ -17,7 +17,7 @@ function WithPreviewFileUploader({ attachmentData?: Attachment[]; }) { const alert = useAlertStore((state) => state.setMessage); - const { bbsInfo } = useMenuStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); const [thumbnailUrl, setThumbnailUrl] = useState(""); const [progress, setProgress] = useState(0); diff --git a/apps/cs/app/(with-base-layout)/layout.tsx b/apps/cs/app/(with-base-layout)/layout.tsx index 8af048390..3c1a527d7 100644 --- a/apps/cs/app/(with-base-layout)/layout.tsx +++ b/apps/cs/app/(with-base-layout)/layout.tsx @@ -16,7 +16,7 @@ export default function WithBaseLayout({ const pathname = usePathname(); const queryClient = useQueryClient(); - const { setCurrentMenuInfo } = useMenuStore((state) => state); + const setCurrentMenuInfo = useMenuStore((state) => state.setCurrentMenuInfo); const handleMenuClick = (item: MenuItem) => { setCurrentMenuInfo(item); diff --git a/apps/cs/src/pages/(post)/faq/ui/create-page.tsx b/apps/cs/src/pages/(post)/faq/ui/create-page.tsx index 92c70b707..2d436c3c8 100644 --- a/apps/cs/src/pages/(post)/faq/ui/create-page.tsx +++ b/apps/cs/src/pages/(post)/faq/ui/create-page.tsx @@ -10,7 +10,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function CreatePage({ bbsId }: { bbsId: string }) { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/cs/src/pages/(post)/faq/ui/faq-page.tsx b/apps/cs/src/pages/(post)/faq/ui/faq-page.tsx index e3c3ac218..7d739b39f 100644 --- a/apps/cs/src/pages/(post)/faq/ui/faq-page.tsx +++ b/apps/cs/src/pages/(post)/faq/ui/faq-page.tsx @@ -31,7 +31,7 @@ function FaqPage({ bbsId }: { bbsId: string }) { const pathname = usePathname(); const { prompt } = usePrompt(); const alert = useAlertStore((state) => state.setMessage); - const { bbsInfo } = useMenuStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); const [postParams, setPostParams] = useState({ keywordType: "title", diff --git a/apps/cs/src/pages/(post)/faq/ui/modify-page.tsx b/apps/cs/src/pages/(post)/faq/ui/modify-page.tsx index 8849fe89e..c35a94e08 100644 --- a/apps/cs/src/pages/(post)/faq/ui/modify-page.tsx +++ b/apps/cs/src/pages/(post)/faq/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, bbsId, pstNo], diff --git a/apps/cs/src/pages/(post)/image/ui/create-page.tsx b/apps/cs/src/pages/(post)/image/ui/create-page.tsx index 6931a96d0..dc5e4f894 100644 --- a/apps/cs/src/pages/(post)/image/ui/create-page.tsx +++ b/apps/cs/src/pages/(post)/image/ui/create-page.tsx @@ -10,7 +10,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function CreatePage({ bbsId }: { bbsId: string }) { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/cs/src/pages/(post)/image/ui/modify-page.tsx b/apps/cs/src/pages/(post)/image/ui/modify-page.tsx index fc0a83e75..01f5f2ecd 100644 --- a/apps/cs/src/pages/(post)/image/ui/modify-page.tsx +++ b/apps/cs/src/pages/(post)/image/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, bbsId, pstNo], diff --git a/apps/cs/src/pages/(post)/movie/ui/create-page.tsx b/apps/cs/src/pages/(post)/movie/ui/create-page.tsx index 2103bf6c8..b5e9af8a8 100644 --- a/apps/cs/src/pages/(post)/movie/ui/create-page.tsx +++ b/apps/cs/src/pages/(post)/movie/ui/create-page.tsx @@ -10,7 +10,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function CreatePage({ bbsId }: { bbsId: string }) { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/cs/src/pages/(post)/movie/ui/modify-page.tsx b/apps/cs/src/pages/(post)/movie/ui/modify-page.tsx index 63ce54b74..d73d8d9e5 100644 --- a/apps/cs/src/pages/(post)/movie/ui/modify-page.tsx +++ b/apps/cs/src/pages/(post)/movie/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, bbsId, pstNo], diff --git a/apps/cs/src/pages/(post)/normal/ui/create-page.tsx b/apps/cs/src/pages/(post)/normal/ui/create-page.tsx index ce6bc6c8a..df2ab2a70 100644 --- a/apps/cs/src/pages/(post)/normal/ui/create-page.tsx +++ b/apps/cs/src/pages/(post)/normal/ui/create-page.tsx @@ -12,7 +12,7 @@ function CreatePage({ bbsId, pstNo }: { bbsId: string; pstNo?: string }) { const answerRegisterMode = !!pstNo; const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/cs/src/pages/(post)/normal/ui/modify-page.tsx b/apps/cs/src/pages/(post)/normal/ui/modify-page.tsx index f91f86a0b..65d0f2070 100644 --- a/apps/cs/src/pages/(post)/normal/ui/modify-page.tsx +++ b/apps/cs/src/pages/(post)/normal/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, bbsId, pstNo], diff --git a/apps/cs/src/pages/(post)/notice/ui/create-page.tsx b/apps/cs/src/pages/(post)/notice/ui/create-page.tsx index a0206f449..5033bff60 100644 --- a/apps/cs/src/pages/(post)/notice/ui/create-page.tsx +++ b/apps/cs/src/pages/(post)/notice/ui/create-page.tsx @@ -10,7 +10,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function CreatePage({ bbsId }: { bbsId: string }) { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPost } = useMutation({ diff --git a/apps/cs/src/pages/(post)/notice/ui/modify-page.tsx b/apps/cs/src/pages/(post)/notice/ui/modify-page.tsx index aee905999..d18d07070 100644 --- a/apps/cs/src/pages/(post)/notice/ui/modify-page.tsx +++ b/apps/cs/src/pages/(post)/notice/ui/modify-page.tsx @@ -16,7 +16,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib"; function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) { const router = useRouter(); const alert = useAlertStore((state) => state.setMessage); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const { data: postInfo } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, bbsId, pstNo], diff --git a/apps/cs/src/pages/bbs/model/table-columns.tsx b/apps/cs/src/pages/bbs/model/table-columns.tsx index 09933fb7c..27082424d 100644 --- a/apps/cs/src/pages/bbs/model/table-columns.tsx +++ b/apps/cs/src/pages/bbs/model/table-columns.tsx @@ -53,7 +53,7 @@ const ManageButton = ({ row }: { row: Row }) => { const router = useRouter(); const pathname = usePathname(); const [, setBbsInfo] = useLocalStorage("bbs-info", ""); - const { setBbsInfo: setStoreBbsInfo } = useMenuStore((state) => state); + const setStoreBbsInfo = useMenuStore((state) => state.setBbsInfo); const { bbsTypeCd, bbsId } = row.original; return ( diff --git a/apps/cs/src/pages/image/ui/image-form.tsx b/apps/cs/src/pages/image/ui/image-form.tsx index 7018e6919..af0e8f976 100644 --- a/apps/cs/src/pages/image/ui/image-form.tsx +++ b/apps/cs/src/pages/image/ui/image-form.tsx @@ -44,7 +44,9 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) { progress, setFile, } = useTus(); - const { setAttachmentFileCode } = useAttachmentStore((state) => state); + const setAttachmentFileCode = useAttachmentStore( + (state) => state.setAttachmentFileCode, + ); const [imageUrl, setImageUrl] = useState(""); const { data: attachmentData } = useQuery({ diff --git a/apps/cs/src/pages/popup/ui/create-page.tsx b/apps/cs/src/pages/popup/ui/create-page.tsx index 60a447534..668012d6e 100644 --- a/apps/cs/src/pages/popup/ui/create-page.tsx +++ b/apps/cs/src/pages/popup/ui/create-page.tsx @@ -12,7 +12,7 @@ import { PopupForm } from "./popup-form"; function CreatePage() { const router = useRouter(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const { mutateAsync: createPopup } = useMutation({ diff --git a/apps/cs/src/pages/popup/ui/modify-page.tsx b/apps/cs/src/pages/popup/ui/modify-page.tsx index 5ea52795a..9c2b518be 100644 --- a/apps/cs/src/pages/popup/ui/modify-page.tsx +++ b/apps/cs/src/pages/popup/ui/modify-page.tsx @@ -28,7 +28,7 @@ function ModifyPage({ popupSn }: { popupSn: number }) { const router = useRouter(); const queryClient = useQueryClient(); const { confirm } = useConfirm(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const [rowSelection, setRowSelection] = useState({}); diff --git a/apps/cs/src/shared/ui/page-layout.tsx b/apps/cs/src/shared/ui/page-layout.tsx index 17100389a..358d3b5db 100644 --- a/apps/cs/src/shared/ui/page-layout.tsx +++ b/apps/cs/src/shared/ui/page-layout.tsx @@ -2,7 +2,7 @@ import { PageTitle } from "@common/components"; import { useMenuStore } from "../lib/use-menu-store"; function PageLayout({ children }: { children: React.ReactNode }) { - const { currentMenuInfo } = useMenuStore((state) => state); + const currentMenuInfo = useMenuStore((state) => state.currentMenuInfo); const menuPaths = currentMenuInfo?.menuPath ?.split(">") diff --git a/apps/cs/src/widgets/post/ui/general-file-uploader.tsx b/apps/cs/src/widgets/post/ui/general-file-uploader.tsx index 24998ec58..2012201da 100644 --- a/apps/cs/src/widgets/post/ui/general-file-uploader.tsx +++ b/apps/cs/src/widgets/post/ui/general-file-uploader.tsx @@ -18,7 +18,7 @@ function GeneralFileUploader({ setDeleteAttachmentIds: (deleteAttachmentIds: string[]) => void; }) { const alert = useAlertStore((state) => state.setMessage); - const { bbsInfo } = useMenuStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); const [attachments, setAttachments] = useState>( {}, diff --git a/apps/cs/src/widgets/post/ui/post-action.tsx b/apps/cs/src/widgets/post/ui/post-action.tsx index acaa60bf5..006eaec50 100644 --- a/apps/cs/src/widgets/post/ui/post-action.tsx +++ b/apps/cs/src/widgets/post/ui/post-action.tsx @@ -13,8 +13,8 @@ function PostAction({ children, handleDelete }: PostActionProps) { const router = useRouter(); const pathname = usePathname(); const { prompt } = usePrompt(); - const { bbsInfo } = useMenuStore((state) => state); - const { userInfo } = useUserStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); + const userInfo = useUserStore((state) => state.userInfo); const onDelete = async () => { const { resolved, value } = await prompt("삭제 사유를 입력해주세요."); diff --git a/apps/cs/src/widgets/post/ui/post-comment.tsx b/apps/cs/src/widgets/post/ui/post-comment.tsx index 8c08cfc88..df05afb9b 100644 --- a/apps/cs/src/widgets/post/ui/post-comment.tsx +++ b/apps/cs/src/widgets/post/ui/post-comment.tsx @@ -19,7 +19,7 @@ function PostComment({ bbsId, pstNo }: { bbsId: number; pstNo: number }) { const { prompt } = usePrompt(); const { confirm } = useConfirm(); const queryClient = useQueryClient(); - const { userInfo } = useUserStore((state) => state); + const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); const [editingCmntNo, setEditingCmntNo] = useState(null); const [editValue, setEditValue] = useState(""); diff --git a/apps/cs/src/widgets/post/ui/post-form.tsx b/apps/cs/src/widgets/post/ui/post-form.tsx index cf3c14aab..dc38f327d 100644 --- a/apps/cs/src/widgets/post/ui/post-form.tsx +++ b/apps/cs/src/widgets/post/ui/post-form.tsx @@ -40,8 +40,8 @@ function PostForm({ const router = useRouter(); const { confirm } = useConfirm(); - const { bbsInfo } = useMenuStore((state) => state); - const { userInfo } = useUserStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); + const userInfo = useUserStore((state) => state.userInfo); const [deleteAttachmentIds, setDeleteAttachmentIds] = useState([]); diff --git a/apps/cs/src/widgets/post/ui/with-preview-file-uploader.tsx b/apps/cs/src/widgets/post/ui/with-preview-file-uploader.tsx index 1621b5227..760a3e7ef 100644 --- a/apps/cs/src/widgets/post/ui/with-preview-file-uploader.tsx +++ b/apps/cs/src/widgets/post/ui/with-preview-file-uploader.tsx @@ -17,7 +17,7 @@ function WithPreviewFileUploader({ attachmentData?: Attachment[]; }) { const alert = useAlertStore((state) => state.setMessage); - const { bbsInfo } = useMenuStore((state) => state); + const bbsInfo = useMenuStore((state) => state.bbsInfo); const [thumbnailUrl, setThumbnailUrl] = useState(""); const [progress, setProgress] = useState(0);