add: template editor

This commit is contained in:
h z
2025-04-14 17:02:22 +01:00
parent 09338a2683
commit 947b59e3ea
29 changed files with 1277 additions and 166 deletions

View File

@@ -2,8 +2,8 @@ import React, {useState} from "react";
import { Link } from "react-router-dom";
import PermissionGuard from "../PermissionGuard";
import "./PathNode.css";
import {useDeletePath, useMovePath, useUpdatePath} from "../../utils/path-queries";
import {useIndexMarkdown, useMoveMarkdown} from "../../utils/markdown-queries";
import {useDeletePath, useMovePath, useUpdatePath} from "../../utils/queries/path-queries";
import {useIndexMarkdown, useMoveMarkdown} from "../../utils/queries/markdown-queries";
import MarkdownNode from "./MarkdownNode";
import PathSettingModal from "../Modals/PathSettingModal";
@@ -11,7 +11,7 @@ const PathNode = ({ path, isRoot = false }) => {
const [isPathSettingModalOpen, setIsPathSettingModalOpen] = useState(false);
const [isExpanded, setIsExpanded] = useState(isRoot);
const [isEditing, setIsEditing] = useState(false);
const [newName, setNewName] = useState(path.name);
const [newName, setNewName] = useState(path.name || "");
const deletePath = useDeletePath();
const updatePath = useUpdatePath();
@@ -130,8 +130,6 @@ const PathNode = ({ path, isRoot = false }) => {
<button
className="button is-small is-success"
onClick={() => {
console.log("path", path);
setIsPathSettingModalOpen(true);
}}
type="button"
@@ -217,6 +215,7 @@ const PathNode = ({ path, isRoot = false }) => {
<MarkdownNode
markdown={markdown}
handleMoveMarkdown={handleMoveMarkdown}
key={markdown.id}
/>
))}
</ul>