Feat: add responsivity to searchbar#1741
Open
MarceloRobert wants to merge 1 commit intokernelci:mainfrom
Open
Conversation
77d82ca to
d2251ec
Compare
Comment on lines
+28
to
+34
| return isTreeListing | ||
| ? 'tree' | ||
| : isHardwareListing | ||
| ? 'hardware' | ||
| : isIssueListing | ||
| ? 'issue' | ||
| : 'unknown'; |
Contributor
There was a problem hiding this comment.
this condition is a kinda hard to read and also to visualize what is happening, we couldn't simplify this?
Comment on lines
+81
to
+93
| switch (routeInfo) { | ||
| case 'tree': | ||
| forwardSearch = { treeSearch: value }; | ||
| break; | ||
| case 'hardware': | ||
| forwardSearch = { hardwareSearch: value }; | ||
| break; | ||
| case 'issue': | ||
| forwardSearch = { issueSearch: value }; | ||
| break; | ||
| default: | ||
| break; | ||
| } |
Contributor
There was a problem hiding this comment.
this switch case could be simplified using an object:
const fowardSearchFields = {
tree: 'treeSearch',
hardware: 'hardwareSearch',
issue: 'issueSearch',
};
let forwardSearch = {[fowardSearchFields[routeInfo as keyof typeof fowardSearchFields]]: value};
you can also type fowardSearchFields to avoid using as, used here to be brief
- Moves control of the searchbox from each page to the topbar; - Improves custom dialog to be more custom; - Improves searchbox with responsivity showing a small button and a dialog on small screens Closes kernelci#1416
d2251ec to
88257c0
Compare
Comment on lines
+80
to
+84
| const forwardFields: Record<string, string> = { | ||
| tree: 'treeSearch', | ||
| hardware: 'hardwareSearch', | ||
| issue: 'issueSearch', | ||
| }; |
Contributor
There was a problem hiding this comment.
you can move this outside the component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
How to test
Go to any listing page, use the search box and also check the responsivity of the component. The search behavior should stil be the same.
Visual examples
Large screen:

Medium-large screens:

Medium screens:

Medium-small screens:

Small screens:

When clicking on the search icon:

Closes #1416