Skip to content

Commit

Permalink
Merge pull request #158 from laurentmmeyer/develop
Browse files Browse the repository at this point in the history
F!!: add zoom feature on images to display these fullscreen
  • Loading branch information
styxlab committed Jan 10, 2022
2 parents 2557d38 + 118cf01 commit 5f32aae
Show file tree
Hide file tree
Showing 3 changed files with 484 additions and 167 deletions.
7 changes: 6 additions & 1 deletion components/NextImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Image from 'next/image'
import { ComponentPropsWithNode } from 'rehype-react'
import { Node } from 'unist'
import { Dimensions } from '@lib/images'
import Zoom from 'react-medium-image-zoom'
import 'react-medium-image-zoom/dist/styles.css'


interface PropertyProps {
src: string
Expand All @@ -24,7 +27,9 @@ export const NextImage = (props: ComponentPropsWithNode) => {
return (
<div className="next-image-wrapper">
<div {...{ className }}>
<Image src={src} {...imageDimensions} {...{ className }} alt="" />
<Zoom>
<Image src={src} {...imageDimensions} {...{ className }} alt="" />
</Zoom>
</div>
</div>
)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"react-dom": "17.0.2",
"react-gist": "^1.2.4",
"react-is": "^17.0.2",
"react-medium-image-zoom": "^4.3.5",
"refractor": "^3.3.1",
"rehype": "^11.0.0",
"rehype-react": "^6.2.1",
Expand Down
Loading

1 comment on commit 5f32aae

@vercel
Copy link

@vercel vercel bot commented on 5f32aae Jan 10, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.