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: Filter with next/dynamic #638

Closed
wants to merge 1 commit into from

Conversation

eduardoformiga
Copy link
Member

@eduardoformiga eduardoformiga commented Dec 13, 2024

What's the purpose of this pull request?

This PR applies changes from

Faststore related PRs

@eduardoformiga eduardoformiga requested a review from a team as a code owner December 13, 2024 19:40
Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starter ✅ Ready (Inspect) Visit Preview Dec 13, 2024 7:42pm

eduardoformiga added a commit to vtex/faststore that referenced this pull request Dec 18, 2024
## What's the purpose of this pull request?

This PR involves significant changes to the filter components within the
`ProductGallery` and related files. The main goal is to refactor the
filter functionality by removing the `Filter` component and replacing it
with `FilterDesktop` and `FilterSlider` components. Additionally,
dynamic imports are introduced to optimize loading.

Key changes include:

Refactoring Filter Components:
* Removed the `Filter` component and its associated code from
`Filter.tsx`.
* Updated `FilterDesktop.tsx` to include the GraphQL fragment previously
in `Filter.tsx`.
* Added dynamic imports for `Filter`, `FilterFacetBoolean`,
`FilterFacetBooleanItem`, `FilterFacetRange`, `FilterFacets`, and
`FilterSlider` in `FilterSlider.tsx`.
* Modified `index.ts` to export `FilterDesktop` and `FilterSlider`
instead of the removed `Filter` component.

Dynamic Imports:
* Replaced static imports with dynamic imports for `ProductCard`,
`EmptyGallery`, `FilterDesktop`, and `FilterSlider` in
`DefaultComponents.ts`.

## How to test it?

You can use the preview URL from the starter PR and double check that
some JS are just loaded after Open the Filter in the mobile version.

https://sfj-d705510--starter.preview.vtex.app/office


https://github.com/user-attachments/assets/b830ad60-9496-4fe2-b2c4-2837bfc8b364

### Starters Deploy Preview

- vtex-sites/starter.store#638
@hellofanny
Copy link
Contributor

closing this PR because the changes has already been added.

@hellofanny hellofanny closed this Feb 3, 2025
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