Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ function TournamentCreateClient({ tournamentId }: TournamentCreateClientProps) {
participants={participants}
inviteCode={pending?.inviteCode ?? ''}
inviteExpiresAt={pending?.inviteExpiresAt ?? ''}
ownerStarted={ownerStarted}
{...(isCollaborative && !ownerStarted && !isDepositClosed && { depositDeadline })}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type ParticipantPanelProps = {
inviteExpiresAt?: string;
/** 담기 마감 시각 — 있을 때만 타이머 노출 */
depositDeadline?: string;
/** 주최자가 토너먼트를 시작했는지 — 시작 후에는 새 참여자를 받을 수 없다 */
ownerStarted?: boolean;
};

const PLACEHOLDER_AVATAR_COUNT = 2;
Expand All @@ -43,6 +45,7 @@ function ParticipantPanel({
inviteCode,
inviteExpiresAt,
depositDeadline,
ownerStarted = false,
}: ParticipantPanelProps) {
const { id: tournamentId } = useParams<{ id: string }>();
const { refetchTournament } = useGetTournament(Number(tournamentId));
Expand Down Expand Up @@ -104,14 +107,17 @@ function ParticipantPanel({
{participants.map(({ user, itemCount }) => (
<ParticipantChip key={user.id} user={user} itemCount={itemCount} />
))}
<button
type="button"
onClick={handleOpenInvite}
className="inline-flex size-9 cursor-pointer items-center justify-center rounded-full border border-border-neutral-muted bg-bg-layer-default"
aria-label="친구 초대하기"
>
<AddIconOutline className="size-4 text-icon-neutral-primary" />
</button>
{/* 시작 후에는 새 참여자를 받을 수 없어 초대 진입점을 숨긴다 */}
{!ownerStarted && (
<button
type="button"
onClick={handleOpenInvite}
className="inline-flex size-9 cursor-pointer items-center justify-center rounded-full border border-border-neutral-muted bg-bg-layer-default"
aria-label="친구 초대하기"
>
<AddIconOutline className="size-4 text-icon-neutral-primary" />
</button>
)}
</div>
</div>
)}
Expand Down Expand Up @@ -144,8 +150,9 @@ function ParticipantPanel({
</button>
)}

{/* 시트를 열어둔 사이 주최자가 시작하면 초대가 무의미해지므로 함께 닫는다 */}
<InviteFriendsDialog
open={isInviteDialogOpen}
open={isInviteDialogOpen && !ownerStarted}
onOpenChange={setIsInviteDialogOpen}
tournamentId={Number(tournamentId)}
inviteUrl={inviteUrl}
Expand Down
Loading