-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from ssumai-kr/Feature-박수민
Refector: 메인화면 카드 스타일 수정 및 메인화면 상태관리 수정
- Loading branch information
Showing
4 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
import { ActivityDetail } from '@/components/Lander/BestActivities.type'; | ||
import { mainPageStateProps, mainPageKategorieStateProps, mainSearchValueStateProps } from '@/components/Lander/Main.type'; | ||
import { | ||
mainPageStateProps, | ||
mainPageKategorieStateProps, | ||
mainSearchValueStateProps, | ||
} from '@/components/Lander/Main.type'; | ||
import { atom } from 'recoil'; | ||
import { recoilPersist } from 'recoil-persist'; | ||
|
||
const { persistAtom } = recoilPersist(); | ||
const storage = typeof window !== 'undefined' ? sessionStorage : undefined; | ||
|
||
const { persistAtom } = recoilPersist({ | ||
key: 'sessionStorage', // 고유한 key 값 | ||
storage: storage, | ||
}); | ||
|
||
export const mainPageState = atom<mainPageStateProps>({ | ||
key: 'mainPageState', | ||
default : { | ||
default: { | ||
currentPage: 1, | ||
itemsPerPage: 8, | ||
selectedKategorie: '', | ||
selectedSorted: '', | ||
sortedName: '', | ||
}, | ||
effects_UNSTABLE: [persistAtom], | ||
}) | ||
|
||
}); | ||
|
||
export const mainPageKategorieState = atom<mainPageKategorieStateProps>({ | ||
key: 'mainPageKategorieState', | ||
default: { | ||
KategorieName: '', | ||
}, | ||
effects_UNSTABLE: [persistAtom], | ||
}) | ||
}); | ||
|
||
export const mainSearchValueState = atom<mainSearchValueStateProps>({ | ||
key: 'mainSearchValueState', | ||
default: { | ||
SearchValue: '', | ||
currentPage: 1, | ||
itemsPerPage: 16, | ||
} | ||
}) | ||
}, | ||
}); |