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

feat: search bar component #95

Merged
merged 6 commits into from
Apr 16, 2024
Merged

feat: search bar component #95

merged 6 commits into from
Apr 16, 2024

Conversation

alexgarel
Copy link
Member

@alexgarel alexgarel commented Apr 10, 2024

Initial work on the search-bar component

we have a search box and a button. It can be tested locally on http://search.localhost:8000/static/off.html.

At the moment it just send the request, it does not display the results (next results components).

@alexgarel alexgarel marked this pull request as draft April 10, 2024 09:13
@alexgarel alexgarel marked this pull request as draft April 10, 2024 09:13
@alexgarel alexgarel changed the title feat: wip on search bar feat: wip on search bar Apr 10, 2024
@alexgarel alexgarel changed the title feat: wip on search bar feat: search bar component Apr 10, 2024
Base automatically changed from chore-front-setup to main April 11, 2024 08:45
@alexgarel alexgarel marked this pull request as ready for review April 11, 2024 16:50
Comment on lines +60 to +67
@state()
_pageCount?: Number;

@state()
_results?: {}[];

@state()
_count?: Number;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it usefull to comment states like you do for property ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I'll add them on next PR.

Comment on lines +140 to +141
const response = await fetch(this._searchUrl());
const data = await response.json();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why this is in two lines

Copy link
Member Author

Choose a reason for hiding this comment

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

just for readability ! How would you write it ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't understand why the two "await" were necessary.
I just got it 👍🏼

@alexgarel
Copy link
Member Author

Merging, as it's work in progress, not displayed yet.

@alexgarel alexgarel merged commit 6eaa132 into main Apr 16, 2024
7 checks passed
@alexgarel alexgarel deleted the search-bar branch April 16, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants