File tree Expand file tree Collapse file tree 3 files changed +14
-16
lines changed Expand file tree Collapse file tree 3 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -19,19 +19,17 @@ export default function DocImage({
19
19
// Handle external images early - pass through without processing
20
20
if ( src . startsWith ( 'http' ) ) {
21
21
// Use provided props or defaults for external images
22
- const width =
23
- typeof propsWidth === 'number'
24
- ? propsWidth
25
- : typeof propsWidth === 'string'
26
- ? parseInt ( propsWidth , 10 ) || 800
27
- : 800 ;
28
- const height =
29
- typeof propsHeight === 'number'
30
- ? propsHeight
31
- : typeof propsHeight === 'string'
32
- ? parseInt ( propsHeight , 10 ) || 600
33
- : 600 ;
34
-
22
+ const width = typeof propsWidth === 'number'
23
+ ? propsWidth
24
+ : typeof propsWidth === 'string'
25
+ ? parseInt ( propsWidth , 10 ) || 800
26
+ : 800 ;
27
+ const height = typeof propsHeight === 'number'
28
+ ? propsHeight
29
+ : typeof propsHeight === 'string'
30
+ ? parseInt ( propsHeight , 10 ) || 800
31
+ : 800 ;
32
+
35
33
return (
36
34
< DocImageClient
37
35
src = { src }
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ export function DocImageClient({
28
28
// Check if dimensions are valid (not NaN) for Next.js Image
29
29
const isValidDimensions = ! isNaN ( width ) && ! isNaN ( height ) && width > 0 && height > 0 ;
30
30
31
- // For external images or invalid dimensions, fall back to regular img tag
32
- if ( src . startsWith ( 'http' ) || ! isValidDimensions ) {
31
+ // For images with invalid dimensions, fall back to regular img tag
32
+ if ( ! isValidDimensions ) {
33
33
const handleClick = ( ) => {
34
34
// Always open image in new tab
35
35
const url = src . startsWith ( 'http' ) ? src : imgPath ;
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export function ImageLightbox({
53
53
54
54
< Dialog . Content className = "image-lightbox-content fixed left-[50%] top-[50%] z-50 max-h-[90vh] max-w-[90vw] translate-x-[-50%] translate-y-[-50%]" >
55
55
{ /* Close button */ }
56
- < Dialog . Close className = "absolute right-4 top-4 z-10 rounded-sm bg-black/50 p-2 text-white opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2" >
56
+ < Dialog . Close className = "absolute right-4 top-4 z-10 rounded-sm bg-black/50 p-2 text-white opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black/50 " >
57
57
< X className = "h-4 w-4" />
58
58
< span className = "sr-only" > Close</ span >
59
59
</ Dialog . Close >
You can’t perform that action at this time.
0 commit comments