Skip to content

Commit

Permalink
Fix all code formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
i-like-robots committed Feb 3, 2020
1 parent dae0dd4 commit 0925ec7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
7 changes: 4 additions & 3 deletions example/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ class App extends React.Component {

render () {
return (
<React.Fragment>
<>
<p>Select the countries you have visited using React Tags below:</p>
<ReactTags
tags={this.state.tags}
suggestions={this.state.suggestions}
onDelete={this.onDelete.bind(this)}
onAddition={this.onAddition.bind(this)} />
onAddition={this.onAddition.bind(this)}
/>
<p>Output:</p>
<pre><code>{JSON.stringify(this.state.tags, null, 2)}</code></pre>
</React.Fragment>
</>
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions example/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ const plugins = [
resolve(),
// Use CommonJS plugin to include non-ES modules
commonjs()
];
]

if (process.env.NODE_ENV === 'production') {
// Use Uglify plugin to minify output
plugins.push(uglify())
// Use Uglify plugin to minify output
plugins.push(uglify())
} else {
plugins.push(serve({ open: true, contentBase: 'example', port: 8080 }))
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class Input extends React.Component {
aria-owns={id}
aria-activedescendant={index > -1 ? `${id}-${index}` : null}
aria-expanded={expanded}
style={{ width: this.state.inputWidth }} />
style={{ width: this.state.inputWidth }}
/>
<div ref={this.sizer} style={SIZER_STYLES}>{query || placeholderText}</div>
</div>
)
Expand Down
12 changes: 8 additions & 4 deletions lib/ReactTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,16 @@ class ReactTags extends React.Component {
<div
className={this.props.classNames.selected}
aria-relevant='additions removals'
aria-live='polite'>
aria-live='polite'
>
{this.props.tags.map((tag, i) => (
<TagComponent
key={i}
tag={tag}
removeButtonText={this.props.removeButtonText}
classNames={this.props.classNames}
onDelete={this.deleteTag.bind(this, i)} />
onDelete={this.deleteTag.bind(this, i)}
/>
))}
</div>
<div className={this.props.classNames.search}>
Expand All @@ -241,15 +243,17 @@ class ReactTags extends React.Component {
inputEventHandlers={this.inputEventHandlers}
autoresize={this.props.autoresize}
expanded={expanded}
placeholderText={this.props.placeholderText} />
placeholderText={this.props.placeholderText}
/>
<Suggestions
{...this.state}
id={this.props.id}
ref={this.suggestions}
classNames={this.props.classNames}
expanded={expanded}
addTag={this.addTag.bind(this)}
suggestionComponent={this.props.suggestionComponent} />
suggestionComponent={this.props.suggestionComponent}
/>
</div>
</div>
)
Expand Down
3 changes: 2 additions & 1 deletion lib/Suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class Suggestions extends React.Component {
role='option'
className={classNames.join(' ')}
aria-disabled={item.disabled === true}
onMouseDown={this.onMouseDown.bind(this, item)}>
onMouseDown={this.onMouseDown.bind(this, item)}
>
{item.disableMarkIt ? item.name
: <SuggestionComponent item={item} query={this.props.query} />}
</li>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"prepare": "npm run build",
"prepublish": "npm run build",
"pretest": "npm run lint && npm run build",
"lint": "standard 'lib/*.js spec/*.js",
"lint": "standard lib/*.js spec/*.js",
"test": "jasmine",
"coverage": "nyc --include 'dist-es5/**' npm test",
"dev": "NODE_ENV=development rollup -c example/rollup.config.js --watch",
Expand Down

0 comments on commit 0925ec7

Please sign in to comment.