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(vital-carousel): PDP Carousel #2204

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

hvanyo
Copy link
Collaborator

@hvanyo hvanyo commented Aug 16, 2023

Changes

Test Instructions

Related Issues

@vercel
Copy link

vercel bot commented Aug 16, 2023

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

Name Status Preview Comments Updated (UTC)
bodiless-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 9:33pm
bodiless-js-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 9:33pm
bodiless-js-gatsby ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 9:33pm
bodiless-js-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 9:33pm
bodiless-js-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 9:33pm

@vercel
Copy link

vercel bot commented Aug 16, 2023

@hvanyo is attempting to deploy a commit to the JNJ Demo Account Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

Thank you for creating a pull request on GitHub! We appreciate your contribution to our repository.

In order to enable our tests to run on your changes, we kindly ask that you wait until one of our repository members adds the ready-to-test label to your pull request. (Please request on the GitHub issue you are addressing.) This will ensure that our testing process runs smoothly and we can quickly verify the changes you've made.

Thank you for your understanding and we look forward to reviewing your changes soon!

@@ -62,6 +71,14 @@ export const sliderSimpleInit = (sliderSimpleElement: HTMLElement) => {
const NumThumbs = 4;
for (const button of Array.from(buttonsThumbs)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this code be under the if (sliderThumbCarousel.length !== 0) {...} condition above? There is no need to add controls if there are no thumbs, right? Or is it still has to present?

Also if the condition above is not met, then this line might error since buttonsThumbs will be undefined in Array.from(buttonsThumbs)

Array.from(buttonsThumbs) could also be saved to a var and reused for a tiny speed bump: https://github.com/johnsonandjohnson/Bodiless-JS/pull/2204/files#diff-6c6a78fcbd165e433925aac71d373a5d6284eabbdf275a4825969bc59913afe7R52.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@VancheeZze I think this code is under the condition in line 46.
The typescript version only runs on edit so performance doesn't matter.
The non-typescript javascript version runs on static and reuses buttonsThumbs array with typescript cast.
I learned the lesson the hardway that browser doesn't like to run typescript'ed javascript :)

@@ -103,14 +117,15 @@ const Default = asPDPTemplateToken({
},
Layout: {
ContentWrapper: 'flex flex-wrap',
ProductImageWrapper: 'flex justify-center w-full lg:w-1/2',
ProductCarouselWrapper: 'lg:w-1/2',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this ProductCarouselWrapper be hidden on mobile and only be visible on desktop — opposite from the MobileProductCarouselWrapper below?

Copy link
Collaborator Author

@hvanyo hvanyo Aug 22, 2023

Choose a reason for hiding this comment

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

@VancheeZze I was letting component tokens in line 92 / 99 do the responsive hiding. I had to add the lg:hidden on line 121 though otherwise it screwed up the flex box lg w-1/2 on desktop. As i made the change, I pondered if the way we should do this was by wrapper on template or by the reponsive token.. Opinions?

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