mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 02:56:22 +00:00
feat: 更新评论输入框的占位符,支持自定义占位符文本
All checks were successful
Push to Helm Chart Repository / build (push) Successful in 27s
All checks were successful
Push to Helm Chart Repository / build (push) Successful in 27s
This commit is contained in:
@ -16,12 +16,14 @@ export function CommentInput(
|
||||
onCommentSubmitted,
|
||||
initContent = "",
|
||||
initIsPrivate = false,
|
||||
placeholder = "",
|
||||
isUpdate = false
|
||||
}: {
|
||||
user: User | null,
|
||||
onCommentSubmitted: ({ commentContent, isPrivate }: { commentContent: string, isPrivate: boolean }) => void,
|
||||
initContent?: string,
|
||||
initIsPrivate?: boolean,
|
||||
placeholder?: string,
|
||||
isUpdate?: boolean,
|
||||
}
|
||||
) {
|
||||
@ -65,7 +67,7 @@ export function CommentInput(
|
||||
</div>
|
||||
<div className="flex-1 pl-2 fade-in-up">
|
||||
<Textarea
|
||||
placeholder={user ? (isPrivate ? t("private_placeholder") : t("placeholder")) : t("login_required", { loginButton: "登录" })}
|
||||
placeholder={placeholder || (user ? (isPrivate ? t("private_placeholder") : t("placeholder")) : t("login_required", { loginButton: "登录" }))}
|
||||
className="w-full p-2 border border-gray-300 rounded-md fade-in-up"
|
||||
value={commentContent}
|
||||
onChange={(e) => setCommentContent(e.target.value)}
|
||||
|
@ -268,6 +268,7 @@ export function CommentItem(
|
||||
user={user}
|
||||
onCommentSubmitted={onReply}
|
||||
initIsPrivate={isPrivate}
|
||||
placeholder={`${t("reply")} ${comment.user.nickname} :`}
|
||||
/>}
|
||||
{activeInput && activeInput.type === 'edit' && activeInput.id === comment.id && <CommentInput
|
||||
user={user}
|
||||
|
Reference in New Issue
Block a user