Skip to content

Commit 19db25b

Browse files
committed
cleanup
1 parent 37fd8ce commit 19db25b

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

src/components/docImage.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ export default function DocImage({
1919
// Handle external images early - pass through without processing
2020
if (src.startsWith('http')) {
2121
// 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+
3533
return (
3634
<DocImageClient
3735
src={src}

src/components/docImageClient.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export function DocImageClient({
2828
// Check if dimensions are valid (not NaN) for Next.js Image
2929
const isValidDimensions = !isNaN(width) && !isNaN(height) && width > 0 && height > 0;
3030

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) {
3333
const handleClick = () => {
3434
// Always open image in new tab
3535
const url = src.startsWith('http') ? src : imgPath;

src/components/imageLightbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function ImageLightbox({
5353

5454
<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%]">
5555
{/* 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">
5757
<X className="h-4 w-4" />
5858
<span className="sr-only">Close</span>
5959
</Dialog.Close>

0 commit comments

Comments
 (0)