Skip to content

Commit b787f6e

Browse files
committed
isManualDimensions -> hasDimensionOverrides
1 parent 0f1d35c commit b787f6e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/components/docImage/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ export default function DocImage({
105105
const manualHeight = parseDimension(propsHeight);
106106

107107
// If either width or height is specified manually, ignore any hash dimensions entirely
108-
const isManual = manualWidth != null || manualHeight != null;
109-
const hashDimensions = isManual ? [] : parseDimensionsFromHash(src);
108+
const hasDimensionOverrides = manualWidth != null || manualHeight != null;
109+
const hashDimensions = hasDimensionOverrides ? [] : parseDimensionsFromHash(src);
110110

111111
const inferredWidth = hashDimensions[0] > 0 ? hashDimensions[0] : undefined;
112-
const width = isManual ? manualWidth : inferredWidth;
112+
const width = hasDimensionOverrides ? manualWidth : inferredWidth;
113113

114114
const inferredHeight = hashDimensions[1] > 0 ? hashDimensions[1] : undefined;
115-
const height = isManual ? manualHeight : inferredHeight;
115+
const height = hasDimensionOverrides ? manualHeight : inferredHeight;
116116

117117
return (
118118
<ImageLightbox
@@ -121,7 +121,7 @@ export default function DocImage({
121121
imgPath={imgPath}
122122
width={width}
123123
height={height}
124-
isManualDimensions={isManual}
124+
hasDimensionOverrides={hasDimensionOverrides}
125125
alt={props.alt ?? ''}
126126
/>
127127
);

src/components/imageLightbox/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ interface ImageLightboxProps
1414
alt: string;
1515
imgPath: string;
1616
src: string;
17+
hasDimensionOverrides?: boolean;
1718
height?: number;
18-
isManualDimensions?: boolean;
1919
width?: number;
2020
}
2121

@@ -55,7 +55,7 @@ export function ImageLightbox({
5555
width,
5656
height,
5757
imgPath,
58-
isManualDimensions = false,
58+
hasDimensionOverrides: hasDimensionOverrides = false,
5959
style,
6060
className,
6161
...props
@@ -104,7 +104,7 @@ export function ImageLightbox({
104104
// - If manual: set only provided dimension(s); missing one becomes 'auto'
105105
// - Else: default responsive
106106
const imageStyle = isInline
107-
? isManualDimensions
107+
? hasDimensionOverrides
108108
? {
109109
width: width != null ? `${width}px` : 'auto',
110110
height: height != null ? `${height}px` : 'auto',

0 commit comments

Comments
 (0)