mirror of
https://github.com/usememos/memos.git
synced 2024-12-20 17:51:50 +03:00
chore: remove lazy loading image
This commit is contained in:
parent
7da10cd367
commit
a60d4dee41
@ -1,24 +0,0 @@
|
|||||||
import showPreviewImageDialog from "./PreviewImageDialog";
|
|
||||||
import "@/less/image.less";
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
imgUrls: string[];
|
|
||||||
index: number;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Image: React.FC<Props> = (props: Props) => {
|
|
||||||
const { className, imgUrls, index } = props;
|
|
||||||
|
|
||||||
const handleImageClick = () => {
|
|
||||||
showPreviewImageDialog(imgUrls, index);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={"image-container " + className} onClick={handleImageClick}>
|
|
||||||
<img src={imgUrls[index]} decoding="async" loading="lazy" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Image;
|
|
@ -49,7 +49,6 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
|
|||||||
src={getResourceUrl(imageResourceList[0])}
|
src={getResourceUrl(imageResourceList[0])}
|
||||||
onClick={() => handleImageClick(getResourceUrl(imageResourceList[0]))}
|
onClick={() => handleImageClick(getResourceUrl(imageResourceList[0]))}
|
||||||
decoding="async"
|
decoding="async"
|
||||||
loading="lazy"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@ -71,7 +70,6 @@ const MemoResourceListView: React.FC<Props> = (props: Props) => {
|
|||||||
src={resource.externalLink ? url : url + "?thumbnail=1"}
|
src={resource.externalLink ? url : url + "?thumbnail=1"}
|
||||||
onClick={() => handleImageClick(url)}
|
onClick={() => handleImageClick(url)}
|
||||||
decoding="async"
|
decoding="async"
|
||||||
loading="lazy"
|
|
||||||
/>
|
/>
|
||||||
</SquareDiv>
|
</SquareDiv>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user