Skip to content

Commit 73be102

Browse files
authored
fix: customizable cell sidebar doesn't work. (#371)
1 parent 303df87 commit 73be102

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/react/src/components/notebook/cell/sidebar/CellSidebarExtension.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class CellSidebarFactory implements IDisposable {
3232
protected panel: NotebookPanel,
3333
protected commands: CommandRegistry,
3434
protected nbgrader: boolean = false,
35-
protected sidebarWidth: number = 120
35+
protected sidebarWidth: number = 120,
36+
protected factory: React.JSXElementConstructor<ICellSidebarProps> = CellSidebar
3637
) {
3738
this._onModelChanged(panel.content);
3839
panel.content.modelChanged.connect(this._onModelChanged, this);
@@ -59,9 +60,10 @@ class CellSidebarFactory implements IDisposable {
5960
private _addSidebar(model: ICellModel): void {
6061
const cell = this._getCell(model);
6162
if (cell) {
63+
const Element = this.factory;
6264
const sidebar = ReactWidget.create(
6365
<JupyterReactTheme>
64-
<CellSidebar
66+
<Element
6567
commands={this.commands}
6668
model={model}
6769
nbgrader={this.nbgrader}
@@ -155,7 +157,8 @@ export class CellSidebarExtension implements DatalayerNotebookExtension {
155157
panel,
156158
this.commands!,
157159
this.nbgrader,
158-
this.sidebarWidth
160+
this.sidebarWidth,
161+
this.factory
159162
);
160163
return sidebar;
161164
}

0 commit comments

Comments
 (0)