add NodePanel

This commit is contained in:
zhandouxiaojiji committed 2020-10-16 09:56:17 +08:00
1 parent bd808725d7
commit 04f329eb7d
3 files changed
+31 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "behavior3editor", "name": "behavior3editor",
"version": "0.0.1", "version": "0.0.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
+28
View File
@@ -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));
+2 -2
View File
@@ -3,6 +3,7 @@ import GGEditor, { Mind, RegisterNode } from 'gg-editor';
import { MindData } from 'gg-editor/lib/common/interfaces'; import { MindData } from 'gg-editor/lib/common/interfaces';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import './Editor.css'; import './Editor.css';
import NodePanel from './NodePanel';
export interface EditorProps { export interface EditorProps {
@@ -18,8 +19,7 @@ export default class Editor extends React.Component<EditorProps> {
{/* <BehaviorTree /> */} {/* <BehaviorTree /> */}
</Col> </Col>
<Col span={6} className="editorSidebar"> <Col span={6} className="editorSidebar">
{/* <MindDetailPanel /> <NodePanel />
<EditorMinimap /> */}
</Col> </Col>
</Row> </Row>
{/* <MindContextMenu /> {/* <MindContextMenu />