File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change
1
+ .container-loader {
2
+ width : 100vw ;
3
+ height : 100vh ;
4
+ display : flex;
5
+ justify-content : center;
6
+ align-items : center;
7
+ }
8
+
1
9
.lds-spinner {
2
10
color : official;
3
11
display : inline-block;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import "./Loader.css"
3
3
4
4
export const Loader = ( ) => {
5
5
return (
6
+ < div className = "container-loader" >
6
7
< div className = "lds-spinner" >
7
8
< div > </ div >
8
9
< div > </ div >
@@ -14,5 +15,6 @@ export const Loader = () => {
14
15
< div > </ div >
15
16
< div > </ div >
16
17
</ div >
18
+ </ div >
17
19
)
18
20
}
Original file line number Diff line number Diff line change 1
1
import { Navigate } from "react-router-dom"
2
2
import { useAuth } from "../../Context/AuthContext"
3
+ import { Loader } from "../Loader/Loader.jsx"
3
4
4
5
export function ProotectedRoute ( { children} ) {
5
6
const { user, loading } = useAuth ( )
6
- if ( loading ) return < h1 > Loading </ h1 >
7
+ if ( loading ) return < Loader / >
7
8
8
9
if ( ! user ) return < Navigate to = "/login" />
9
10
You can’t perform that action at this time.
0 commit comments