-
Notifications
You must be signed in to change notification settings - Fork 1
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
[#505] [모임 상세] 모임 삭제 기능 구현 #537
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,19 @@ | ||
import Button from '@/v1/base/Button'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
|
||
export default function NotFound() { | ||
return ( | ||
<div className="absolute left-0 top-0 flex h-full w-full flex-col items-center justify-center gap-[2rem]"> | ||
<Image src="/images/loading.gif" width={230} height={160} alt="loading" /> | ||
<p className="text-2xl"> | ||
<span className="font-bold text-main-900">다독이</span>가 길을 잃었어요. | ||
</p> | ||
<Link href="/group"> | ||
<Button size="large" colorScheme="main" fill={false}> | ||
모임 둘러보기 | ||
</Button> | ||
</Link> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
|
@@ -13,7 +13,8 @@ const ReactQueryProvider: NextPage<PropTypes> = ({ children }) => { | |
new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: 0, | ||
refetchOnWindowFocus: false, | ||
retry: false, | ||
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 원하지 않는 시점에 refetch가 되는 불편함이 있어 false로 변경했어요. |
||
}, | ||
}, | ||
}) | ||
|
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,14 @@ | ||
import { useMutation } from '@tanstack/react-query'; | ||
|
||
import type { APIGroup } from '@/types/group'; | ||
|
||
import groupAPI from '@/apis/group'; | ||
|
||
const useDeleteBookGroupMutation = () => { | ||
return useMutation({ | ||
mutationFn: (bookGroupId: APIGroup['bookGroupId']) => | ||
groupAPI.deleteGroup({ bookGroupId }).then(({ data }) => data), | ||
}); | ||
}; | ||
|
||
export default useDeleteBookGroupMutation; |
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 |
---|---|---|
|
@@ -60,7 +60,7 @@ const getSchemeClasses = (theme: ColorScheme, isFill: boolean) => { | |
}; | ||
|
||
const BASE_BUTTON_CLASSES = | ||
'cursor-pointer border-[0.1rem] leading-none inline-block font-bold'; | ||
'cursor-pointer border-[0.1rem] leading-none inline-block font-bold focus:outline-none focus:ring-2'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 모달을 띄우면 button에 focus가 발생해요. focus 시 outline style을 수정했어요. |
||
|
||
const Button = ({ | ||
size = 'medium', | ||
|
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.
comment;
존재하지 않는 모임 페이지인 경우, 서버에서 404 에러를 응답으로 보내기 때문에 런타임 오류가 발생해요. 모임 상세 페이지 최상단에서 error를 캐치해서 notFound 페이지를 렌더링하도록 구현했어요.
/app/group/[groupId]/error.tsx
파일에 작성하려고 했는데, next에서는 NotFoundBoundary가 ErrorBoundary보다 하위에 위치하고 있어 상위의 NotFound 페이지를 렌더링하는 문제가 있었어요. 그래서 직접 ErrorBoundary를 컴포넌트에 감싸도록 구현했어요.