Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Convert PanelManager to a functional component #1086

Merged
merged 4 commits into from
May 24, 2021

Conversation

bbecquet
Copy link
Contributor

@bbecquet bbecquet commented May 20, 2021

Description

Following the React implementation of the top bar and while it's still fresh, I converted the PanelManager to a functional component.

Why

  • Clarifying the side effects and state transitions
  • Use our hooks useDevice and useConfig
  • Good occasion to simplify some old or recent things

Comment on lines 22 to 24
if (poiFilters.category) {
return CategoryService.getCategoryByName(poiFilters.category)?.getInputValue();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the category is not found ?
For consistency, I think that an empty string should be used as a default here too, similarly to the next line.
(eg: http://localhost:3000/places/?type=invalidType could trigger a query to "undefined" after the input is focused)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I've made the change, thanks.

Copy link
Contributor

@amatissart amatissart left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@bbecquet bbecquet merged commit c6e82a1 into Qwant:master May 24, 2021
@bbecquet bbecquet deleted the react-func-panelmanager branch May 24, 2021 14:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants