refactor(wrapNode): no border styles
This commit is contained in:
@@ -2,8 +2,14 @@ import React from 'react';
|
||||
|
||||
import Handle from '../Handle';
|
||||
|
||||
const nodeStyles = {
|
||||
background: '#ff6060',
|
||||
padding: 10,
|
||||
borderRadius: 5
|
||||
};
|
||||
|
||||
export default ({ data, style }) => (
|
||||
<div style={{ background: '#ff6060', padding: '10px', ...style }}>
|
||||
<div style={{ ...nodeStyles, ...style }}>
|
||||
<Handle style={{ top: 0 }} />
|
||||
{data.label}
|
||||
<Handle style={{ bottom: 0, top: 'auto', transform: 'translate(-50%, 50%)' }} />
|
||||
|
||||
@@ -2,8 +2,14 @@ import React from 'react';
|
||||
|
||||
import Handle from '../Handle';
|
||||
|
||||
const nodeStyles = {
|
||||
background: '#9999ff',
|
||||
padding: 10,
|
||||
borderRadius: 5
|
||||
};
|
||||
|
||||
export default ({ data, style }) => (
|
||||
<div style={{ background: '#9999ff', padding: '10px', ...style }}>
|
||||
<div style={{ ...nodeStyles, ...style }}>
|
||||
{data.label}
|
||||
<Handle style={{ bottom: 0, top: 'auto', transform: 'translate(-50%, 50%)' }} />
|
||||
</div>
|
||||
|
||||
@@ -2,8 +2,14 @@ import React from 'react';
|
||||
|
||||
import Handle from '../Handle';
|
||||
|
||||
const nodeStyles = {
|
||||
background: '#55ff99',
|
||||
padding: 10,
|
||||
borderRadius: 5
|
||||
};
|
||||
|
||||
export default ({ data, style }) => (
|
||||
<div style={{ background: '#55ff99', padding: '10px', ...style }}>
|
||||
<div style={{ ...nodeStyles, ...style }}>
|
||||
<Handle style={{ top: 0 }} />
|
||||
{data.label}
|
||||
</div>
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
cursor: grab;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 2px;
|
||||
user-select: none;
|
||||
pointer-events: all;
|
||||
transform-origin: 0 0;
|
||||
|
||||
Reference in New Issue
Block a user