From 14d9c60bfc5695c1c47cae4fc97d349ee3fe0bdb Mon Sep 17 00:00:00 2001 From: ktmihs Date: Mon, 5 Dec 2022 15:52:48 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20#85=20#66=20sidebar=20tab=20=EB=B0=8F?= =?UTF-8?q?=20chatting=20atom=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 다른 컴포넌트에서도 접근할 수 있도록 전역 변수로 관리 --- frontend/src/store/atom/chatting.ts | 8 ++++++++ frontend/src/store/atom/sidebar.ts | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 frontend/src/store/atom/chatting.ts create mode 100644 frontend/src/store/atom/sidebar.ts diff --git a/frontend/src/store/atom/chatting.ts b/frontend/src/store/atom/chatting.ts new file mode 100644 index 0000000..02c7937 --- /dev/null +++ b/frontend/src/store/atom/chatting.ts @@ -0,0 +1,8 @@ +import { atom } from 'recoil'; +import { v1 } from 'uuid'; + +export const chattingState = atom({ + key: `chattingState/${v1()}`, + + default: '', +}); diff --git a/frontend/src/store/atom/sidebar.ts b/frontend/src/store/atom/sidebar.ts new file mode 100644 index 0000000..4684ac5 --- /dev/null +++ b/frontend/src/store/atom/sidebar.ts @@ -0,0 +1,8 @@ +import { atom } from 'recoil'; +import { v1 } from 'uuid'; + +export const sidebarState = atom({ + key: `sidebarState/${v1()}`, + + default: 'friends', +});