From 5959de3ab5807314f8efb023ec78df479b8617d3 Mon Sep 17 00:00:00 2001 From: vidhya-metacell Date: Fri, 22 Jul 2022 19:16:24 +0200 Subject: [PATCH] #16 Node selection --- .../components/widgets/CustomNodeWidget.tsx | 43 ++----------- example/components/widgets/NodeSelection.tsx | 62 +++++++++++++++++++ 2 files changed, 66 insertions(+), 39 deletions(-) create mode 100644 example/components/widgets/NodeSelection.tsx diff --git a/example/components/widgets/CustomNodeWidget.tsx b/example/components/widgets/CustomNodeWidget.tsx index 6301867..506a376 100644 --- a/example/components/widgets/CustomNodeWidget.tsx +++ b/example/components/widgets/CustomNodeWidget.tsx @@ -1,7 +1,8 @@ import * as React from "react"; -import {DiagramEngine, PortWidget} from "@projectstorm/react-diagrams"; +import {DiagramEngine} from "@projectstorm/react-diagrams"; import {MetaNodeModel} from "../../../."; -import {Box, Button, Typography} from "@material-ui/core"; +import {Box, Typography} from "@material-ui/core"; +import NodeSelection from "./NodeSelection"; export interface CustomNodeWidgetProps { model: MetaNodeModel; @@ -18,43 +19,7 @@ export class CustomNodeWidget extends React.Component { return ( {this.props.model.getOptions()['selected'] && ( - <> - - - - - - - - - - - - - - - - - - + )} { + render() { + const { style, engine, port } = this.props; + return ( + <> + + + + + + + + + + + + + + + + + + + ) + } +} + +export default NodeSelection; \ No newline at end of file