make width of DetailsSidebar configurable

Summary:
The `DetailsSidebar` has a fixed width of 300px. For some plugins it makes sense to specify a larger width for the sidebar, to show more content in it.

Usage:
```
<DetailSidebar width={500}>...</DetailSidebar>
```

Reviewed By: passy

Differential Revision: D12924525

fbshipit-source-id: 889d799017a6d3d53f6d32510863b4838a928fba
This commit is contained in:
Daniel Büchele
2018-11-06 05:36:20 -08:00
committed by Facebook Github Bot
parent 9fb3a56303
commit 2088153ffb

View File

@@ -16,6 +16,7 @@ type Props = {
rightSidebarVisible: boolean,
rightSidebarAvailable: boolean,
toggleRightSidebarAvailable: (visible: boolean) => void,
width?: number,
};
class DetailSidebar extends React.Component<Props> {
@@ -41,7 +42,7 @@ class DetailSidebar extends React.Component<Props> {
this.props.rightSidebarVisible &&
domNode &&
ReactDOM.createPortal(
<Sidebar width={300} position="right">
<Sidebar width={this.props.width || 300} position="right">
{this.props.children}
</Sidebar>,
domNode,