From 612d1f15f91f6f7ec59905ee8031ef37c59bf863 Mon Sep 17 00:00:00 2001 From: Jeonghyun Date: Wed, 10 Jul 2024 15:46:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=93=B1=EB=A1=9D=EC=9D=84=20=EC=9C=84?= =?UTF-8?q?=ED=95=9C=20state=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recoil/atoms/state.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/recoil/atoms/state.js b/src/recoil/atoms/state.js index e4107bc..82828a4 100644 --- a/src/recoil/atoms/state.js +++ b/src/recoil/atoms/state.js @@ -1,9 +1,9 @@ import { recoilPersist } from 'recoil-persist'; -import { atom, useRecoilState } from 'recoil'; +import { atom } from 'recoil'; const { persistAtom } = recoilPersist({ key: 'persistEventID', - storage: localStorage, + storage: sessionStorage, }); export const eventIDState = atom({ @@ -11,3 +11,27 @@ export const eventIDState = atom({ default: 0, effects_UNSTABLE: [persistAtom], }); + +export const { persistEvent } = recoilPersist({ + key: 'persistRegister', + storage: sessionStorage, +}); + +export const RegisterState = atom({ + key: 'RegisterInfo', + default: { + eventType: '', + eventTitle: '', + eventDetail: '', + eventImage: '', + attendanceListFile: '', + minCompletionTimes: '', + eventSchedules: [{ eventDate: '', eventStartTime: '', eventEndTime: '' }], + }, + effects_UNSTABLE: [persistEvent], +}); + +export const RegisterStep = atom({ + key: 'RegisterStep', + default: 1, +});