Skip to content

Commit

Permalink
fix selected style for scoped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tsriram committed Mar 26, 2018
1 parent 2f472e7 commit 0f98c81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions www/src/components/searchbar-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ class Search extends Component {

// the result component is fed into the InfiniteHits component
const Result = ({ hit, pathname, search }) => {
// Example: pathname = `/plugins/gatsby-link/`, hit.name = `gatsby-link`
const selected = pathname.split(`/`)[2] === 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 0f98c81

Please sign in to comment.