Skip to content
This repository was archived by the owner on Jun 3, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions dist-modules/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ var Sidebar = function (_Component) {
}, {
key: 'render',
value: function render() {
var sidebarStyle = _extends({}, defaultStyles.sidebar, this.props.styles.sidebar);
var contentStyle = _extends({}, defaultStyles.content, this.props.styles.content);
var overlayStyle = _extends({}, defaultStyles.overlay, this.props.styles.overlay);
var sidebarStyle = _extends({}, this.props.externalStylesOnly ? {} : defaultStyles.sidebar, this.props.styles.sidebar);
var contentStyle = _extends({}, this.props.externalStylesOnly ? {} : defaultStyles.content, this.props.styles.content);
var overlayStyle = _extends({}, this.props.externalStylesOnly ? {} : defaultStyles.overlay, this.props.styles.overlay);
var useTouch = this.state.dragSupported && this.props.touch;
var isTouching = this.isTouching();
var rootProps = {
Expand Down Expand Up @@ -379,7 +379,8 @@ var Sidebar = function (_Component) {
}),
_react2.default.createElement(
'div',
{ className: this.props.contentClassName, style: contentStyle },
{ className: this.props.contentClassName,
style: contentStyle },
dragHandle,
this.props.children
)
Expand All @@ -403,6 +404,9 @@ Sidebar.propTypes = {
dragHandle: _propTypes2.default.object
}),

// Are styles loaded via an external source / stylesheet? If so, sets no styles on the component.
externalStylesOnly: _propTypes2.default.bool,

// root component optional class
rootClassName: _propTypes2.default.string,

Expand Down Expand Up @@ -460,6 +464,7 @@ Sidebar.defaultProps = {
dragToggleDistance: 30,
onSetOpen: function onSetOpen() {},
styles: {},
externalStylesOnly: false,
defaultSidebarWidth: 0
};

Expand Down
13 changes: 9 additions & 4 deletions src/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};

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.

const contentStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.content, ...this.props.styles.content};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class properties must be methods. Expected '(' but instead saw 'contentStyle'.
Expected '(' and instead saw '}'.
Expected an identifier and instead saw ':'.
'spread/rest operator' is only available in ES6 (use 'esversion: 6').
Expected an identifier and instead saw 'this' (a reserved word).
Expected ')' to match '}' from line 222 and instead saw '.'.
'function closure expressions' is only available in Mozilla JavaScript extensions (use moz option).
Expected an identifier and instead saw ';'.

const overlayStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.overlay, ...this.props.styles.overlay};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'spread/rest operator' is only available in ES6 (use 'esversion: 6').
Expected an identifier and instead saw 'this' (a reserved word).
Expected ')' to match '}' from line 222 and instead saw '.'.
'function closure expressions' is only available in Mozilla JavaScript extensions (use moz option).
Unnecessary semicolon.

const useTouch = this.state.dragSupported && this.props.touch;
const isTouching = this.isTouching();
const rootProps = {
Expand Down Expand Up @@ -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>
Expand All @@ -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,

Expand Down Expand Up @@ -407,6 +411,7 @@ Sidebar.defaultProps = {
dragToggleDistance: 30,
onSetOpen: () => {},
styles: {},
externalStylesOnly: false,
defaultSidebarWidth: 0,
};

Expand Down