-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Applies next/dynamic for SearchInput & adjustments (#2550)
## What's the purpose of this pull request? - Uses dynamic to import `SearchDropdown` and `UISearchInputField` **note**: I'm not using dynamic import for UISearchInput because the searchRef is used in the [useOnClickOutside](https://github.com/vtex/faststore/blob/5cbeb9bb9b67371aa23b6e5ca51d582629dfb6d3/packages/core/src/sdk/ui/useOnClickOutside.ts#L13). If the component isn’t rendered yet and we click on the screen, the ref isn’t available, which could cause an error. To avoid changing the code and introducing this issue, I've chosen not to use dynamic import here. Any other opinion here? ## How to test it? Test using the [preview](https://sfj-91e9bbc--starter.preview.vtex.app) or running local ### testing on mobile screen size (Moto G Power): - you should be able to see the magnify glass icon button - click on it and search for a term - this should have the same behavior as before (excluding a small animation effect) <img width="300" alt="image" src="https://github.com/user-attachments/assets/863df01a-abb7-4543-8376-4ac0f220379f"> <img width="300" alt="image" src="https://github.com/user-attachments/assets/af20d4d3-39c6-4202-a874-a07776100475"> ### testing on desktop: - click on the SearchInput and search for a term - this should have the same behavior as before <img width="500" alt="image" src="https://github.com/user-attachments/assets/1ac364b7-4a89-4c20-b6bd-adf9cd730776"> ### Starters Deploy Preview vtex-sites/starter.store#606 ## Reference [POC](https://github.com/vtex/faststore/pull/2404/files#diff-c85fe4be6105c2f443716ac80824c04e5455fdc63a731e79b72638cd785eee89)
- Loading branch information
1 parent
5cbeb9b
commit bc17e46
Showing
4 changed files
with
96 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
6 changes: 3 additions & 3 deletions
6
packages/core/src/components/navigation/NavbarLinks/NavbarLinks.tsx
This file contains 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
This file contains 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
This file contains 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