-
Notifications
You must be signed in to change notification settings - Fork 70
closes #376 - Implement search and admin-filter functionality into Admin Users page #377
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
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/c0d3/c0d3-app/fnn9nbbhb |
Codecov Report
@@ Coverage Diff @@
## master #377 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 80 80
Lines 1027 1027
Branches 231 231
=========================================
Hits 1027 1027 |
…lterbuttons instead, add functionality
| const splitArr = str.toLowerCase().split(lowerCaseSearchTerm) | ||
| let tracker = 0 | ||
|
|
||
| const res = splitArr.reduce((acc: string[], word: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using a tracker, couldn't you use the index?
...reduce( (acc: string[], word: string, i: number) => {
| let tracker = 0 | ||
|
|
||
| const res = splitArr.reduce((acc: string[], word: string) => { | ||
| acc.push(word) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const originalWord = str.substr( tracker, word.length )
acc.push(originalWord)
…more comments, take out unused variable
…more comments, take out unused variable
| str: string, | ||
| lowerCaseSearchTerm: string, | ||
| searchTerm: string | ||
| ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const lowerCaseSearchTerm = searchTerm.toLowerCase() you don't need to pass this in as a variable.
Users should be able to see a search bar, search options, as well as filter options when on the admin users page. These functionalities should all work as well.
This PR will:
filter/search optionsandsearch barinto admin users pagesearchorfilteroption buttonpages/admin/users.tsxto look more professional, used bootstrap classes instead where possible