add NodePanel
This commit is contained in:
1 parent
bd808725d7
commit
04f329eb7d
3 files changed
+31
-3
No files matched your search
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "behavior3editor",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
import { Card } from 'antd';
|
||||
import { DetailPanel, withEditorContext } from 'gg-editor';
|
||||
import { EditorContextProps } from 'gg-editor/lib/components/EditorContext';
|
||||
import { DetailPanelComponentProps } from 'gg-editor/lib/components/DetailPanel';
|
||||
|
||||
|
||||
interface NodePanelProps extends EditorContextProps, DetailPanelComponentProps {
|
||||
|
||||
}
|
||||
|
||||
interface NodePanelState {
|
||||
|
||||
}
|
||||
|
||||
class NodePanel extends React.Component<NodePanelProps, NodePanelState> {
|
||||
render() {
|
||||
const { nodes } = this.props;
|
||||
const node = nodes[0];
|
||||
return (
|
||||
<Card>
|
||||
{node ? node.getModel().label : ''}
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default DetailPanel.create<NodePanelProps>('node')(withEditorContext(NodePanel));
|
||||
@@ -3,6 +3,7 @@ import GGEditor, { Mind, RegisterNode } from 'gg-editor';
|
||||
import { MindData } from 'gg-editor/lib/common/interfaces';
|
||||
import { Row, Col } from 'antd';
|
||||
import './Editor.css';
|
||||
import NodePanel from './NodePanel';
|
||||
|
||||
export interface EditorProps {
|
||||
|
||||
@@ -18,8 +19,7 @@ export default class Editor extends React.Component<EditorProps> {
|
||||
{/* <BehaviorTree /> */}
|
||||
</Col>
|
||||
<Col span={6} className="editorSidebar">
|
||||
{/* <MindDetailPanel />
|
||||
<EditorMinimap /> */}
|
||||
<NodePanel />
|
||||
</Col>
|
||||
</Row>
|
||||
{/* <MindContextMenu />
|
||||
|
||||
Reference in new issue
Block a user