diff --git a/components/product/gallery.tsx b/components/product/gallery.tsx index 3bbb8fd6d..79659096c 100644 --- a/components/product/gallery.tsx +++ b/components/product/gallery.tsx @@ -2,11 +2,12 @@ import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/24/outline'; import { GridTileImage } from 'components/grid/tile'; -import { useProduct } from 'components/product/product-context'; +import { useProduct, useUpdateURL } from 'components/product/product-context'; import Image from 'next/image'; export function Gallery({ images }: { images: { src: string; altText: string }[] }) { const { state, updateImage } = useProduct(); + const updateURL = useUpdateURL(); const imageIndex = state.image ? parseInt(state.image) : 0; const nextImageIndex = imageIndex + 1 < images.length ? imageIndex + 1 : 0; @@ -33,7 +34,10 @@ export function Gallery({ images }: { images: { src: string; altText: string }[]