add: markdown search feature
This commit is contained in:
@@ -4,6 +4,7 @@ import PermissionGuard from "../PermissionGuard";
|
||||
import "./PathNode.css";
|
||||
import {useDeletePath, useMovePath, usePaths, useUpdatePath} from "../../utils/path-queries";
|
||||
import {useIndexMarkdown, useMarkdownsByPath, useMoveMarkdown} from "../../utils/markdown-queries";
|
||||
import MarkdownNode from "./MarkdownNode";
|
||||
|
||||
const PathNode = ({ path, isRoot = false }) => {
|
||||
const [isExpanded, setIsExpanded] = useState(isRoot);
|
||||
@@ -175,34 +176,10 @@ const PathNode = ({ path, isRoot = false }) => {
|
||||
))}
|
||||
|
||||
{sortedMarkdowns.filter(md => md.title !== "index").map((markdown) => (
|
||||
<li key={markdown.id}>
|
||||
<div className="is-clickable field has-addons">
|
||||
<span className="markdown-name has-text-weight-bold control">
|
||||
<Link to={`/markdown/${markdown.id}`} className="is-link markdown-node">
|
||||
{markdown.title}
|
||||
</Link>
|
||||
</span>
|
||||
<PermissionGuard rolesRequired={['admin']}>
|
||||
<div className="control">
|
||||
<button
|
||||
className="button is-small mb-1 move-forward"
|
||||
style={{ height: "1rem", padding: "0.25rem" }}
|
||||
onClick={() => handleMoveMarkdown(markdown, "forward")}
|
||||
type="button"
|
||||
>
|
||||
</button>
|
||||
<button
|
||||
className="button is-small mb-1 move-backward"
|
||||
style={{ height: "1rem", padding: "0.25rem" }}
|
||||
onClick={() => handleMoveMarkdown(markdown, "backward")}
|
||||
type="button"
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
</PermissionGuard>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<MarkdownNode
|
||||
markdown={markdown}
|
||||
handleMoveMarkdown={handleMoveMarkdown}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user