Skip to content

Commit 222fbb2

Browse files
Refactor DocImage components and improve type ordering
Co-authored-by: paul.jaffre <[email protected]>
1 parent 76137dd commit 222fbb2

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/components/docImage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'path';
22

33
import {serverContext} from 'sentry-docs/serverContext';
4+
45
import {DocImageClient} from './docImageClient';
56

67
export default function DocImage({

src/components/docImageClient.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
'use client';
22

33
import Image from 'next/image';
4+
45
import {ImageLightbox} from './imageLightbox';
56

67
interface DocImageClientProps {
7-
src: string;
8+
alt: string;
9+
height: number;
810
imgPath: string;
11+
src: string;
912
width: number;
10-
height: number;
11-
alt: string;
12-
style?: React.CSSProperties;
1313
className?: string;
14+
style?: React.CSSProperties;
1415
}
1516

1617
export function DocImageClient({
@@ -22,7 +23,7 @@ export function DocImageClient({
2223
style,
2324
className,
2425
}: DocImageClientProps) {
25-
const handleContextMenu = (e: React.MouseEvent) => {
26+
const handleContextMenu = (_e: React.MouseEvent) => {
2627
// Allow right-click to open in new tab
2728
const link = document.createElement('a');
2829
link.href = imgPath;

src/components/imageLightbox.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use client';
22

33
import {useState} from 'react';
4-
import * as Dialog from '@radix-ui/react-dialog';
54
import {X} from 'react-feather';
5+
import * as Dialog from '@radix-ui/react-dialog';
66
import Image from 'next/image';
77

88
interface ImageLightboxProps {
9-
src: string;
109
alt: string;
11-
width: number;
12-
height: number;
1310
children: React.ReactNode;
11+
height: number;
12+
src: string;
13+
width: number;
1414
}
1515

1616
export function ImageLightbox({src, alt, width, height, children}: ImageLightboxProps) {

0 commit comments

Comments
 (0)