mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Add a button to create collection.
This commit is contained in:
@@ -26,6 +26,7 @@ import "../markdown.css";
|
|||||||
import Loading from "../components/loading.tsx";
|
import Loading from "../components/loading.tsx";
|
||||||
import {
|
import {
|
||||||
MdAdd,
|
MdAdd,
|
||||||
|
MdOutlineAdd,
|
||||||
MdOutlineArchive,
|
MdOutlineArchive,
|
||||||
MdOutlineArticle,
|
MdOutlineArticle,
|
||||||
MdOutlineComment,
|
MdOutlineComment,
|
||||||
@@ -1597,6 +1598,8 @@ function CollectionDialog({ rid }: { rid: number }) {
|
|||||||
|
|
||||||
const debounce = new Debounce(500);
|
const debounce = new Debounce(500);
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const delayedSetSearchKeyword = (keyword: string) => {
|
const delayedSetSearchKeyword = (keyword: string) => {
|
||||||
setSearchKeyword(keyword);
|
setSearchKeyword(keyword);
|
||||||
debounce.run(() => {
|
debounce.run(() => {
|
||||||
@@ -1633,6 +1636,10 @@ function CollectionDialog({ rid }: { rid: number }) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!app.isLoggedIn()) {
|
||||||
|
return <></>
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<span
|
<span
|
||||||
@@ -1676,8 +1683,21 @@ function CollectionDialog({ rid }: { rid: number }) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<div className="modal-action">
|
<div className="modal-action">
|
||||||
|
<Button className="btn-ghost" onClick={() => {
|
||||||
|
const dialog = document.getElementById(
|
||||||
|
"collection_dialog",
|
||||||
|
) as HTMLDialogElement;
|
||||||
|
dialog.close();
|
||||||
|
navigate("/create-collection");
|
||||||
|
}}>
|
||||||
|
<div className="flex items-center">
|
||||||
|
<MdOutlineAdd size={20} className={"inline-block mr-1"} />
|
||||||
|
{t("Create")}
|
||||||
|
</div>
|
||||||
|
</Button>
|
||||||
|
<span className="flex-1"></span>
|
||||||
<form method="dialog">
|
<form method="dialog">
|
||||||
<Button className="btn">Close</Button>
|
<Button className="btn">{t("Cancel")}</Button>
|
||||||
</form>
|
</form>
|
||||||
<Button
|
<Button
|
||||||
className="btn-primary"
|
className="btn-primary"
|
||||||
|
Reference in New Issue
Block a user