mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Improve comment field.
This commit is contained in:
@@ -23,7 +23,9 @@ import Markdown from "react-markdown";
|
|||||||
import "../markdown.css";
|
import "../markdown.css";
|
||||||
import Loading from "../components/loading.tsx";
|
import Loading from "../components/loading.tsx";
|
||||||
import {
|
import {
|
||||||
MdAdd, MdArrowDownward, MdArrowUpward,
|
MdAdd,
|
||||||
|
MdArrowDownward,
|
||||||
|
MdArrowUpward,
|
||||||
MdOutlineArticle,
|
MdOutlineArticle,
|
||||||
MdOutlineComment,
|
MdOutlineComment,
|
||||||
MdOutlineDataset,
|
MdOutlineDataset,
|
||||||
@@ -33,7 +35,7 @@ import {
|
|||||||
} from "react-icons/md";
|
} from "react-icons/md";
|
||||||
import { app } from "../app.ts";
|
import { app } from "../app.ts";
|
||||||
import { uploadingManager } from "../network/uploading.ts";
|
import { uploadingManager } from "../network/uploading.ts";
|
||||||
import { ErrorAlert } from "../components/alert.tsx";
|
import { ErrorAlert, InfoAlert } from "../components/alert.tsx";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import Pagination from "../components/pagination.tsx";
|
import Pagination from "../components/pagination.tsx";
|
||||||
import showPopup, { useClosePopup } from "../components/popup.tsx";
|
import showPopup, { useClosePopup } from "../components/popup.tsx";
|
||||||
@@ -1116,7 +1118,8 @@ function Comments({ resourceId }: { resourceId: number }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className={"mt-4 mb-6 textarea w-full p-4 h-28 flex flex-col"}>
|
{app.isLoggedIn() ? (
|
||||||
|
<div className={"mt-4 mb-6 textarea w-full p-4 h-40 flex flex-col"}>
|
||||||
<textarea
|
<textarea
|
||||||
placeholder={t("Write down your comment")}
|
placeholder={t("Write down your comment")}
|
||||||
className={"w-full resize-none grow"}
|
className={"w-full resize-none grow"}
|
||||||
@@ -1135,6 +1138,12 @@ function Comments({ resourceId }: { resourceId: number }) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<InfoAlert
|
||||||
|
message={t("You need to log in to comment")}
|
||||||
|
className={"my-4 alert-dash"}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<CommentsList
|
<CommentsList
|
||||||
resourceId={resourceId}
|
resourceId={resourceId}
|
||||||
page={page}
|
page={page}
|
||||||
|
Reference in New Issue
Block a user