Skip to content

Commit 4e04898

Browse files
Merge pull request #7672 from Bharath314/remove-react-loadable
[Dependencies] Remove react loadable
2 parents 47968db + d89b102 commit 4e04898

3 files changed

Lines changed: 47 additions & 56 deletions

File tree

package-lock.json

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
"react-debounce-input": "^3.3.0",
9393
"react-dom": "^18.2.0",
9494
"react-intersection-observer": "^10.0.3",
95-
"react-loadable": "^5.5.0",
9695
"react-modal": "^3.16.3",
9796
"react-player": "^2.12.0",
9897
"react-select": "^5.10.0",

src/pages/community/calendar.js

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,67 @@
11
import React from "react";
22
import SEO from "../../components/seo";
33

4-
5-
import Loadable from "react-loadable";
4+
import loadable from "@loadable/component";
65
import Loader from "./Loader.style";
76
import LoadingIcon from "../../assets/images/LoadingIcon";
87
import FullCalendar from "@fullcalendar/react";
98
import dayGridPlugin from "@fullcalendar/daygrid";
109
import { Container } from "../../reusecore/Layout";
1110
import CalendarStyleWrapper from "../../sections/Community/Calendar/calendar.style";
1211
import PageHeader from "../../reusecore/PageHeader";
13-
const LoadableCalendar = Loadable({
14-
loader: () => import("../../sections/Community/Calendar"),
15-
loading() {
16-
return (
17-
<Loader>
18-
<div className="loading-modal">
19-
<LoadingIcon />
20-
</div>
21-
<div className="calender">
22-
<CalendarStyleWrapper>
23-
<PageHeader
24-
title="Community Calendar"
25-
path="Community > Calendar"
26-
subtitle="Join any or all of the weekly meetings"
27-
/>
28-
<Container>
29-
<div className="calendar-wrapper">
30-
<div className="calendar-grid">
31-
<FullCalendar
32-
plugins={[dayGridPlugin]}
33-
initialView="dayGridMonth"
34-
contentHeight={700}
35-
headerToolbar={{
36-
left: "prev,next today",
37-
center: "title",
38-
right: "addToCalendar",
39-
}}
40-
/>
41-
</div>
42-
</div>
43-
</Container>
44-
</CalendarStyleWrapper>
45-
</div>
46-
</Loader>
47-
);
12+
13+
const calendarFallback = (
14+
<Loader>
15+
<div className="loading-modal">
16+
<LoadingIcon />
17+
</div>
18+
<div className="calender">
19+
<CalendarStyleWrapper>
20+
<PageHeader
21+
title="Community Calendar"
22+
path="Community > Calendar"
23+
subtitle="Join any or all of the weekly meetings"
24+
/>
25+
<Container>
26+
<div className="calendar-wrapper">
27+
<div className="calendar-grid">
28+
<FullCalendar
29+
plugins={[dayGridPlugin]}
30+
initialView="dayGridMonth"
31+
contentHeight={700}
32+
headerToolbar={{
33+
left: "prev,next today",
34+
center: "title",
35+
right: "addToCalendar",
36+
}}
37+
/>
38+
</div>
39+
</div>
40+
</Container>
41+
</CalendarStyleWrapper>
42+
</div>
43+
</Loader>
44+
);
45+
46+
const LoadableCalendar = loadable(
47+
() => import("../../sections/Community/Calendar"),
48+
{
49+
fallback: calendarFallback,
4850
},
49-
});
51+
);
5052
const CalendarPage = () => {
5153
return (
5254
<>
5355
<LoadableCalendar />
54-
5556
</>
5657
);
5758
};
5859
export default CalendarPage;
5960
export const Head = () => {
60-
return <SEO
61-
title="Layer5 Events Calendar"
62-
description="Join any or all of the Layer5 community meetings."
63-
/>;
64-
};
61+
return (
62+
<SEO
63+
title="Layer5 Events Calendar"
64+
description="Join any or all of the Layer5 community meetings."
65+
/>
66+
);
67+
};

0 commit comments

Comments
 (0)