Skip to content

Commit

Permalink
Merge pull request #325 from Jagpreet153/fix-issue-143
Browse files Browse the repository at this point in the history
fix issue #167
  • Loading branch information
Satyam1923 authored Jun 11, 2024
2 parents 582b825 + 0b5f28d commit 86ed2cb
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 1 deletion.
18 changes: 18 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@reduxjs/toolkit": "^2.2.5",
"axios": "^1.6.8",
"he": "^1.2.0",
"lottie-react": "^2.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-h5-audio-player": "^3.9.1",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Images/preloader.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion frontend/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import { Provider } from "react-redux";
import store from "./redux/store.js";
import { PersistGate } from "redux-persist/integration/react";
import { persistStore } from "redux-persist";
import Preloader from "./pages/Preloader.jsx";

const persistor = persistStore(store);

ReactDOM.createRoot(document.getElementById("root")).render(
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<React.StrictMode>
<App />
<Preloader/>
</React.StrictMode>
</PersistGate>
</Provider>
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/pages/Preloader.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.pre{
display: flex;
align-items: center;
justify-content: center;
}

.preloader{
width: 30vw;
height: 30vh;
}
29 changes: 29 additions & 0 deletions frontend/src/pages/Preloader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React ,{useState,useEffect} from 'react';
import pre from '../Images/preloader.json'
import Lottie from 'lottie-react';
import App from '../App';
import './Preloader.css'
function Preloader() {
const [loading,setLoading]=useState(false);
useEffect(()=>{
setLoading(true);
setTimeout(() =>{
setLoading(false)
},1700)
},[])
return (

loading ?
<div className='pre'>
<Lottie className="preloader" animationData={pre}/>
</div>

:
//Rest Code
<App/>



);
}
export default Preloader;

0 comments on commit 86ed2cb

Please sign in to comment.