cards clickability added

This commit is contained in:
Sol
2020-08-04 21:02:32 +01:00
committed by Sol Abrahams
parent da51dabe82
commit bdc683aa1d
4 changed files with 31 additions and 15 deletions

View File

@@ -34,7 +34,7 @@ class Search extends React.Component {
searchResults = []
} else {
searchResults = this.props.events.filter(event =>
event.description.toLowerCase().includes(queryString.toLowerCase()) || event.location.includes(queryString) || event.category.includes(queryString)
event.description.toLowerCase().includes(queryString.toLowerCase()) || event.location.toLowerCase().includes(queryString.toLowerCase()) || event.category.toLowerCase().includes(queryString.toLowerCase()) || event.date.includes(queryString)
)
}
this.setState({
@@ -55,7 +55,7 @@ class Search extends React.Component {
</div>
<div class='search-results'>
{this.state.searchResults.map(result => {
return <SearchRow query={this.props.queryString} category={result.category} location={result.location} date={result.date} description={result.description} />
return <SearchRow onSearchRowClick={this.props.onSearchRowClick} eventObj={result} query={this.props.queryString} />
})}
</div>
</div>