refactor of graph pt2
This commit is contained in:
1 parent
730c804c22
commit
2cb2e779d7
20 files changed
+714
-246
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import "./ButtonNode.css";
|
||||
|
||||
import { ButtonIcon } from "components/Icons/ButtonIcons";
|
||||
import { FC } from "react";
|
||||
import { ButtonNodeProps } from "./types";
|
||||
import { Handle, Position } from "react-flow-renderer";
|
||||
|
||||
export const ButtonNode: FC<ButtonNodeProps> = ({
|
||||
height,
|
||||
width,
|
||||
icon,
|
||||
flipped,
|
||||
onClick,
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className="button-node"
|
||||
style={
|
||||
{
|
||||
"--button-height": `${height}px`,
|
||||
"--button-width": `${width}px`,
|
||||
} as any
|
||||
}
|
||||
>
|
||||
<ButtonIcon
|
||||
icon={
|
||||
<>
|
||||
<Handle
|
||||
type="target"
|
||||
position={flipped ? Position.Top : Position.Left}
|
||||
/>
|
||||
{icon}
|
||||
</>
|
||||
}
|
||||
onClick={onClick}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user