From 52284900ea61da3a2d3ca1057d67a2e2cd6e820c Mon Sep 17 00:00:00 2001 From: VincenzoDeSisto <160047529+VincenzoDeSisto@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:17:14 +0200 Subject: [PATCH] fix(validatore): fix responsive view (#565) --- .../layout/HeaderMainMenu/HeaderMainMenu.js | 2 +- .../static-content/validatore/Validatore.js | 14 ++- .../validatore/partials/ValidatoreResult.js | 112 ++++++++++-------- 3 files changed, 69 insertions(+), 59 deletions(-) diff --git a/src/components/layout/HeaderMainMenu/HeaderMainMenu.js b/src/components/layout/HeaderMainMenu/HeaderMainMenu.js index 7a7cfb3a..d272d2c5 100644 --- a/src/components/layout/HeaderMainMenu/HeaderMainMenu.js +++ b/src/components/layout/HeaderMainMenu/HeaderMainMenu.js @@ -22,7 +22,7 @@ const HeaderMainMenu = () => { }); }, []); const isActive = (href) => { - if (href.includes(pathname)) { + if (href.includes(pathname) && pathname !== "/") { return true; } diff --git a/src/components/static-content/validatore/Validatore.js b/src/components/static-content/validatore/Validatore.js index 1c01ec04..4df73b32 100644 --- a/src/components/static-content/validatore/Validatore.js +++ b/src/components/static-content/validatore/Validatore.js @@ -117,7 +117,7 @@ const Validatore = ({ test = false }) => { }; const handleChangeBackground = () => { - const offset = buttonGroupEl.getBoundingClientRect().top; + const offset = buttonGroupEl.getBoundingClientRect().top + window.scrollY; backgroundEl.style.background = `linear-gradient(to bottom, #f0f6fc ${ offset - (isMobile() ? 80 : 140) @@ -179,9 +179,11 @@ const Validatore = ({ test = false }) => {
-

Carica il tuo file Turtle

+

+ Valida i metadati delle risorse semantiche +

-
+
Per la pubblicazione sul Catalogo, i metadati devono essere conformi alle regole indicate nella{" "} { { @@ -277,7 +279,7 @@ const Validatore = ({ test = false }) => { diff --git a/src/components/static-content/validatore/partials/ValidatoreResult.js b/src/components/static-content/validatore/partials/ValidatoreResult.js index 4587311e..1adba3f2 100644 --- a/src/components/static-content/validatore/partials/ValidatoreResult.js +++ b/src/components/static-content/validatore/partials/ValidatoreResult.js @@ -6,9 +6,9 @@ import BreadCrumbs from "../../../common/BreadCrumbs/BreadCrumbs"; import BREADCRUMBS from "../../../../services/BreadCrumbsConst"; import sprite from "../../../../assets/images/sprite.svg"; import "../Validatore.css"; -import { isMobile } from "../../../common/ResponsiveViews"; import { Navigate, useLocation, useNavigate } from "react-router-dom"; import { VALIDATORE } from "../../../../services/routes"; +import { isMobile } from "../../../common/ResponsiveViews"; const ValidatoreResult = () => { const location = useLocation(); @@ -76,9 +76,10 @@ const ValidatoreResult = () => { }; const handleChangeBackground = () => { - const offset = buttonGroupErrorEl.getBoundingClientRect().top; + const offset = + buttonGroupErrorEl.getBoundingClientRect().top + window.scrollY; backgroundEl.style.background = `linear-gradient(to bottom, #f0f6fc ${ - offset - (isMobile() ? 0 : 100) + offset - (isMobile() ? 0 : 80) }px, white 0)`; }; @@ -86,7 +87,6 @@ const ValidatoreResult = () => { if (buttonGroupErrorEl) { handleChangeBackground(); window.addEventListener("resize", handleChangeBackground); - if (!stoplight) setStoplight(true); } @@ -117,7 +117,7 @@ const ValidatoreResult = () => {
-
+
-
+
@@ -187,9 +187,10 @@ const ValidatoreResult = () => {