Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loader #319

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"axios": "^0.21.1",
"node-sass": "^4.14.1",
"react": "^16.13.1",
"react-awesome-loaders": "^0.1.37",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3"
"react-scripts": "^4.0.3",
"webpack-dev-server": "^3.11.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
27 changes: 24 additions & 3 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import React , {useState,useEffect} from "react";
import { BrowserRouter as Router, Switch } from "react-router-dom";

// css
import "./css/main.scss";

Expand All @@ -24,8 +23,29 @@ import { CodeOfConduct } from "./pages/CodeOfConduct/index";
// images
import avatar_image from "./images/placeholder-images/avatar.png";


// //Loader
import Loader from "./components/Loader/Loader"


function App() {
let [loading, setLoading] = useState(false);

useEffect(()=>{
setLoading(true)
setTimeout(()=>{
setLoading(false)
},2000)
},[])


return (
<>
{
loading?
<Loader />
:

<Router>
<Header isSignedIn={false} avatarSrc={avatar_image} />
<Switch>
Expand All @@ -40,9 +60,10 @@ function App() {
<BlogPage path="/stories/post" exact />
<ProjectListing path="/projects" exact />
</Switch>

<Footer />
</Router>
}
</>
);
}

Expand Down
16 changes: 16 additions & 0 deletions frontend/src/components/Loader/Loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";
import localclasses from "./Loader.module.css";
import { ThreeDLoader } from "react-awesome-loaders";
function Loader() {
return (
<div className={localclasses.load}>
<ThreeDLoader
colorRing1={"#99004d"}
colorRing2={"#000000"}
desktopSize={"100px"}
mobileSize={"64px"}
/>
</div>
);
}
export default Loader;
9 changes: 9 additions & 0 deletions frontend/src/components/Loader/Loader.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.load {
background-color: white;
text-align: center;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}