Skip to content

Commit

Permalink
[www] Fix logic to determine selected plugin from list (#4706)
Browse files Browse the repository at this point in the history
* fix logic to determine selected plugin from list

* fix selected style for scoped packages
  • Loading branch information
tsriram authored and KyleAMathews committed Mar 26, 2018
1 parent d6588af commit 924e742
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion www/src/components/searchbar-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ class Search extends Component {

// the result component is fed into the InfiniteHits component
const Result = ({ hit, pathname, search }) => {
const selected = pathname.slice(10) === hit.name
// Example:
// pathname = `/plugins/gatsby-link/` || `/plugins/@comsoc/gatsby-mdast-copy-linked-files`
// hit.name = `gatsby-link` || `@comsoc/gatsby-mdast-copy-linked-files`
const selected = pathname.includes(hit.name)
return (
<Link
to={{
Expand Down

0 comments on commit 924e742

Please sign in to comment.