Skip to content

Commit 02aa869

Browse files
authored
Merge pull request #48 from sikehish/master
Fixed: Disable interactivity throughout the webpage when loader appears. #34
2 parents 9af4a04 + fdf8721 commit 02aa869

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

src/component/Assets/Loader.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.overlay {
2+
position: fixed;
3+
top: 0;
4+
left: 0;
5+
width: 100%;
6+
height: 100%;
7+
background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
8+
z-index: 9999; /* Ensure it's on top of other elements */
9+
pointer-events: all; /* Disable pointer events to block interactions */
10+
}
11+

src/component/Assets/Loader.jsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
import React, { useEffect } from "react";
1+
import React from "react";
22
import { Spinner } from "react-bootstrap";
3+
import "./Loader.css"
34

4-
const Loader = ({ time, loading }) => {
5+
const Loader = ({ time, loading}) => {
56
return (
67
<>
7-
<Spinner
8-
animation="border"
9-
variant="light"
10-
id="loadSpinner"
11-
style={{
12-
zIndex: "200",
13-
position: "fixed",
14-
top: "45vh",
8+
<div className="overlay">
9+
<Spinner
10+
animation="border"
11+
variant="light"
12+
id="loadSpinner"
13+
style={{
14+
zIndex: "200",
15+
position: "fixed",
16+
top: "45vh",
1517
left: "50vw",
16-
}}
17-
/>
18+
}}
19+
/>
20+
</div>
21+
1822
</>
1923
);
2024
};
2125

2226
export default Loader;
27+

0 commit comments

Comments
 (0)