-
Notifications
You must be signed in to change notification settings - Fork 222
Allow use of externally defined styles #143
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,9 +218,9 @@ class Sidebar extends Component { | |
| } | ||
|
|
||
| render() { | ||
| const sidebarStyle = {...defaultStyles.sidebar, ...this.props.styles.sidebar}; | ||
| const contentStyle = {...defaultStyles.content, ...this.props.styles.content}; | ||
| const overlayStyle = {...defaultStyles.overlay, ...this.props.styles.overlay}; | ||
| const sidebarStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.sidebar, ...this.props.styles.sidebar}; | ||
| const contentStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.content, ...this.props.styles.content}; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class properties must be methods. Expected '(' but instead saw 'contentStyle'. |
||
| const overlayStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.overlay, ...this.props.styles.overlay}; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'spread/rest operator' is only available in ES6 (use 'esversion: 6'). |
||
| const useTouch = this.state.dragSupported && this.props.touch; | ||
| const isTouching = this.isTouching(); | ||
| const rootProps = { | ||
|
|
@@ -328,7 +328,8 @@ class Sidebar extends Component { | |
| tabIndex="0" | ||
| onClick={this.overlayClicked} | ||
| /> | ||
| <div className={this.props.contentClassName} style={contentStyle}> | ||
| <div className={this.props.contentClassName} | ||
| style={contentStyle}> | ||
| {dragHandle} | ||
| {this.props.children} | ||
| </div> | ||
|
|
@@ -350,6 +351,9 @@ Sidebar.propTypes = { | |
| dragHandle: PropTypes.object, | ||
| }), | ||
|
|
||
| // Are styles loaded via an external source / stylesheet? If so, sets no styles on the component. | ||
| externalStylesOnly: PropTypes.bool, | ||
|
|
||
| // root component optional class | ||
| rootClassName: PropTypes.string, | ||
|
|
||
|
|
@@ -407,6 +411,7 @@ Sidebar.defaultProps = { | |
| dragToggleDistance: 30, | ||
| onSetOpen: () => {}, | ||
| styles: {}, | ||
| externalStylesOnly: false, | ||
| defaultSidebarWidth: 0, | ||
| }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Expected '}' to match '{' from line 221 and instead saw '...'.
Missing semicolon.
'spread/rest operator' is only available in ES6 (use 'esversion: 6').
Expected an assignment or function call and instead saw an expression.
Unnecessary semicolon.