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

added lazy loading to flow hero

This commit is contained in:
Fedor Katurov 2022-12-05 18:08:35 +06:00
parent 50f561de96
commit 71764af45f

View file

@ -29,8 +29,11 @@ const autoplay = {
};
const lazy = {
loadPrevNextAmount: 3,
checkInView: false,
enabled: true,
loadPrevNextAmount: 2,
loadOnTransitionStart: true,
loadPrevNext: true,
checkInView: true,
};
export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
@ -130,13 +133,14 @@ export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
onClick={onClick}
followFinger
shortSwipes={false}
watchSlidesProgress
>
{heroes
.filter(node => node.thumbnail)
.map(node => (
.filter((node) => node.thumbnail)
.map((node) => (
<SwiperSlide key={node.id}>
<img
src={getURLFromString(node.thumbnail!, preset)}
data-src={getURLFromString(node.thumbnail!, preset)}
alt=""
className={classNames(styles.preview, 'swiper-lazy')}
/>