Move ImageActions component from ImageLarge.tsx to PhotoLarge.tsx and revert ImageProps
This commit is contained in:
parent
a64240f3ad
commit
6f924a7bb1
@ -1,25 +1,18 @@
|
||||
import { IMAGE_WIDTH_LARGE, ImageProps } from '.';
|
||||
import ImageWithFallback from './ImageWithFallback';
|
||||
import ImageActions from './ImageActions';
|
||||
|
||||
export default function ImageLarge(props: ImageProps) {
|
||||
const {
|
||||
aspectRatio,
|
||||
blurCompatibilityMode,
|
||||
enableImageActions = false,
|
||||
...rest
|
||||
} = props;
|
||||
return (
|
||||
<ImageActions
|
||||
enableImageActions={enableImageActions}
|
||||
className="flex relative items-center justify-center h-full"
|
||||
>
|
||||
<ImageWithFallback {...{
|
||||
...rest,
|
||||
blurCompatibilityLevel: blurCompatibilityMode ? 'high' : 'none',
|
||||
width: IMAGE_WIDTH_LARGE,
|
||||
height: Math.round(IMAGE_WIDTH_LARGE / aspectRatio),
|
||||
}} />
|
||||
</ImageActions>
|
||||
);
|
||||
};
|
||||
@ -14,5 +14,4 @@ export interface ImageProps {
|
||||
alt: string
|
||||
blurDataURL?: string
|
||||
priority?: boolean
|
||||
enableImageActions?: boolean
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ import { useRef } from 'react';
|
||||
import useOnVisible from '@/utility/useOnVisible';
|
||||
import PhotoDate from './PhotoDate';
|
||||
import { useAppState } from '@/state/AppState';
|
||||
import ImageActions from '@/components/image/ImageActions';
|
||||
|
||||
export default function PhotoLarge({
|
||||
photo,
|
||||
@ -136,6 +137,10 @@ export default function PhotoLarge({
|
||||
? 'h-[80%]'
|
||||
: 'h-[90%]',
|
||||
)}>
|
||||
<ImageActions
|
||||
enableImageActions={enableImageActions}
|
||||
className="flex relative items-center justify-center h-full"
|
||||
>
|
||||
<ImageLarge
|
||||
className={clsx(arePhotosMatted && 'h-full')}
|
||||
imgClassName={clsx(arePhotosMatted &&
|
||||
@ -146,8 +151,8 @@ export default function PhotoLarge({
|
||||
blurDataURL={photo.blurData}
|
||||
blurCompatibilityMode={doesPhotoNeedBlurCompatibility(photo)}
|
||||
priority={priority}
|
||||
enableImageActions={enableImageActions}
|
||||
/>
|
||||
</ImageActions>
|
||||
</div>
|
||||
</Link>}
|
||||
contentSide={
|
||||
|
||||
Loading…
Reference in New Issue
Block a user