1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

(nextjs) fixed image preloaders for SSR

This commit is contained in:
Fedor Katurov 2022-01-19 10:04:23 +07:00
parent 7e14b52bf9
commit d30cad9caa
4 changed files with 27 additions and 2 deletions

View file

@ -8,6 +8,7 @@ import { getURL, getURLFromString } from '~/utils/dom';
import { useColorGradientFromString } from '~/hooks/color/useColorGradientFromString';
import { Square } from '~/components/common/Square';
import { useGotoNode } from '~/hooks/node/useGotoNode';
import { ImageWithSSRLoad } from '~/components/common/ImageWithSSRLoad';
type IProps = {
item: Partial<INode>;
@ -89,7 +90,7 @@ const NodeRelatedItem: FC<IProps> = memo(({ item }) => {
</div>
)}
<img src={image} alt="loader" onLoad={() => setIsLoaded(true)} />
<ImageWithSSRLoad src={image} alt="loader" onLoad={() => setIsLoaded(true)} />
</div>
);
});