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:
committed by
Facebook Github Bot
parent
9fb3a56303
commit
2088153ffb
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user