docs(website): example flow
This commit is contained in:
@@ -33,7 +33,7 @@ const InputLabel = styled.div`
|
|||||||
color: ${(p) => p.theme.colors.violetLighten60};
|
color: ${(p) => p.theme.colors.violetLighten60};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const InputNode = ({ id, data }) => {
|
const InputNode = ({ id, data, isConnectable }) => {
|
||||||
return (
|
return (
|
||||||
<NodeWrapper>
|
<NodeWrapper>
|
||||||
<InputLabel>{data.label}:</InputLabel>
|
<InputLabel>{data.label}:</InputLabel>
|
||||||
@@ -42,17 +42,29 @@ const InputNode = ({ id, data }) => {
|
|||||||
value={data.value}
|
value={data.value}
|
||||||
onChange={(event) => data.onChange(event, id)}
|
onChange={(event) => data.onChange(event, id)}
|
||||||
/>
|
/>
|
||||||
<Handle type="source" position="bottom" />
|
<Handle type="source" position="bottom" isConnectable={isConnectable} />
|
||||||
</NodeWrapper>
|
</NodeWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ResultNode = ({ data }) => {
|
const ResultNode = ({ data, isConnectable }) => {
|
||||||
return (
|
return (
|
||||||
<NodeWrapper>
|
<NodeWrapper>
|
||||||
<div>{data.value}</div>
|
<div>{data.value}</div>
|
||||||
<Handle type="target" position="top" id="a" style={{ left: '40%' }} />
|
<Handle
|
||||||
<Handle type="target" position="top" id="b" style={{ left: '60%' }} />
|
type="target"
|
||||||
|
position="top"
|
||||||
|
id="a"
|
||||||
|
style={{ left: '40%' }}
|
||||||
|
isConnectable={isConnectable}
|
||||||
|
/>
|
||||||
|
<Handle
|
||||||
|
type="target"
|
||||||
|
position="top"
|
||||||
|
id="b"
|
||||||
|
style={{ left: '60%' }}
|
||||||
|
isConnectable={isConnectable}
|
||||||
|
/>
|
||||||
</NodeWrapper>
|
</NodeWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user