Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement package search bar on docs website #270

Merged
merged 35 commits into from
Jul 23, 2019
Merged

Implement package search bar on docs website #270

merged 35 commits into from
Jul 23, 2019

Conversation

larixer
Copy link
Member

@larixer larixer commented Jul 1, 2019

This PR adds website package search bar, by porting yarn v1 search bar source code and upgrading it to use Hooks and Styled Components

@larixer larixer added the in progress Features claimed by a contributor label Jul 1, 2019
@larixer larixer force-pushed the site-search branch 3 times, most recently from 93b3a50 to 2fbe4ec Compare July 3, 2019 06:35
@arcanis
Copy link
Member

arcanis commented Jul 4, 2019

Nice! Maybe we could use the equivalent of history.replaceState to update the query string at each keystroke when typing a package name, what do you think? Since we have live results, I'm not sure we're often going to press enter 🤔

@larixer
Copy link
Member Author

larixer commented Jul 4, 2019

@arcanis Yep, I agree. I don't like current logic of url replacement. It would be nice to simplify it

@arcanis
Copy link
Member

arcanis commented Jul 6, 2019

Master is fixed! 👍

@larixer
Copy link
Member Author

larixer commented Jul 6, 2019

Master is fixed! 👍

Yep, I saw in the chat :) and rebased already :)

@larixer larixer removed the in progress Features claimed by a contributor label Jul 23, 2019
return ((href === '/' && ['/', '/package'].includes(location.pathname)) ||
(href !== '/' && location.pathname.startsWith(href))) ?
{ className: 'active' } :
null;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not too sure I understand the intent here - might be worth a comment?

@arcanis arcanis merged commit 6a706ef into master Jul 23, 2019
@arcanis arcanis deleted the site-search branch July 23, 2019 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants