-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
36 additions
and
210 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import React from "react"; | ||
import About from "./About"; | ||
import FeaturedLessons from "./FeaturedLessons"; | ||
import Testimonials from "./Testimonials"; | ||
import MailingList from "./MailingList"; | ||
import React, { lazy, Suspense } from "react"; | ||
import Loader from "../../../../assets/images/loader.gif"; | ||
|
||
const Container = () => ( | ||
<div className="nav-container"> | ||
<About /> | ||
<FeaturedLessons /> | ||
<Testimonials /> | ||
<MailingList /> | ||
const About = lazy(() => import("./About")); | ||
const FeaturedLessons = lazy(() => import("./FeaturedLessons")); | ||
const Testimonials = lazy(() => import("./Testimonials")); | ||
const MailingList = lazy(() => import("./MailingList")); | ||
|
||
const renderLoader = () => ( | ||
<div className="loadingImage"> | ||
<img src={Loader} alt="loading image" /> | ||
</div> | ||
); | ||
|
||
const Container = () => ( | ||
<Suspense fallback={renderLoader()}> | ||
<div className="nav-container"> | ||
<About /> | ||
<FeaturedLessons /> | ||
<Testimonials /> | ||
<MailingList /> | ||
</div> | ||
</Suspense> | ||
); | ||
|
||
export default Container; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.loadingImage { | ||
display: flex; | ||
justify-content: center; | ||
margin: 50px 0; | ||
|
||
img { | ||
width: 300px; | ||
} | ||
} |