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

Feature/5760 update search bar to latest UI design #199

Merged

Conversation

NekoLyn
Copy link
Contributor

@NekoLyn NekoLyn commented Oct 22, 2024

  1. update searchbar UI to latest design

  2. remove the parameter chips of filters, only displaying a badge with number indicate number of selected filter options

  3. both the 'filter' button and the 'search' button belong to the searchbar button group. They are all expandable (showing icon and button name at the same time instead of only icon) and only one button is expanded at a time in the group.

  4. searchbar in landing page:
    improve the key-enter-search function: do search right after press enter

  5. searchbar in search result page:
    only appears in header, and looks shorter than normal
    will expand when there exists text input or text input field is focused
    the expansion of searchbar will make the menu in header collapse into an icon (click to open)
    if no text input and text input field is not focused, searchbar will shrink to the shorter one

image
image
image
image
image
image

@utas-raymondng
Copy link
Contributor

Reviewing it now

Copy link
Contributor

@utas-raymondng utas-raymondng left a comment

Choose a reason for hiding this comment

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

One comment on using store

And is there a ticket to followup the theme and constant color code, if yes please put a link here, else please raise one thanks

@@ -31,6 +33,8 @@ const searchQueryResult = (state: RootState) =>

const getComponentState = (state: RootState) => state.paramReducer;

export { searchQueryResult, getComponentState };
const getSearchbarExpanded = (state: RootState) => state.searchbar.isExpanded;
Copy link
Contributor

@utas-raymondng utas-raymondng Oct 24, 2024

Choose a reason for hiding this comment

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

Is it necessary to use store to remember state of the component? Can we determine it by text inside and then use similar approach as the map expand which signal the component event?

You can find code in map.tsx, that is you try to observer a component resize and act accordingly

  // Create a resize observer to the canvas so we know if its size have changed
  // and we need to redraw the map
  const resizeObserver = new ResizeObserver((entries) =>
    // https://stackoverflow.com/questions/70533564/mapbox-gl-flickers-when-resizing-the-container-div
    setTimeout(() => map.resize(), 0.1)
  );
  resizeObserver.observe(map.getContainer());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems I made things complicated...I removed the change in redux and mange the search bar width in Header. Thanks!

@NekoLyn
Copy link
Contributor Author

NekoLyn commented Oct 25, 2024

One comment on using store

And is there a ticket to followup the theme and constant color code, if yes please put a link here, else please raise one thanks

I will raise a ticket to refactor all the style constants in one file for next iteration. Thanks Raymond!

Copy link
Contributor

@utas-raymondng utas-raymondng left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@utas-raymondng utas-raymondng merged commit 0f3d309 into main Oct 25, 2024
3 checks passed
@NekoLyn NekoLyn deleted the feature/5760-update-search-bar-to-latest-UI-design branch October 25, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants