-
{p.title}
- {p.children}
+
+
+
{p.title}
+
+
+
+
+
+ {p.children}
+
);
}
diff --git a/src/pages/node/fetch.tsx b/src/pages/node/fetch.tsx
index a501768..50ba131 100644
--- a/src/pages/node/fetch.tsx
+++ b/src/pages/node/fetch.tsx
@@ -3,30 +3,35 @@ import { useTranslation } from "react-i18next";
import { Handle, Node, NodeProps, Position } from "@xyflow/react";
import Base from "./Base";
-import History from "../context/History";
+import Editor from "../context/Editor";
export type ToshoListed = Node<{
prime: boolean,
standard: boolean,
growth: boolean,
}, "fetch_ToshoListed">;
-export function ToshoListed({id, data}: NodeProps
) {
+export function ToshoListed(node: NodeProps) {
+ const {id, data} = node;
+
const {t} = useTranslation();
- const history = useContext(History);
- if (history === undefined) {
- throw new Error("no History context");
+ const editor = useContext(Editor);
+ if (editor === undefined) {
+ throw new Error("no editor context");
}
return (
-
+
@@ -35,7 +40,7 @@ export function ToshoListed({id, data}: NodeProps
) {
type="checkbox"
name="standard"
checked={data.standard}
- onChange={(e)=>history.push(id, {...data, standard: e.target.checked})}
+ onChange={(e)=>editor.modify(id, {...data, standard: e.target.checked})}
/>
{t("terms.toshoStandard")}
@@ -44,7 +49,7 @@ export function ToshoListed({id, data}: NodeProps) {
type="checkbox"
name="growth"
checked={data.growth}
- onChange={(e)=>history.push(id, {...data, growth: e.target.checked})}
+ onChange={(e)=>editor.modify(id, {...data, growth: e.target.checked})}
/>
{t("terms.toshoGrowth")}
diff --git a/src/pages/node/present.tsx b/src/pages/node/present.tsx
index a16ed03..09a49ec 100644
--- a/src/pages/node/present.tsx
+++ b/src/pages/node/present.tsx
@@ -1,11 +1,15 @@
import { useTranslation } from "react-i18next";
-import { Handle, Position } from "@xyflow/react";
+import { Handle, NodeProps, Position } from "@xyflow/react";
import Base from "./Base";
-export function TableDisplay() {
+export function TableDisplay(node: NodeProps) {
const {t} = useTranslation();
return (
-