Skip to content

Commit

Permalink
fix(validatore): fix footer position v2
Browse files Browse the repository at this point in the history
  • Loading branch information
VincenzoDeSisto committed Sep 6, 2024
1 parent 1beff0b commit ee63435
Showing 1 changed file with 1 addition and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const ValidatoreResult = () => {

const buttonGroupErrorEl = document.getElementById("button-group-error");
const backgroundEl = document.getElementById("background-custom");
const pageFrontEl = document.getElementById("page-front");
const spaceEl = document.getElementById("space");

const errorRef = useRef(null);
const warningRef = useRef(null);
Expand Down Expand Up @@ -84,12 +82,6 @@ const ValidatoreResult = () => {
offset - (isMobile() ? 0 : 80)
}px, white 0)`;
};
const handleChangeSpace = () => {
const offset = pageFrontEl.clientHeight;
spaceEl.style.height = `calc(${window.screen.height}px - ${
offset - 110
}px)`;
};

// to calculate the background (light-blue) height
useEffect(() => {
Expand All @@ -102,24 +94,9 @@ const ValidatoreResult = () => {

return () => {
window.removeEventListener("resize", handleChangeBackground);
window.removeEventListener("resize", handleChangeSpace);
};
}, [buttonGroupErrorEl, response, backgroundEl]);

//to separate div between <main> and <footer>
useEffect(() => {
if (pageFrontEl && spaceEl) {
handleChangeSpace();
window.addEventListener("resize", handleChangeSpace);

if (!stoplight) setStoplight(true);
}

return () => {
window.removeEventListener("resize", handleChangeSpace);
};
}, [pageFrontEl, spaceEl, stoplight]);

useEffect(() => {
setStoplight(true);
if (backgroundEl)
Expand Down Expand Up @@ -165,7 +142,7 @@ const ValidatoreResult = () => {
</div>
</div> */}

<div className="col-12 mt-4 mb-5 d-flex">
<div className="col-12 my-5 d-flex">
<svg
className="icon icon-xl me-3 mt-3"
fill="green"
Expand All @@ -190,15 +167,6 @@ const ValidatoreResult = () => {
</div>
</div>
</div>
<div
id="space"
style={{
width: "100%",
height: "200px",
display: "block",
backgroundColor: "rgb(240, 246, 252)"
}}
></div>
</div>
) : response &&
(response.errors.length !== 0 || response.warnings.length !== 0) ? (
Expand Down

0 comments on commit ee63435

Please sign in to comment.