Skip to content

Commit f570a10

Browse files
Removed node-sass
Replaced react-loadable with React.lazy
1 parent 7a2fb13 commit f570a10

File tree

25 files changed

+715
-1323
lines changed

25 files changed

+715
-1323
lines changed

client/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"final-form": "^4.20.1",
2424
"lodash": "^4.17.20",
2525
"markdown-react-js": "^1.0.2",
26-
"node-sass": "^5.0.0",
2726
"pdfkit-nodejs-webpack": "^0.0.2",
2827
"prop-types": "^15.7.2",
2928
"react": "^17.0.1",
@@ -35,7 +34,6 @@
3534
"react-ga": "^3.2.0",
3635
"react-helmet": "^6.1.0",
3736
"react-live": "^2.2.3",
38-
"react-loadable": "^5.5.0",
3937
"react-redux": "^7.2.2",
4038
"react-scripts": "4.0.0",
4139
"react-sortable-hoc": "^1.11.0",
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const FamPdfViewDialog = React.lazy(() => import('./FamPdfViewDialog'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./FamPdfViewDialog"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable(props) {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<FamPdfViewDialog {...props} />
9+
</Suspense>
10+
</div>
11+
);
12+
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const OrgPdfViewDialog = React.lazy(() => import('./OrgPdfViewDialog'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./OrgPdfViewDialog"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable(props) {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<OrgPdfViewDialog {...props} />
9+
</Suspense>
10+
</div>
11+
);
12+
}

client/src/components/PdfViewDialog/PdfViewDialog.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function PdfViewDialog(props) {
7272
}, []);
7373

7474
return (
75-
isVisible && (
75+
isVisible ? (
7676
<Dialog fullScreen open={isVisible} onClose={onClose}>
7777
<AppBar style={{position: 'relative'}}>
7878
<Toolbar>
@@ -93,8 +93,8 @@ function PdfViewDialog(props) {
9393
<Button variant="contained" color="primary" onClick={onClose}>Close</Button>
9494
</DialogActions>
9595
</Dialog>
96-
)
97-
);
96+
) : <></>
97+
)
9898
}
9999

100100
export default PdfViewDialog;
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const CrossTeamGroup = React.lazy(() => import('./CrossTeamGroup'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./CrossTeamGroup"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable() {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<CrossTeamGroup />
9+
</Suspense>
10+
</div>
11+
);
12+
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const Dependencies = React.lazy(() => import('./Dependencies'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./Dependencies"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable() {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<Dependencies />
9+
</Suspense>
10+
</div>
11+
);
12+
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const DynamicLoading = React.lazy(() => import('./DynamicLoading'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./DynamicLoading"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable() {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<DynamicLoading />
9+
</Suspense>
10+
</div>
11+
);
12+
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const FamilyChartItemsOrdering = React.lazy(() => import('./FamilyChartItemsOrdering'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./FamilyChartItemsOrdering"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable() {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<FamilyChartItemsOrdering />
9+
</Suspense>
10+
</div>
11+
);
12+
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const FamilyChartWithAnnotations = React.lazy(() => import('./FamilyChartWithAnnotations'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./FamilyChartWithAnnotations"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable() {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<FamilyChartWithAnnotations />
9+
</Suspense>
10+
</div>
11+
);
12+
}
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react"
2-
import Loadable from "react-loadable"
1+
import React, { Suspense } from "react"
2+
const FinancialOwnership = React.lazy(() => import('./FinancialOwnership'));
33

4-
const loadable = Loadable({
5-
loader: () => import("./FinancialOwnership"),
6-
loading() {
7-
return <div>Loading...</div>
8-
}
9-
})
10-
11-
export default loadable;
4+
export default function Loadable() {
5+
return (
6+
<div>
7+
<Suspense fallback={<div>Loading...</div>}>
8+
<FinancialOwnership />
9+
</Suspense>
10+
</div>
11+
);
12+
}

0 commit comments

Comments
 (0)