Skip to content

Commit

Permalink
feat: 등록을 위한 state 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjeonghyun committed Jul 10, 2024
1 parent 37d4682 commit 612d1f1
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/recoil/atoms/state.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
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({
key: 'EVENT_ID',
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,
});

0 comments on commit 612d1f1

Please sign in to comment.