From 1c7ded5d6dd51013670906657fd6e3a97f205993 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 15 Jul 2022 00:32:46 +0300 Subject: [PATCH] Create input node --- .../FlowEditor/nodes/basic/InputNode.tsx | 39 +++++++++++++++++++ .../basic/{NodeMath.tsx => MathNode.tsx} | 0 2 files changed, 39 insertions(+) create mode 100644 components/FlowEditor/nodes/basic/InputNode.tsx rename components/FlowEditor/nodes/basic/{NodeMath.tsx => MathNode.tsx} (100%) diff --git a/components/FlowEditor/nodes/basic/InputNode.tsx b/components/FlowEditor/nodes/basic/InputNode.tsx new file mode 100644 index 0000000..06844f4 --- /dev/null +++ b/components/FlowEditor/nodes/basic/InputNode.tsx @@ -0,0 +1,39 @@ +import styles from "./Node.module.css"; +import { Handle, Position } from "react-flow-renderer"; + +type InputNodeProps = {}; + +const InputNode = (props: InputNodeProps) => { + return ( + // Базовый класс generic-node - прописана ширина и положение, цвет текста и фона + + // Nandle - ручка для коннекта. Можно задать оформление при помощи className, тип (target / source) и позицию + + // Label - подпись ноды. Можно стилизовать + + // Select - DropDown меню, можно стилизовать. Стоит класс nodrag для предотвращения залипания + +
+ + +
+ + + + +
+ + +
+ ); +}; + +export default InputNode; \ No newline at end of file diff --git a/components/FlowEditor/nodes/basic/NodeMath.tsx b/components/FlowEditor/nodes/basic/MathNode.tsx similarity index 100% rename from components/FlowEditor/nodes/basic/NodeMath.tsx rename to components/FlowEditor/nodes/basic/MathNode.tsx