Skip to content

Commit 6623a7f

Browse files
committed
Bug Fix: remove react-lazyload library
1 parent 314397b commit 6623a7f

File tree

4 files changed

+10
-98
lines changed

4 files changed

+10
-98
lines changed

package-lock.json

+1-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"react-app-polyfill": "^2.0.0",
4747
"react-bootstrap": "^2.4.0",
4848
"react-dom": "^17.0.2",
49-
"react-lazyload": "^3.2.0",
5049
"react-paginate": "^7.1.5",
5150
"react-redux": "^7.2.8",
5251
"react-router-dom": "^5.3.3",

src/pages/Search/CrossValuesTable.js

+2-37
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React, { useState } from 'react';
22
import styled from 'styled-components';
33
import { Container, Row, Col, Table, Tab, Nav, Collapse} from 'react-bootstrap';
4-
import LazyLoad from 'react-lazyload';
54
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6-
import { faPlus, faMinus, faAngleUp, faAngleDown, faSpinner} from '@fortawesome/free-solid-svg-icons';
7-
import { getHighlightObj, sortSynonyms, browserDetection } from '../../shared';
5+
import { faPlus, faMinus, faAngleUp, faAngleDown } from '@fortawesome/free-solid-svg-icons';
6+
import { getHighlightObj, sortSynonyms } from '../../shared';
87

98
const ContainerStyled = styled(Container)`
109
font-size: 1rem;
@@ -145,13 +144,6 @@ const TableStyled = styled(Table)`
145144
margin-bottom: 0;
146145
`;
147146

148-
const RowCenter = styled(Row)`
149-
height: 250px;
150-
align-content: center;
151-
justify-content: center;
152-
color: #888;
153-
`;
154-
155147
const CrossValuesTable = (props) => {
156148
let items = JSON.parse(JSON.stringify(props.values));
157149
let values = [];
@@ -427,14 +419,6 @@ const CrossValuesTable = (props) => {
427419
})
428420
});
429421

430-
const PlaceholderComponent = () => {
431-
return (<Col sm={12}>
432-
<RowCenter>
433-
<FontAwesomeIcon icon={faSpinner} spin size="2x"/>
434-
</RowCenter>
435-
</Col>);
436-
}
437-
438422
const TableSynonyms = (props) => {
439423
if (props.synonyms !== undefined) {
440424
return props.synonyms.map((item, index) =>
@@ -785,14 +769,6 @@ const CrossValuesTable = (props) => {
785769
);
786770
}
787771

788-
const LazyLoadContainer = (props) => {
789-
return (
790-
<LazyLoad height={250} once overflow={true} offset={270} key={props.index} placeholder={<PlaceholderComponent />} classNamePrefix="lazyload-cross">
791-
{props.children}
792-
</LazyLoad>
793-
);
794-
}
795-
796772
if (crossValues.length !== 0) {
797773
return (
798774
<ContainerStyled>
@@ -815,22 +791,11 @@ const CrossValuesTable = (props) => {
815791
</Col>
816792
</TableThead>
817793
<TableBody>
818-
{(crossValues.length < 25 || browserDetection.isEdge)
819-
?
820794
<Col xs={12}>
821795
{crossValues.map((cross, index) =>
822796
<ValuesItemsContainer cross={cross} key={index} />
823797
)}
824798
</Col>
825-
:
826-
<Col xs={12}>
827-
{crossValues.map((cross, index) =>
828-
<LazyLoadContainer key={index}>
829-
<ValuesItemsContainer cross={cross} key={index}/>
830-
</LazyLoadContainer>
831-
)}
832-
</Col>
833-
}
834799
</TableBody>
835800
</ContainerStyled>
836801
);

src/pages/Search/GDCValuesTable.js

+7-43
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React, { useState } from 'react';
22
import styled from 'styled-components';
33
import { Container, Row, Col, Table, Tab, Nav, Collapse} from 'react-bootstrap';
4-
import LazyLoad from 'react-lazyload';
54
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6-
import { faPlus, faMinus, faAngleUp, faAngleDown, faSpinner} from '@fortawesome/free-solid-svg-icons';
7-
import { getHighlightObj, sortAlphabetically, sortSynonyms, browserDetection } from '../../shared';
5+
import { faPlus, faMinus, faAngleUp, faAngleDown} from '@fortawesome/free-solid-svg-icons';
6+
import { getHighlightObj, sortAlphabetically, sortSynonyms } from '../../shared';
87

98
const ContainerStyled = styled(Container)`
109
font-size: 1rem;
@@ -105,14 +104,6 @@ const IndicatorContent = styled.div`
105104
transform: translateY(-50%);
106105
`;
107106

108-
const RowCenter = styled(Row)`
109-
height: 180px;
110-
align-content: center;
111-
justify-content: center;
112-
color: #888;
113-
`;
114-
115-
116107
const GDCValuesTable = (props) => {
117108
let items = JSON.parse(JSON.stringify(props.values));
118109
let values = [];
@@ -210,14 +201,6 @@ const GDCValuesTable = (props) => {
210201
}
211202
});
212203

213-
const PlaceholderComponent = () => {
214-
return (<Col sm={12}>
215-
<RowCenter>
216-
<FontAwesomeIcon icon={faSpinner} spin size="2x"/>
217-
</RowCenter>
218-
</Col>);
219-
}
220-
221204
const TableSynonyms = (props) => {
222205
if (props.synonyms !== undefined) {
223206
return props.synonyms.map((item, index) =>
@@ -495,14 +478,6 @@ const GDCValuesTable = (props) => {
495478
);
496479
}
497480

498-
const LazyLoadContainer = (props) => {
499-
return (
500-
<LazyLoad height={180} once overflow={true} offset={200} key={props.index} placeholder={<PlaceholderComponent />} classNamePrefix="lazyload-gdc">
501-
{props.children}
502-
</LazyLoad>
503-
);
504-
}
505-
506481
if (values.length !== 0) {
507482
return (
508483
<ContainerStyled>
@@ -515,22 +490,11 @@ const GDCValuesTable = (props) => {
515490
</Col>
516491
</TableThead>
517492
<TableBody>
518-
{(values.length < 6 || browserDetection.isEdge)
519-
?
520-
<Col xs={12}>
521-
{values.map((item, index) =>
522-
<ValueItem item={item} key={index} />
523-
)}
524-
</Col>
525-
:
526-
<Col xs={12}>
527-
{values.map((item, index) =>
528-
<LazyLoadContainer key={index}>
529-
<ValueItem item={item} key={index}/>
530-
</LazyLoadContainer>
531-
)}
532-
</Col>
533-
}
493+
<Col xs={12}>
494+
{values.map((item, index) =>
495+
<ValueItem item={item} key={index} />
496+
)}
497+
</Col>
534498
</TableBody>
535499
</ContainerStyled>
536500
);

0 commit comments

Comments
 (0)