added top color to node

This commit is contained in:
Ari Sosnovsky committed 2021-11-08 19:54:36 -05:00
1 parent 8b4c8aec22
commit 5ac972101a
2 files changed
+20 -1

No files matched your search

+3 -1
View File
@@ -9,6 +9,7 @@ export interface NodeProp extends Node {
isOpen?: boolean;
onXClick?: () => void;
onOpenClick?: () => void;
topColor?: 'red' | 'green' | 'blue' | 'none';
}
export default ({
loc: [x,y],
@@ -18,9 +19,10 @@ export default ({
onXClick=() => {},
onOpenClick=() => {},
isOpen=false,
topColor='none',
}: NodeProp) => <foreignObject x={x} y={y} width={width} height={height}>
<div className="automation-dag--node">
<div className="automation-dag--node-inner">
<div className={`automation-dag--node-inner ${topColor !== 'none' ? `top-color ${topColor}`: ''}`}>
<div className="automation-dag--node-inner-edge left" onClick={onXClick}>
<div className="automation-node-side-button">X</div>
</div>
@@ -32,6 +32,23 @@
flex-direction: row;
flex: 1;
&.top-color {
&.red {
border-top-color: adjust-color($color: $secondary, $red: 125);
}
&.blue {
border-top-color: adjust-color($color: $secondary, $blue: 125);
}
&.green {
border-top-color: adjust-color($color: $secondary, $green: 125);
}
border-top-width: 1px;
border-top-style: solid;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
&-text {
flex: 2;
display: flex;