diff --git a/app/components/product-form/product-media.tsx b/app/components/product-form/product-media.tsx index e8b5a10..44d884f 100644 --- a/app/components/product-form/product-media.tsx +++ b/app/components/product-form/product-media.tsx @@ -39,12 +39,12 @@ export function ProductMedia(props: ProductMediaProps) { }, }; - let [activeInd, setAcitveInd] = useState(0); - const [sliderRef, instanceRef] = useKeenSlider({ + let [activeInd, setActiveInd] = useState(0); + let [sliderRef, instanceRef] = useKeenSlider({ ...slideOptions, - slideChanged(slider) { + slideChanged: (slider) => { let pos = slider.track.details.rel; - setAcitveInd(pos); + setActiveInd(pos); let maxThumbnailIndex = thumbnailInstance.current?.track.details.maxIdx || 0; let thumbnailNext = Math.min( @@ -54,19 +54,18 @@ export function ProductMedia(props: ProductMediaProps) { thumbnailInstance.current?.moveToIdx(thumbnailNext); }, }); - let moveToIdx = useCallback( - (idx: number) => { - setAcitveInd(idx); - if (instanceRef.current) { - instanceRef.current.moveToIdx(idx); - } - }, - [instanceRef], - ); - const [thumbnailRef, thumbnailInstance] = useKeenSlider(thumbnailOptions); - let handleClickThumbnail = (idx: number) => { + + function moveToIdx(idx: number) { + setActiveInd(idx); + if (instanceRef.current) { + instanceRef.current.moveToIdx(idx); + } + } + + let [thumbnailRef, thumbnailInstance] = useKeenSlider(thumbnailOptions); + function handleClickThumbnail(idx: number) { moveToIdx(idx); - }; + } useEffect(() => { // instanceRef.current?.update(slideOptions); @@ -77,13 +76,12 @@ export function ProductMedia(props: ProductMediaProps) { }); moveToIdx(selectedInd); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [selectedVariant?.id, moveToIdx]); + }, [selectedVariant?.id]); + return (
Create your password to activate your account.
- {/* TODO: Add onSubmit to validate _before_ submission with native? */} - -- If that email address is in our system, you will receive an email - with instructions about how to reset your password in a few - minutes. -
- > - ) : ( - <> -- Enter your email to reset your password -
- {/* TODO: Add onSubmit to validate _before_ submission with native? */} - - > - )} -Enter a new password for your account.
- {/* TODO: Add onSubmit to validate _before_ submission with native? */} - -Product title
+0.00 $
+Please select product
+{ProductTittle}
{`${ProductPrice} ${ProductCurrency}`}
+ {product.handle && See details}