-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
refactor(hits): Remove unused attributes, set sensible defaults
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,19 @@ var Template = require('./Template'); | |
|
||
class Hits extends React.Component { | ||
renderWithResults() { | ||
var renderedHits = map(this.props.hits, function(hit) { | ||
var renderedHits = map(this.props.hits, (hit) => { | ||
return ( | ||
<this.props.Template templateKey="hit" data={hit} key={hit.objectID} /> | ||
); | ||
}, this); | ||
}); | ||
|
||
return <div>{renderedHits}</div>; | ||
} | ||
|
||
renderNoResults() { | ||
return ( | ||
<div> | ||
<this.props.Template data={this.props.results} templateKey="empty" /> | ||
<this.props.Template templateKey="empty" data={this.props.results} /> | ||
</div> | ||
); | ||
} | ||
|
@@ -31,9 +31,9 @@ class Hits extends React.Component { | |
} | ||
|
||
Hits.propTypes = { | ||
Template: React.PropTypes.func, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pixelastic
Contributor
|
||
hits: React.PropTypes.arrayOf(React.PropTypes.object), | ||
results: React.PropTypes.object, | ||
Template: React.PropTypes.func | ||
results: React.PropTypes.object | ||
}; | ||
|
||
Hits.defaultProps = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ search.addWidget( | |
empty: require('./templates/no-results.html'), | ||
hit: require('./templates/hit.html') | ||
}, | ||
hitsPerPage: 6 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pixelastic
Contributor
|
||
hitsPerPage: 10 | ||
}) | ||
); | ||
|
||
|
Just to know, why we reorder keys here? I will try to add the key ordering rule to eslint so that we always have the same order