-
Notifications
You must be signed in to change notification settings - Fork 317
/
Copy pathContentSidebar.js
42 lines (38 loc) · 1.09 KB
/
ContentSidebar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* @flow
* @file Base class for the Content Sidebar ES6 wrapper
* @author Box
*/
import * as React from 'react';
// TODO switch to createRoot when upgrading to React 18
// eslint-disable-next-line react/no-deprecated
import { render } from 'react-dom';
import ES6Wrapper from './ES6Wrapper';
import ContentSidebarComponent from '../content-sidebar';
class ContentSidebar extends ES6Wrapper {
/**
* Helper to programmatically refresh the current sidebar panel
* @returns {void}
*/
refresh(): void {
this.getComponent().refresh();
}
/** @inheritdoc */
render() {
render(
<ContentSidebarComponent
componentRef={this.setComponent}
fileId={this.id}
language={this.language}
messages={this.messages}
onInteraction={this.onInteraction}
token={this.token}
{...this.options}
/>,
this.container,
);
}
}
global.Box = global.Box || {};
global.Box.ContentSidebar = ContentSidebar;
export default ContentSidebar;