From e26d01c1ba158eb5e8413428a3cb9ac2cf82c0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9A=B0=EC=84=B1?= Date: Thu, 8 Feb 2024 00:39:35 +0900 Subject: [PATCH] =?UTF-8?q?[FE]=20Feat=20#133:=20=EB=8C=93=EA=B8=80=20text?= =?UTF-8?q?=EC=97=90=20=ED=95=B4=EB=8B=B9=ED=95=98=EB=8A=94=20=EC=A0=84?= =?UTF-8?q?=EC=97=AD=20state=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idd1f8130288230a570eb1afc86b75db97e3f5673 --- frontend/src/store/detailStore.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 frontend/src/store/detailStore.tsx diff --git a/frontend/src/store/detailStore.tsx b/frontend/src/store/detailStore.tsx new file mode 100644 index 00000000..6913fe7a --- /dev/null +++ b/frontend/src/store/detailStore.tsx @@ -0,0 +1,16 @@ +import { create } from 'zustand' +import { devtools } from 'zustand/middleware' + +interface ICommentStore { + commentText: string + setCommentText: (commentText: string) => void + resetCommentText: () => void +} + +export const useCommentStore = create()( + devtools((set) => ({ + commentText: '', + setCommentText: (commentText: string) => set(() => ({ commentText: commentText })), + resetCommentText: () => set(() => ({ commentText: '' })), + })) +)