Skip to content

Commit

Permalink
feat(stats): add query variable to the template
Browse files Browse the repository at this point in the history
  • Loading branch information
maxiloc committed Sep 21, 2015
1 parent 97b1681 commit 75f457d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/Stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class Stats extends React.Component {
hasNoResults: this.props.nbHits === 0,
hasOneResult: this.props.nbHits === 1,
hasManyResults: this.props.nbHits > 1,
processingTimeMS: this.props.processingTimeMS
processingTimeMS: this.props.processingTimeMS,
query: this.props.query
};

return (
Expand All @@ -31,7 +32,8 @@ Stats.propTypes = {
React.PropTypes.func,
React.PropTypes.string
]).isRequired,
templateHelpers: React.PropTypes.object
templateHelpers: React.PropTypes.object,
query: React.PropTypes.string
};

module.exports = Stats;
1 change: 1 addition & 0 deletions widgets/stats/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function stats({container = null, template = defaultTemplate}) {
<Stats
nbHits={results.nbHits}
processingTimeMS={results.processingTimeMS}
query={results.query}
template={template}
templateHelpers={templateHelpers}
/>,
Expand Down

0 comments on commit 75f457d

Please sign in to comment.