Skip to content

Commit 4ee49d5

Browse files
committed
lint colorpicker code
1 parent 0d57365 commit 4ee49d5

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

browser/main/modals/PreferencesModal/StorageItem.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class UnstyledFolderItem extends React.Component {
5555

5656
handleColorButtonClick (e) {
5757
const folder = Object.assign({}, this.state.folder, { showColumnPicker: true, colorPickerPos: { left: 0, top: 0 } })
58-
this.setState({ folder }, function() {
58+
this.setState({ folder }, function () {
5959
// After the color picker has been painted, re-calculate its position
6060
// by comparing its dimensions to the host dimensions.
61-
const { hostBoundingBox } = this.props;
61+
const { hostBoundingBox } = this.props
6262
const colorPickerNode = ReactDOM.findDOMNode(this.refs.colorPicker)
6363
const colorPickerBox = colorPickerNode.getBoundingClientRect()
6464
const offsetTop = hostBoundingBox.bottom - colorPickerBox.bottom
@@ -103,19 +103,22 @@ class UnstyledFolderItem extends React.Component {
103103
<button styleName='folderList-item-left-colorButton' style={{color: this.state.folder.color}}
104104
onClick={(e) => !this.state.folder.showColumnPicker && this.handleColorButtonClick(e)}
105105
>
106-
{ this.state.folder.showColumnPicker ?
107-
<div style={ popover }>
108-
<div style={ cover }
109-
onClick={ () => this.handleColorPickerClose() } />
106+
{this.state.folder.showColumnPicker
107+
? <div style={popover}>
108+
<div style={cover}
109+
onClick={() => this.handleColorPickerClose()}
110+
/>
110111
<div style={pickerStyle}>
111112
<SketchPicker
112-
ref="colorPicker"
113+
ref='colorPicker'
113114
color={this.state.folder.color}
114-
onChange={ (color) => this.handleColorChange(color) }
115-
onChangeComplete={ (color) => this.handleColorChange(color) } />
115+
onChange={(color) => this.handleColorChange(color)}
116+
onChangeComplete={(color) => this.handleColorChange(color)}
117+
/>
116118
</div>
117119
</div>
118-
: null }
120+
: null
121+
}
119122
<i className='fa fa-square'/>
120123
</button>
121124
<input styleName='folderList-item-left-nameInput'

browser/main/modals/PreferencesModal/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class Preferences extends React.Component {
3333
}
3434

3535
renderContent () {
36-
const { boundingBox } = this.state;
37-
let { dispatch, config, storages } = this.props
36+
const { boundingBox } = this.state
37+
let { dispatch, config, data } = this.props
3838

3939
switch (this.state.currentTab) {
4040
case 'INFO':
@@ -51,7 +51,7 @@ class Preferences extends React.Component {
5151
return (
5252
<StoragesTab
5353
dispatch={dispatch}
54-
storages={storages}
54+
data={data}
5555
boundingBox={boundingBox}
5656
/>
5757
)
@@ -66,7 +66,7 @@ class Preferences extends React.Component {
6666

6767
getContentBoundingBox () {
6868
const node = ReactDOM.findDOMNode(this.refs.content)
69-
return node.getBoundingClientRect();
69+
return node.getBoundingClientRect()
7070
}
7171

7272
render () {

0 commit comments

Comments
 (0)