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

refactor: extract page elements and use hooks for search #854

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

pengyk
Copy link
Member

@pengyk pengyk commented Aug 1, 2020

Tickets:

List of changes:

  • Refactor search page to extract page elements and use hooks

Type of change:

Please delete options that aren't relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How did you do this?

How to test:

Questions:

PR Checklist:

  • Merged develop branch (before testing)
  • Linted my code locally
  • Listed change(s) in the Changelog
  • Tested all links in project relevant browsers
  • Tested all links on different screen sizes
  • Referenced all useful info (issues, tasks, etc)

Screenshots:

@pengyk pengyk requested review from logan-r and loreina August 1, 2020 16:02
Copy link
Member

@logan-r logan-r left a comment

Choose a reason for hiding this comment

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

Great work Peng!
Can you do another pass through the comments in features/Search/Search and features/Search/HackerSelect and then this will be good to merge

src/features/Search/Search.tsx Outdated Show resolved Hide resolved
src/pages/Admin/Search.tsx Show resolved Hide resolved
src/pages/Admin/Search.tsx Outdated Show resolved Hide resolved
src/pages/Sponsor/Search.tsx Outdated Show resolved Hide resolved
const { sponsor, viewSaved, results } = this.state;
const searchBar = this.state.searchBar.toLowerCase();
const filter = () => {
const currSearchBar = searchBar.toLowerCase();
Copy link
Member

Choose a reason for hiding this comment

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

what's the diff between searchBar and currSearchBar?

Copy link
Member

Choose a reason for hiding this comment

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

I would assume that it's just searchBar but lowercase?

IIRC this function is just to filter out rows that don't match the search bar.

@logan-r logan-r self-requested a review September 26, 2020 16:22
Copy link
Member

@logan-r logan-r left a comment

Choose a reason for hiding this comment

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

Good to merge!

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.

Extract pages level elements from Search & refactor to use hooks
4 participants