Skip to content

Commit

Permalink
#16 Remove style options from node widget in example
Browse files Browse the repository at this point in the history
  • Loading branch information
vidhya-metacell committed Jul 29, 2022
1 parent edb552b commit cb0d701
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 60 deletions.
38 changes: 0 additions & 38 deletions example/components/assets/styles/constants.ts

This file was deleted.

19 changes: 6 additions & 13 deletions example/components/widgets/CustomNodeWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,16 @@ export interface CustomNodeWidgetProps {

export class CustomNodeWidget extends React.Component<CustomNodeWidgetProps> {
render() {
const customNodeStyles = {
background: this.props.model.getOptions()['backgroundColor'],
borderColor: this.props.model.getOptions()['borderColor'],
boxShadow: this.props.model.getOptions()['backgrounboxShadowdColor'],
};
return (
<Box position='relative'>
<Box className={`primary-node ${this.props.model.getOptions()['variant']}`}>
{this.props.model.getOptions()['selected'] && (
<NodeSelection style={customNodeStyles} engine={this.props.engine} port={this.props.model} />
<NodeSelection engine={this.props.engine} port={this.props.model} />
)}

<Box
className="node"
style={customNodeStyles}
>
<img src={this.props.model.getOptions()['icon']} alt={this.props.model.getOptions()['name']} />
<Typography component="p" style={{ color: this.props.model.getOptions()['textColor'] }}>
<Box className="primary-node_header">
<img src="" alt={this.props.model.getOptions()['name']} />

<Typography component="p">
{this.props.model.getOptions()['name']}
</Typography>
</Box>
Expand Down
10 changes: 1 addition & 9 deletions example/components/widgets/NodeSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ import { DiagramEngine, PortWidget } from "@projectstorm/react-diagrams";
import * as React from "react";
import PortWigetComp from "./PortWidgetComp";

type styleObject = {
background: string;
borderColor: string;
boxShadow: string;
}

export interface NodeSelectionProps {
style: styleObject;
engine: DiagramEngine;
port: any;
}

class NodeSelection extends React.Component<NodeSelectionProps> {
render() {
const { style, engine, port } = this.props;
const { engine, port } = this.props;
const selectionPoint = '-0.375rem';
const IN = 'in';
const OUT = 'out';
Expand All @@ -26,7 +19,6 @@ class NodeSelection extends React.Component<NodeSelectionProps> {
<Button className="node-button">
<Box
className="icon"
style={style}
/>
Show properties
</Button>
Expand Down

0 comments on commit cb0d701

Please sign in to comment.