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

added lazy loading to NodeImageSwiperBlock

This commit is contained in:
Fedor Katurov 2022-12-06 21:00:37 +06:00
parent 991f829216
commit 10bb6f01b5
17 changed files with 210 additions and 106 deletions

View file

@ -5,7 +5,7 @@ import classNames from 'classnames';
import { ImageWithSSRLoad } from '~/components/common/ImageWithSSRLoad';
import { Square } from '~/components/common/Square';
import { Icon } from '~/components/input/Icon';
import { ImagePresets } from '~/constants/urls';
import { imagePresets } from '~/constants/urls';
import { useColorGradientFromString } from '~/hooks/color/useColorGradientFromString';
import { useGotoNode } from '~/hooks/node/useGotoNode';
import { INode } from '~/types';
@ -42,7 +42,7 @@ const NodeRelatedItem: FC<IProps> = memo(({ item }) => {
const thumb = useMemo(
() =>
item.thumbnail
? getURL({ url: item.thumbnail }, ImagePresets.avatar)
? getURL({ url: item.thumbnail }, imagePresets.avatar)
: '',
[item],
);
@ -68,7 +68,7 @@ const NodeRelatedItem: FC<IProps> = memo(({ item }) => {
}, [width]);
const image = useMemo(
() => getURL({ url: item.thumbnail }, ImagePresets.avatar),
() => getURL({ url: item.thumbnail }, imagePresets.avatar),
[item.thumbnail],
);