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:
parent
50f561de96
commit
71764af45f
1 changed files with 9 additions and 5 deletions
|
@ -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')}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue