댓글 닉네임 새로고침 버튼 추가

This commit is contained in:
JinwooKim committed 2026-06-17 15:38:20 +09:00
1 parent b62bedc665
commit bac505fa99
3 files changed
+36 -1

No files matched your search

+20 -1
View File
@@ -5,6 +5,7 @@ import {
listComments,
postComment,
getSessionNickname,
rerollSessionNickname,
getDeviceId,
ApiError,
} from "@/lib/api";
@@ -81,6 +82,15 @@ export default function Comments({
}
}
async function reroll() {
try {
const n = await rerollSessionNickname(matchId);
setNickname(n);
} catch {
/* 무시 */
}
}
async function submit() {
const text = body.trim();
if (posting || !text) return;
@@ -118,9 +128,18 @@ export default function Comments({
{/* 입력 */}
<div className="mt-3 space-y-2">
{nickname && (
<p className="text-[12px] font-bold text-white/45">
<p className="flex items-center gap-1.5 text-[12px] font-bold text-white/45">
⚽ {t.commentAs}{" "}
<span className="text-[var(--green)]">{nickname}</span>
<button
type="button"
onClick={reroll}
title={t.commentReroll}
aria-label={t.commentReroll}
className="grid h-5 w-5 place-items-center rounded-full text-[13px] leading-none text-white/45 transition hover:text-white active:rotate-180"
>
↻
</button>
</p>
)}
<div className="flex items-end gap-2">