From 59a406eef5ce2701b9bf428e0966b47d51e6a546 Mon Sep 17 00:00:00 2001 From: joyeongchan Date: Sun, 23 Aug 2026 21:30:42 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=EC=B4=88=EB=8C=80=20=EC=8B=9C?= =?UTF-8?q?=ED=8A=B8=EC=97=90=20=EC=B4=88=EB=8C=80=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 링크 공유만 가능해 코드로 참여하려는 친구에게 코드를 알려줄 방법이 없었다. 시안대로 초대 코드 카드와 복사 버튼을 추가한다. - 초대 코드 카드 + 복사 (share.ts 의 copyToClipboard 재사용) - "담기 기한" · "초대 코드" 라벨 추가 - 카드 테두리·타이포·안내 문구를 시안 값으로 조정 --- .../invite-friends/InviteFriendsDialog.tsx | 105 ++++++++++++------ .../participant-panel/ParticipantPanel.tsx | 1 + apps/web/src/utils/share.ts | 2 +- 3 files changed, 73 insertions(+), 35 deletions(-) diff --git a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx index fcd3302a..41d83f9e 100644 --- a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx +++ b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx @@ -10,10 +10,10 @@ import { Drawer, DrawerContent, DrawerDescription, DrawerTitle } from '@/compone import { ANALYTICS_EVENT } from '@/consts/analytics'; import { logAnalyticsEvent } from '@/utils/analytics'; import { parseServerLocalDateTime } from '@/utils/formatDate'; -import { share } from '@/utils/share'; +import { markInviteSent } from '@/utils/inviteSentSession'; +import { copyToClipboard, share } from '@/utils/share'; import { usePatchInviteExpiry } from '../../_hooks/usePatchInviteExpiry'; -import { markInviteSent } from '@/utils/inviteSentSession'; import InviteExpiresPicker from './InviteExpiresPicker'; type InviteFriendsDialogProps = { @@ -22,6 +22,8 @@ type InviteFriendsDialogProps = { /** 마감 시각 변경 API 호출용 */ tournamentId: number; inviteUrl?: string; + /** 초대 코드 — 링크 대신 코드로 참여할 때 쓴다 */ + inviteCode?: string; /** ISO 8601 — 초대 코드 만료 시각 */ inviteExpiresAt?: string; }; @@ -68,6 +70,7 @@ function InviteFriendsDialog({ onOpenChange, tournamentId, inviteUrl, + inviteCode, inviteExpiresAt, }: InviteFriendsDialogProps) { const [isPickerOpen, setIsPickerOpen] = useState(false); @@ -91,6 +94,17 @@ function InviteFriendsDialog({ const handleOpenPicker = () => setIsPickerOpen(true); + const handleCopyInviteCode = async () => { + if (!inviteCode) return; + + try { + await copyToClipboard(inviteCode); + toast.success('초대 코드를 복사했어요.'); + } catch { + toast.warning('이 환경에서는 복사를 지원하지 않아요.'); + } + }; + const handleConfirmExpires = (newExpiresAt: string) => { patchInviteExpiryMutation( { newExpiresAt }, @@ -141,41 +155,64 @@ function InviteFriendsDialog({ - {expiresInfo && ( -
-
-
- +
+ {expiresInfo && ( +
+

담기 기한

+
+
+
+ +
+
+

+ {expiresInfo.remainingLabel} +

+

+ {expiresInfo.absoluteLabel} +

+
+
+
-
-

{expiresInfo.remainingLabel}

-

- {expiresInfo.absoluteLabel} -

+
+ )} + + {inviteCode && ( +
+

초대 코드

+
+

{inviteCode}

+
- -
- )} - -
-
- -

- 최대 7명까지 초대할 수 있어요. -

-
-
- -

- 설정한 기한이 지나면 후보를 담을 수 없어요. -

+ )} + +
+
+ +

+ 최대 7명까지 초대할 수 있어요. +

+
+
+ +

+ 설정한 기한이 지나면 후보를 담을 수 없어요. +

+
diff --git a/apps/web/src/app/tournament/[id]/create/_components/participant-panel/ParticipantPanel.tsx b/apps/web/src/app/tournament/[id]/create/_components/participant-panel/ParticipantPanel.tsx index 7f131884..9a26276d 100644 --- a/apps/web/src/app/tournament/[id]/create/_components/participant-panel/ParticipantPanel.tsx +++ b/apps/web/src/app/tournament/[id]/create/_components/participant-panel/ParticipantPanel.tsx @@ -158,6 +158,7 @@ function ParticipantPanel({ onOpenChange={setIsInviteDialogOpen} tournamentId={Number(tournamentId)} inviteUrl={inviteUrl} + inviteCode={inviteCode} inviteExpiresAt={inviteExpiresAt} /> diff --git a/apps/web/src/utils/share.ts b/apps/web/src/utils/share.ts index 451fb222..32c27f49 100644 --- a/apps/web/src/utils/share.ts +++ b/apps/web/src/utils/share.ts @@ -11,7 +11,7 @@ const canUseWebShare = (data: ShareDataT) => { return true; }; -const copyToClipboard = async (text: string) => { +export const copyToClipboard = async (text: string) => { if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) { await navigator.clipboard.writeText(text); return; From 37585e7a9a7a0fb097aea502de83c3a937c154dd Mon Sep 17 00:00:00 2001 From: joyeongchan Date: Sun, 23 Aug 2026 21:35:32 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=EC=95=88=EB=82=B4=20=EB=AC=B8?= =?UTF-8?q?=EA=B5=AC=20=EC=B2=B4=ED=81=AC=20=EC=95=84=EC=9D=B4=EC=BD=98=20?= =?UTF-8?q?=EC=83=89=EC=9D=84=20=EC=8B=9C=EC=95=88=EA=B0=92(#adb1bb)?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create/_components/invite-friends/InviteFriendsDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx index 41d83f9e..1c1f9c30 100644 --- a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx +++ b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx @@ -202,13 +202,13 @@ function InviteFriendsDialog({
- +

최대 7명까지 초대할 수 있어요.

- +

설정한 기한이 지나면 후보를 담을 수 없어요.

From 3f544a7efb8cf3b986199a99c35d79199ca99685 Mon Sep 17 00:00:00 2001 From: joyeongchan Date: Sun, 23 Aug 2026 21:40:32 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=EB=8B=B4=EA=B8=B0=20=EA=B8=B0?= =?UTF-8?q?=ED=95=9C=20=EC=95=84=EC=9D=B4=EC=BD=98=EC=9D=84=20=EC=8B=9C?= =?UTF-8?q?=EC=95=88=EB=8C=80=EB=A1=9C=20fill=20=ED=83=80=EC=9D=B4?= =?UTF-8?q?=EB=A8=B8=EB=A1=9C=20=EA=B5=90=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create/_components/invite-friends/InviteFriendsDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx index 1c1f9c30..7eb3d06f 100644 --- a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx +++ b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx @@ -4,7 +4,7 @@ import { ERROR_CODE, ERROR_MESSAGE_MAP } from '@piki/core'; import { useEffect, useMemo, useState } from 'react'; import { toast } from 'sonner'; -import { CheckIconFill, StopwatchIconFill } from '@/assets/icons/fill'; +import { CheckIconFill, TimerIconFill } from '@/assets/icons/fill'; import Button from '@/components/button'; import { Drawer, DrawerContent, DrawerDescription, DrawerTitle } from '@/components/drawer'; import { ANALYTICS_EVENT } from '@/consts/analytics'; @@ -162,7 +162,7 @@ function InviteFriendsDialog({
- +

From 3334a471547c376453c8e781fb78a71a02b8576b Mon Sep 17 00:00:00 2001 From: joyeongchan Date: Sun, 23 Aug 2026 21:44:58 +0900 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=EC=B4=88=EB=8C=80=20=EC=8B=9C?= =?UTF-8?q?=ED=8A=B8=20=EC=A0=9C=EB=AA=A9=C2=B7=EC=84=A4=EB=AA=85=20?= =?UTF-8?q?=ED=83=80=EC=9D=B4=ED=8F=AC=EB=A5=BC=20=EC=8B=9C=EC=95=88?= =?UTF-8?q?=EA=B0=92=EC=9C=BC=EB=A1=9C=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create/_components/invite-friends/InviteFriendsDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx index 7eb3d06f..b3fc1b6c 100644 --- a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx +++ b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx @@ -147,10 +147,10 @@ function InviteFriendsDialog({

- + 친구 초대하기 - + 초대 링크를 보내 친구와 함께 담을 수 있어요.
From 495d343c95e4a9a63b0bb664a425bf9aaa025595 Mon Sep 17 00:00:00 2001 From: joyeongchan Date: Sun, 23 Aug 2026 21:46:30 +0900 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=EC=B4=88=EB=8C=80=20=EC=8B=9C?= =?UTF-8?q?=ED=8A=B8=20=EC=84=A4=EB=AA=85=20=EB=AC=B8=EA=B5=AC=EB=A5=BC=20?= =?UTF-8?q?=EC=8B=9C=EC=95=88=EB=8C=80=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create/_components/invite-friends/InviteFriendsDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx index b3fc1b6c..050d7da0 100644 --- a/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx +++ b/apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx @@ -151,7 +151,7 @@ function InviteFriendsDialog({ 친구 초대하기 - 초대 링크를 보내 친구와 함께 담을 수 있어요. + 링크를 보내 친구와 함께 담을 수 있어요.