fix(ui): show comment editor above the comment list (#5662)
This commit is contained in:
parent
f7ac6a0191
commit
6b0736b293
1 changed files with 12 additions and 12 deletions
|
|
@ -99,6 +99,18 @@ const MemoDetail = () => {
|
||||||
{t("memo.comment.self")}
|
{t("memo.comment.self")}
|
||||||
</h2>
|
</h2>
|
||||||
<div className="relative mx-auto grow w-full min-h-full flex flex-col justify-start items-start gap-y-1">
|
<div className="relative mx-auto grow w-full min-h-full flex flex-col justify-start items-start gap-y-1">
|
||||||
|
{showCommentEditor && (
|
||||||
|
<div className="w-full mb-2">
|
||||||
|
<MemoEditor
|
||||||
|
cacheKey={`${memo.name}-${memo.updateTime}-comment`}
|
||||||
|
placeholder={t("editor.add-your-comment-here")}
|
||||||
|
parentMemoName={memo.name}
|
||||||
|
autoFocus
|
||||||
|
onConfirm={handleCommentCreated}
|
||||||
|
onCancel={() => setShowCommentEditor(false)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{comments.length === 0 ? (
|
{comments.length === 0 ? (
|
||||||
showCreateCommentButton && (
|
showCreateCommentButton && (
|
||||||
<div className="w-full flex flex-row justify-center items-center py-6">
|
<div className="w-full flex flex-row justify-center items-center py-6">
|
||||||
|
|
@ -134,18 +146,6 @@ const MemoDetail = () => {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{showCommentEditor && (
|
|
||||||
<div className="w-full">
|
|
||||||
<MemoEditor
|
|
||||||
cacheKey={`${memo.name}-${memo.updateTime}-comment`}
|
|
||||||
placeholder={t("editor.add-your-comment-here")}
|
|
||||||
parentMemoName={memo.name}
|
|
||||||
autoFocus
|
|
||||||
onConfirm={handleCommentCreated}
|
|
||||||
onCancel={() => setShowCommentEditor(false)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{md && (
|
{md && (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue