Skip to content

Commit 2a4badc

Browse files
fix: medium-zoom small images
1 parent cfbfcc1 commit 2a4badc

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/react-notion-x/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"watch": "tsup --watch --silent --onSuccess 'echo build successful'"
2323
},
2424
"dependencies": {
25+
"@fisch0920/medium-zoom": "^1.0.7",
2526
"@matejmazur/react-katex": "^3.1.3",
2627
"@radix-ui/react-dropdown-menu": "^0.1.6",
27-
"medium-zoom": "^1.0.6",
2828
"notion-types": "^6.7.0",
2929
"notion-utils": "^6.9.3-6.10.0-alpha.0.0",
3030
"prismjs": "^1.27.0",

packages/react-notion-x/src/renderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react'
2-
import mediumZoom from 'medium-zoom'
2+
import mediumZoom from '@fisch0920/medium-zoom'
33
import { ExtendedRecordMap } from 'notion-types'
44

55
import {
@@ -79,6 +79,7 @@ export const NotionRenderer: React.FC<{
7979
typeof window !== 'undefined' &&
8080
mediumZoom({
8181
background: 'rgba(0, 0, 0, 0.8)',
82+
minZoomScale: 2.0,
8283
margin: getMediumZoomMargin()
8384
}),
8485
[]
@@ -121,7 +122,6 @@ export const NotionBlockRenderer: React.FC<{
121122
blockId?: string
122123
hideBlockId?: boolean
123124
level?: number
124-
zoom?: any
125125
}> = ({ level = 0, blockId, ...props }) => {
126126
const { recordMap } = useNotionContext()
127127
const id = blockId || Object.keys(recordMap.block)[0]

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,11 @@
11601160
minimatch "^3.0.4"
11611161
strip-json-comments "^3.1.1"
11621162

1163+
"@fisch0920/medium-zoom@^1.0.7":
1164+
version "1.0.7"
1165+
resolved "https://registry.yarnpkg.com/@fisch0920/medium-zoom/-/medium-zoom-1.0.7.tgz#46b09b40a1be796f7ff13ea594973e1f1d3c66f6"
1166+
integrity sha512-hPUrgVM/QvsZdZzDTPyL1C1mOtEw03RqTLmK7ZlJ8S/64u4O4O5BvPvjB/9kyLtE6iVaS9UDRAMSwmM9uh2JIw==
1167+
11631168
"@gar/promisify@^1.0.1":
11641169
version "1.1.2"
11651170
resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz"
@@ -9276,11 +9281,6 @@ [email protected]:
92769281
resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
92779282
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
92789283

9279-
medium-zoom@^1.0.6:
9280-
version "1.0.6"
9281-
resolved "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.0.6.tgz"
9282-
integrity sha512-UdiUWfvz9fZMg1pzf4dcuqA0W079o0mpqbTnOz5ip4VGYX96QjmbM+OgOU/0uOzAytxC0Ny4z+VcYQnhdifimg==
9283-
92849284
mem@^9.0.2:
92859285
version "9.0.2"
92869286
resolved "https://registry.npmjs.org/mem/-/mem-9.0.2.tgz"

0 commit comments

Comments
 (0)