Skip to content

Commit

Permalink
lazyload footer images
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiggr committed Feb 20, 2023
1 parent 27e1443 commit a0633c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"dependencies": {
"@eeacms/volto-corsproxy": "*",
"react-countup": "^6.3.0",
"react-lazy-load-image-component": "1.5.6",
"react-slick": "^0.28.1",
"remixicon": "2.5.0",
"slick-carousel": "^1.8.1"
Expand Down
10 changes: 8 additions & 2 deletions src/ui/Footer/FooterSites.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { Grid, Image } from 'semantic-ui-react';
import { LazyLoadComponent } from 'react-lazy-load-image-component';

import PropTypes from 'prop-types';

const Sites = (props) => {
Expand All @@ -11,10 +13,14 @@ const Sites = (props) => {
column.push(
<Grid.Column className="logo" key={i}>
<a className="logo" href={item.link}>
<Image src={item.src} alt={item.alt}></Image>
<LazyLoadComponent>
<Image src={item.src} alt={item.alt}></Image>
</LazyLoadComponent>
</a>
<a className="logo" href={nextItem.link}>
<Image src={nextItem.src} alt={nextItem.alt}></Image>
<LazyLoadComponent>
<Image src={nextItem.src} alt={nextItem.alt}></Image>
</LazyLoadComponent>
</a>
</Grid.Column>,
);
Expand Down
9 changes: 7 additions & 2 deletions src/ui/Footer/SubFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import Footer from './Footer';

import { Grid, Image } from 'semantic-ui-react';
import { LazyLoadComponent } from 'react-lazy-load-image-component';

const SubFooter = (props) => {
if (props.children) {
Expand All @@ -23,7 +24,9 @@ const SubFooter = (props) => {
<div className="item">
<div className={manager.className}>
<a href={manager.link}>
<Image src={manager.src} alt={manager.alt}></Image>
<LazyLoadComponent>
<Image src={manager.src} alt={manager.alt}></Image>
</LazyLoadComponent>
</a>
</div>
</div>
Expand Down Expand Up @@ -53,7 +56,9 @@ const SubFooter = (props) => {
<div className="item">
<div className={manager.className}>
<a href={manager.link}>
<Image src={manager.src} alt={manager.alt}></Image>
<LazyLoadComponent>
<Image src={manager.src} alt={manager.alt}></Image>
</LazyLoadComponent>
</a>
</div>
</div>
Expand Down

0 comments on commit a0633c9

Please sign in to comment.