mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 15:06:59 +00:00
Add Zoom into product view images
This commit is contained in:
parent
23a818a57a
commit
0d11232b3d
@ -12,6 +12,7 @@ import ProductSidebar from '../ProductSidebar'
|
|||||||
import ProductTag from '../ProductTag'
|
import ProductTag from '../ProductTag'
|
||||||
import ProductModel from '../ProductModel/ProductModel'
|
import ProductModel from '../ProductModel/ProductModel'
|
||||||
import Lightbox from 'yet-another-react-lightbox'
|
import Lightbox from 'yet-another-react-lightbox'
|
||||||
|
import Zoom from "yet-another-react-lightbox/plugins/zoom";
|
||||||
import 'yet-another-react-lightbox/styles.css'
|
import 'yet-another-react-lightbox/styles.css'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import random from 'lodash.random'
|
import random from 'lodash.random'
|
||||||
@ -89,6 +90,7 @@ const ProductView: FC<ProductViewProps> = ({ product, relatedProducts }) => {
|
|||||||
</ProductSlider>
|
</ProductSlider>
|
||||||
<Lightbox
|
<Lightbox
|
||||||
open={isLightboxOpen}
|
open={isLightboxOpen}
|
||||||
|
plugins={[Zoom]}
|
||||||
close={() => setLightboxOpen(false)}
|
close={() => setLightboxOpen(false)}
|
||||||
slides={product.images.map((image) => {
|
slides={product.images.map((image) => {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user