-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: useSuspenseQuery 적용 및 훅 리팩터링 #326
Merged
The head ref may contain hidden characters: "refactor/325-usesuspensequery_\uD6C5_\uB9AC\uD329\uD130\uB9C1"
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f924b2c
chore: 확장자 tsx -> ts로 변경
bassyu a6c3f90
chore: Spinner 삭제
bassyu 8e6afec
chore: useReminderHooks, useCalendar 사용처로 폴더 이동
bassyu 73dd26c
build: react-query를 5.0.0-beta로 업데이트
bassyu c8a1ded
refactor: useSuspenseQuery 마이그레이션
bassyu c61f37c
chore: 사용하지 않는 import 삭제
bassyu 2572b5e
chore: useDictionaryPlantDetail 네이밍 변경 적용
bassyu 17840da
chore: type import 추가
bassyu babd691
refactor: 재사용되는 Skeleton 컴포넌트 추출
bassyu a18a1ff
fix: Spinner 대신 Loading 페이지로 변경
bassyu 9178bb4
refactor: query 커스텀 훅 변경내용 적용
bassyu 51afb42
chore: useCheckSessionId 사용 안함
bassyu e783b2f
build: package.json @tanstack/react-query: 5.0.0-beta.20 적용
bassyu bfd869c
chore: 절대경로로 변경
bassyu 9ef1b95
chore: hooks 폴더 안으로 이동
bassyu 63242ff
style: 변수 구조분해 할당
bassyu 793f0b1
chore: 수정 함수를 그대로 사용
bassyu 2be5192
refactor: refetch 대신 invalidateQueries 사용
bassyu cc9b034
fix: history 모의 API 에도 세션 검층 추가
bassyu ec196cf
Merge branch 'develop' into refactor/325-usesuspensequery_훅_리팩터링
bassyu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
File renamed without changes.
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
23 changes: 0 additions & 23 deletions
23
frontend/src/components/@common/Spinner/Spinner.stories.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { | ||
DayArea, | ||
DayHeader, | ||
SkeletonItem, | ||
SkeletonItemContent, | ||
TimelineArea, | ||
YearHeader, | ||
} from './Timeline.style'; | ||
|
||
interface SkeletonProps { | ||
hasYearHeader?: boolean; | ||
} | ||
|
||
const Skeleton = ({ hasYearHeader }: SkeletonProps) => ( | ||
<> | ||
{hasYearHeader && <YearHeader />} | ||
{Array(10) | ||
.fill(null) | ||
.map((_, index) => ( | ||
<DayArea key={index}> | ||
<DayHeader /> | ||
<TimelineArea> | ||
<SkeletonItem> | ||
<SkeletonItemContent /> | ||
</SkeletonItem> | ||
</TimelineArea> | ||
</DayArea> | ||
))} | ||
</> | ||
); | ||
|
||
export default Skeleton; |
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,19 +1,15 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { useSuspenseQuery } from '@tanstack/react-query'; | ||
import AuthAPI from 'apis/auth'; | ||
import throwOnInvalidStatus from 'utils/throwOnInvalidStatus'; | ||
|
||
const useLogin = (code: string) => { | ||
return useQuery<null, Error, void>({ | ||
const useLogin = (code: string) => | ||
useSuspenseQuery<null, Error, void>({ | ||
queryKey: ['getSession', code], | ||
queryFn: async () => { | ||
const response = await AuthAPI.getSessionId(code); | ||
|
||
throwOnInvalidStatus(response); | ||
|
||
return null; | ||
}, | ||
suspense: true, | ||
}); | ||
}; | ||
|
||
export default useLogin; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍