Skip to content

Commit b665621

Browse files
committed
fix the position of the loading
1 parent 7c07e77 commit b665621

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/Components/Loader/Loader.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
.container-loader{
2+
width: 100vw;
3+
height: 100vh;
4+
display: flex;
5+
justify-content: center;
6+
align-items: center;
7+
}
8+
19
.lds-spinner {
210
color: official;
311
display: inline-block;

src/Components/Loader/Loader.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "./Loader.css"
33

44
export const Loader = () => {
55
return (
6+
<div className="container-loader">
67
<div className="lds-spinner">
78
<div></div>
89
<div></div>
@@ -14,5 +15,6 @@ export const Loader = () => {
1415
<div></div>
1516
<div></div>
1617
</div>
18+
</div>
1719
)
1820
}

src/Components/Loguin/ProtectedRoute.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Navigate } from "react-router-dom"
22
import { useAuth } from "../../Context/AuthContext"
3+
import { Loader } from "../Loader/Loader.jsx"
34

45
export function ProotectedRoute({children}){
56
const { user, loading } = useAuth()
6-
if(loading) return <h1>Loading</h1>
7+
if(loading) return <Loader/>
78

89
if(!user) return <Navigate to="/login"/>
910

0 commit comments

Comments
 (0)