-
Notifications
You must be signed in to change notification settings - Fork 188
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
[next] Issue 1470 - Port SearchBar to NEXT.js #1581
Conversation
|
||
type searchBarProps = { | ||
text: string; | ||
onTextChange: Function; |
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.
for onTextChange
should we be clearer than just Function. It is an onChange event handler and I believe in TS you have ChangeEventHandler/EventHandler type too. Whats your thought?
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.
It should be changed to a ChangeEvent function that returns void
Since it's for an input element, we can type it to HTMLInputElement
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.
Let's do it in a follow-up PR, because we are drilling a lot of stuff here. After getting everything working we will need to create an interface to SearchPage
's components and a context.
These functions are connected to how we build the URL query of a search. So I believe that we need to be care full with that. It's working now. Let's keep this for now.
I'm opening an issue for the next step (interface and context) now.
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.
@PedroFonsecaDEV : Your error is surprising as I got it deal with in this PR #1550 |
text: string; | ||
onTextChange: Function; | ||
filter: string; | ||
onFilterChange: Function; |
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.
similar thing here, we should probably be more specific by specifying any parameters it may take or "()" for nothing, as well as the return type for this function
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.
Also, this is for the FilterChange and TextChange functions, text and filter are fine
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.
Once SearchInput gets merged, you should probably rebase this so you can pick it up, would prefer to avoid duplicate components in 2 PRs
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.
Issue This PR Addresses
Fixes #1470
Type of Change
Description
I don't know if we need to merge something else related to our styles and theme or if I need to work on this particular style, but this is the result that I'm getting followed by the messages on the console.
Console:
Checklist