-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: invite 진입 분기 로직을 클라이언트에서 RSC로 이관 #412
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fa933ec
refactor: invite 진입 분기를 클라이언트에서 RSC redirect 로 이관
ychany 0885d19
refactor: 회원 자동 join 을 invite 에서 join 페이지로 이관
ychany 46fe06b
fix: 리다이렉트 code 인코딩 및 자동 참여 실패 시 재시도 UI 추가
ychany 2f429fd
style: prettier 포맷 적용
ychany 576ba71
refactor: getInvitePreviewByCode 를 src/apis 로 이동
ychany a993167
fix: 회원 자동 참여 409 시 무한 스피너 갇힘 해소
ychany 2a0181e
Merge branch 'dev' into refactor/390-invite-rsc
ychany 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
16 changes: 13 additions & 3 deletions
16
...ment/join/_apis/getInvitePreviewByCode.ts → apps/web/src/apis/getInvitePreviewByCode.ts
This file contains hidden or 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 hidden or 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
153 changes: 0 additions & 153 deletions
153
apps/web/src/app/invite/[id]/_components/InviteClient.tsx
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
apps/web/src/app/invite/[id]/_components/InviteInvalid.tsx
This file contains hidden or 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,47 @@ | ||
| 'use client'; | ||
|
|
||
| import Link from 'next/link'; | ||
| import { useState } from 'react'; | ||
|
|
||
| import Button from '@/components/button'; | ||
| import TournamentErrorDialog from '@/components/tournament-error-dialog'; | ||
| import { ROUTES } from '@/consts/route'; | ||
|
|
||
| type InviteInvalidProps = { | ||
| /** 초대 만료(409) 로 진입한 경우 만료 다이얼로그를 함께 노출 */ | ||
| showExpiredDialog?: boolean; | ||
| }; | ||
|
|
||
| function InviteInvalid({ showExpiredDialog = false }: InviteInvalidProps) { | ||
| const [isTournamentErrorDialogOpen, setIsTournamentErrorDialogOpen] = useState(showExpiredDialog); | ||
|
|
||
| return ( | ||
| <> | ||
| <main className="flex min-h-dvh flex-col items-center justify-center gap-6 bg-bg-layer-basement px-5 pt-padding-top"> | ||
| <div className="flex flex-col items-center gap-2"> | ||
| <p className="heading-1-bold text-text-neutral-primary">초대 링크가 유효하지 않아요</p> | ||
| <p className="text-center body-1-medium text-text-neutral-tertiary"> | ||
| 만료됐거나 잘못된 링크일 수 있어요. | ||
| <br /> | ||
| 친구에게 새 링크를 요청해주세요. | ||
| </p> | ||
| </div> | ||
|
|
||
| <Link href={ROUTES.HOME} className="w-full max-w-80"> | ||
| <Button size="lg" variant="primary" className="w-full"> | ||
| 홈으로 가기 | ||
| </Button> | ||
| </Link> | ||
| </main> | ||
|
|
||
| {/** TODO: 409는 초대 코드 만료, 이미 참여 중, 이미 시작된 토너먼트 등 여러 경우가 있음 따라서 타입을 동적으로 설정할 수 있어야 하나, 서버에서 에러코드를 내려주지 않기 때문에 일단 단일 타입으로 처리*/} | ||
| <TournamentErrorDialog | ||
| type="LINK_EXPIRED" | ||
| open={isTournamentErrorDialogOpen} | ||
| onOpenChange={setIsTournamentErrorDialogOpen} | ||
| /> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default InviteInvalid; |
This file contains hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.