Skip to content

Commit 57d56c7

Browse files
committed
feat: add renderPane example
1 parent 24e0dca commit 57d56c7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

stories/extensions/test/testPane.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,30 @@ export type GenericClassDecorator<T> = (target: T) => void;`,
219219
});
220220
}
221221
};
222+
const newPane = function () {
223+
const key = shortRandomId();
224+
const name = `pane-${key}.ts`;
225+
const tabData: IEditorTab = {
226+
id: `${key}`,
227+
name,
228+
icon: 'selection',
229+
data: {},
230+
breadcrumb: [{ id: `${key}`, name }],
231+
renderPane: (tabData, tab, group) => {
232+
console.log(tabData, tab, group);
233+
const style: React.CSSProperties = {
234+
display: 'flex',
235+
width: '100%',
236+
height: '100%',
237+
fontSize: 48,
238+
alignItems: 'center',
239+
justifyContent: 'center',
240+
};
241+
return <div style={style}>{name}</div>;
242+
},
243+
};
244+
molecule.editor.open(tabData);
245+
};
222246

223247
const updateEntryPage = () => {
224248
const style: React.CSSProperties = {
@@ -427,6 +451,7 @@ PARTITIONED BY (DE STRING) LIFECYCLE 1000;
427451
<Button onClick={toggleEditorStatus}>
428452
Toggle Editor status
429453
</Button>
454+
<Button onClick={newPane}>New Pane</Button>
430455
<Button onClick={updateEntryPage}>
431456
Update Entry Page
432457
</Button>

0 commit comments

Comments
 (0)