Skip to content

Commit

Permalink
Fix search issue
Browse files Browse the repository at this point in the history
  • Loading branch information
junaid33 committed Jun 4, 2020
1 parent 8c1ec0f commit 64c48f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion content/alts/alts.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
}
],
"id": "12uejiood",
"category": "Developer Tools"
"category": "Deployment"
},
{
"commercial": [
Expand Down
10 changes: 9 additions & 1 deletion src/components/ClientSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class Search extends Component {
searchResults: queryResult,
category: e,
})

console.log({ queryResult })
}

searchData = e => {
Expand Down Expand Up @@ -133,6 +135,12 @@ class Search extends Component {
searchQuery === `` && license === `` && language === `` && category === ``
? this.props.comps
: searchResults

const compLoad =
searchQuery === `` && license === `` && language === `` && category === ``
? this.props.mainInfo.slice(0, this.props.loadCount)
: this.props.mainInfo

const categories = [
"E-commerce",
"Developer Tools",
Expand Down Expand Up @@ -366,7 +374,7 @@ class Search extends Component {
</Box>
</Box>
<Box display="flex" flexWrap="wrap" width="100%">
{this.props.mainInfo.map(comp => {
{compLoad.map(comp => {
const match = queryResults.filter(
alt => alt.mainID === comp.id
)
Expand Down
2 changes: 1 addition & 1 deletion src/templates/index-with-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const SearchTemplate = props => {

return (
<>
<ClientSearch comps={allComps} mainInfo={fiveComp} />
<ClientSearch comps={allComps} loadCount={loadCount} mainInfo={mainInfo} />
</>
)
}
Expand Down

1 comment on commit 64c48f0

@vercel
Copy link

@vercel vercel bot commented on 64c48f0 Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.