v3: added user profile description

This commit is contained in:
khannurien
2026-03-22 21:07:17 +00:00
parent c5051e3485
commit d94a319d96
10 changed files with 227 additions and 26 deletions

View File

@@ -69,8 +69,8 @@ function CommentNode({
const children = tree.get(comment.id) ?? [];
async function handleReply(e: React.FormEvent) {
e.preventDefault();
async function handleReply(e?: React.FormEvent) {
e?.preventDefault();
if (!replyBody.trim() || !token) return;
setSubmitting(true);
setReplyError(null);
@@ -109,8 +109,8 @@ function CommentNode({
}
}
async function handleEditSave(e: React.FormEvent) {
e.preventDefault();
async function handleEditSave(e?: React.FormEvent) {
e?.preventDefault();
if (!editBody.trim() || !token) return;
setEditSubmitting(true);
setEditError(null);
@@ -226,11 +226,7 @@ function CommentNode({
className="comment-reply-textarea"
value={editBody}
onChange={setEditBody}
onKeyDown={(e) => {
if (
e.key === "Enter" && (e.ctrlKey || e.metaKey)
) handleEditSave(e);
}}
onSubmit={handleEditSave}
autoResize
rows={1}
/>
@@ -314,11 +310,7 @@ function CommentNode({
className="comment-reply-textarea"
value={replyBody}
onChange={setReplyBody}
onKeyDown={(e) => {
if (
e.key === "Enter" && (e.ctrlKey || e.metaKey)
) handleReply(e);
}}
onSubmit={handleReply}
placeholder="Write a reply…"
autoResize
rows={1}
@@ -391,8 +383,8 @@ export function CommentThread({
const tree = buildTree(comments);
const roots = tree.get("root") ?? [];
async function handleTopLevelSubmit(e: React.FormEvent) {
e.preventDefault();
async function handleTopLevelSubmit(e?: React.FormEvent) {
e?.preventDefault();
if (!topLevelBody.trim() || !token) return;
setSubmitting(true);
setTopLevelError(null);
@@ -444,11 +436,7 @@ export function CommentThread({
className="comment-reply-textarea"
value={topLevelBody}
onChange={setTopLevelBody}
onKeyDown={(e) => {
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
handleTopLevelSubmit(e);
}
}}
onSubmit={handleTopLevelSubmit}
placeholder="Add a comment…"
autoResize
rows={1}