-
-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
125 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import { connectNode } from "./nodes"; | ||
import { ConnectedNode, ConnectedPublicNode, Node } from "./interfaces"; | ||
|
||
type AnotherCanvas = { | ||
children: React.ReactChildren | ||
} & ConnectedPublicNode | ||
|
||
const AnotherCanvas: React.FC<AnotherCanvas> = ({children, craft: {node, connectTarget}}: AnotherCanvas) => { | ||
return connectTarget( | ||
<hgroup style={{background:"#eee", padding:"20px 30px"}} className="another-canvas">{children}</hgroup>, | ||
{ | ||
incoming: (incomingNode: Node) => { | ||
// if ( incomingNode.data.props.children === 'Order1') return false; | ||
return true; | ||
} | ||
} | ||
) | ||
} | ||
|
||
export default connectNode(AnotherCanvas); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
import React from "react"; | ||
import { connectNode } from "./nodes"; | ||
import { ConnectedNode, ConnectedPublicNode, Node } from "./interfaces"; | ||
|
||
export default function MsgCanvas({children}) { | ||
return ( | ||
<hgroup className="msg-canvas">{children}</hgroup> | ||
type MsgCanvas = { | ||
children: React.ReactChildren | ||
} & ConnectedPublicNode | ||
|
||
const MsgCanvas: React.FC<MsgCanvas> = ({children, craft: {node, connectTarget}}: MsgCanvas) => { | ||
return connectTarget( | ||
<hgroup className="msg-canvas">{children}</hgroup>, | ||
{ | ||
incoming: (incomingNode: Node) => { | ||
return true; | ||
} | ||
} | ||
) | ||
} | ||
} | ||
|
||
export default connectNode(MsgCanvas); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters