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: Composed Product Details #41

Merged
merged 2 commits into from
Oct 14, 2023
Merged

feat: Composed Product Details #41

merged 2 commits into from
Oct 14, 2023

Conversation

tlgimenes
Copy link
Contributor

This PR removes the ProductDetails.tsx section and breaks into its main components. The goal is to compose these components in our CMS to recreate ProductDetails.tsx without any code. With this, we are able to create other variants of ProductDetails and image galleries without ever touching the code.

This PR introduces 4 new Layout sections, Flex.tsx, Grid.tsx, Container.tsx and GridItem.tsx, alongside 5 new Product sections, ProductInfo.tsx, NotFound.tsx, NotFoundChallenge.tsx, ImageGallerySlider.tsx and ImageGalleryFrontBack.tsx.

With these sections, I was able to reproduce the current production ProductDetails.tsx section by composing these sections in our CMS.

Guidelines:

You may be asking yourself: "why create Product sections when we could compose everything on the CMS?". This is because there's a tradeoff between creating UIs on code vs creating UIs on the CMS. For instance, I'd love to have Flex and Grid on the CMS for composing complex building blocks, but I don't want to waist time composing how and where zoom buttons will appear. For this, our current guidelines are the following.

  1. Create complex sections using code (TypeScript)
  2. Compose these sections using flex/grid on the CMS

These complex sections are:

  1. Product Info
  2. Image Gallery

Adding new ImageGallery.

To add a new image gallery, create a new section and start from the Poduct Details template at Gallery.tsx

@tlgimenes tlgimenes merged commit ec3329e into main Oct 14, 2023
@tlgimenes tlgimenes deleted the feat/product-details-page branch October 14, 2023 17:31
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.

1 participant