Rename Node to FuncNode

Co-authored-by: Andrew Watkins <andrew.watkinz@gmail.com>
Co-authored-by: Brandon Farmer <bthesorceror@gmail.com>
pull/3142/head
Andrew Watkins 2018-03-30 14:17:08 -07:00
parent 93e20eaad6
commit 17b48914ce
3 changed files with 33 additions and 27 deletions

View File

@ -0,0 +1,31 @@
import React, {PureComponent} from 'react'
interface Arg {
key: string
value: string
}
interface Node {
name: string
arguments: Arg[]
}
interface Props {
node: Node
}
interface State {
isOpen: boolean
}
export default class FuncNode extends PureComponent<Props, State> {
public render() {
const {node} = this.props
return (
<div className="func-node">
<div>{node.name}</div>
</div>
)
}
}

View File

@ -1,25 +0,0 @@
import React, {SFC} from 'react'
interface Arg {
key: string
value: string
}
interface Node {
name: string
arguments: Arg[]
}
interface Props {
node: Node
}
const Node: SFC<Props> = ({node}) => {
return (
<div className="func-node">
<div>{node.name}</div>
</div>
)
}
export default Node

View File

@ -1,6 +1,6 @@
import React, {SFC} from 'react'
import FuncSelector from 'src/ifql/components/FuncSelector'
import Node from 'src/ifql/components/Node'
import FuncNode from 'src/ifql/components/FuncNode'
interface Arg {
key: string
@ -22,7 +22,7 @@ const TimeMachine: SFC<Props> = ({funcs, nodes, onAddNode}) => {
return (
<div>
<div className="func-node-container">
{nodes.map((n, i) => <Node key={i} node={n} />)}
{nodes.map((n, i) => <FuncNode key={i} node={n} />)}
<FuncSelector funcs={funcs} onAddNode={onAddNode} />
</div>
</div>