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: allows to override ProductCard of CrossSellingShelf #2280

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

tiago-freire
Copy link
Contributor

What's the purpose of this pull request?

The override component __experimentalProductCard doesn't work because overriden definitions of CrossSellingShelf section doesn't extend ProductShelf section overriden definitions.

The proposal follows a pattern already coded at OverriddenDefaultProductGallery.ts and OverriddenDefaultProductShelf.ts.

How it works?

Extends CrossSellingShelf section overriden definitions with ProductShelf section overriden definitions.

How to test it?

Override CrossSellingShelf section creating a file src/components/overrides/CrossSellingShelf.tsx like this:

import { SectionOverride } from "@faststore/core";
import CustomProductCard from "./CustomProductCard";

const SECTION = "CrossSellingShelf" as const;

const override: SectionOverride = {
  section: SECTION,
  components: {
    __experimentalProductCard: {
      Component: CustomProductCard,
    },
  },
};

export { override };

The CustomProductCard custom component must works as expected after changes of this PR.

@tiago-freire tiago-freire requested a review from a team as a code owner April 8, 2024 01:45
@tiago-freire tiago-freire requested review from icazevedo and eduardoformiga and removed request for a team April 8, 2024 01:45
Copy link

vercel bot commented Apr 8, 2024

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

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 9:01pm

Copy link

codesandbox-ci bot commented Apr 8, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

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

Hey Tiago, thanks for your contribution ⭐.

I took the liberty to add some changes (here, and here) in this PR just to keep the pattern from the other files, ok?

Also, I noticed that this code that you mentioned in the PR description is regarding the Section Override v1. FastStore is currently using the Section Overrides v2, and although it's compatible with v1, we discourage following the v1. The documentation for v2 is in progress, But you can see some examples here in this preview doc or in this PR:

I'll follow with the merge workflow of this PR :)

@eduardoformiga eduardoformiga merged commit 0bb867e into vtex:main Apr 23, 2024
6 checks passed
@tiago-freire
Copy link
Contributor Author

Hey Tiago, thanks for your contribution ⭐.

I took the liberty to add some changes (here, and here) in this PR just to keep the pattern from the other files, ok?

Also, I noticed that this code that you mentioned in the PR description is regarding the Section Override v1. FastStore is currently using the Section Overrides v2, and although it's compatible with v1, we discourage following the v1. The documentation for v2 is in progress, But you can see some examples here in this preview doc or in this PR:

I'll follow with the merge workflow of this PR :)

Thank's @eduardoformiga

I'm going to update to Section Overrides v2 based on the mentioned examples.

@tiago-freire tiago-freire deleted the patch-1 branch April 24, 2024 01:07
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.

None yet

2 participants