Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Update styleguide filtering #6

Merged
merged 1 commit into from
May 26, 2017
Merged

Update styleguide filtering #6

merged 1 commit into from
May 26, 2017

Conversation

drewdrewthis
Copy link

@drewdrewthis drewdrewthis commented May 26, 2017

  • Refactors filtering to allow for a debouncing on the main section
  • Adds autofocus for input
  • Adds policygenius link and ©
  • Updates some classnames for styles

@drewdrewthis drewdrewthis force-pushed the update-styleguidist branch from 9d18c01 to 45f73a5 Compare May 26, 2017 15:34
return (
<div>
<div className={classes.root}>
<div className={classes.search}>
<input
ref={component => component && findDOMNode(component).focus()}

Choose a reason for hiding this comment

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

why do you need to do this?

Copy link
Author

Choose a reason for hiding this comment

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

@patrickkim This autofocuses onto the input so that when you open RCL you can immediately start typing/filtering

// Updates Styleguidist state
// using updateSections function passed as prop
updateStyleguide = debounce((searchTerm, filteredSections, updateStyleguide) => {
updateStyleguide(searchTerm, filteredSections);

Choose a reason for hiding this comment

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

I found the semi circular nature of this part to be confusing. It would be helpful if it were broken out.

updateStyleguide = debounce(functionName, 200);

Choose a reason for hiding this comment

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

You might want to consider making this a class method.

Copy link
Author

Choose a reason for hiding this comment

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

Wasn't able to get it to work any other way. Can revisit in a refactor.

@drewdrewthis drewdrewthis merged commit 90c87d2 into master May 26, 2017
@drewdrewthis drewdrewthis deleted the update-styleguidist branch May 26, 2017 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants