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, +});