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

+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));