@@ -29,7 +29,8 @@ class Search extends Component {
2929 currentPage : PropTypes . number ,
3030 perPage : PropTypes . number ,
3131 query : PropTypes . string ,
32- results : PropTypes . arrayOf ( verseType ) , // eslint-disable-line
32+ results : PropTypes . arrayOf ( PropTypes . string ) ,
33+ entities : PropTypes . arrayOf ( verseType ) ,
3334 push : PropTypes . func . isRequired ,
3435 location : PropTypes . shape ( { // eslint-disable-line
3536 q : PropTypes . string ,
@@ -119,9 +120,9 @@ class Search extends Component {
119120 }
120121
121122 renderBody ( ) {
122- const { isErrored, isLoading, results, options, query } = this . props ;
123+ const { isErrored, isLoading, results, entities , options, location : { query } } = this . props ;
123124
124- if ( ! query ) {
125+ if ( ! query || ! query . q ) {
125126 return (
126127 < h3 className = "text-center" style = { { padding : '15%' } } >
127128 < LocaleFormattedMessage id = "search.nothing" defaultMessage = "No search query." />
@@ -151,9 +152,9 @@ class Search extends Component {
151152
152153 return results . map ( result => (
153154 < Verse
154- verse = { result }
155- match = { result . match }
156- key = { result . verseKey }
155+ verse = { entities [ result ] }
156+ match = { entities [ result ] . match }
157+ key = { entities [ result ] . verseKey }
157158 tooltip = { options . tooltip }
158159 isSearched
159160 />
@@ -208,6 +209,7 @@ function mapStateToProps(state) {
208209 took : state . searchResults . took ,
209210 query : state . searchResults . query ,
210211 results : state . searchResults . results ,
212+ entities : state . searchResults . entities ,
211213 options : state . options
212214 } ;
213215}
0 commit comments