From 173a2a51c46ec4735d1452558f2be6e0f5a49acd Mon Sep 17 00:00:00 2001 From: nhestrompia Date: Mon, 19 Jun 2023 17:30:44 +0300 Subject: [PATCH] fix: fixed links and modal behavior --- web/src/hooks/useFocusOutside.ts | 4 +--- web/src/layout/Header/navbar/DappList.tsx | 12 ++++++------ web/src/layout/Header/navbar/Menu/Help.tsx | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/web/src/hooks/useFocusOutside.ts b/web/src/hooks/useFocusOutside.ts index 6bb8204ff..429f5b3e5 100644 --- a/web/src/hooks/useFocusOutside.ts +++ b/web/src/hooks/useFocusOutside.ts @@ -3,15 +3,13 @@ import React, { useEffect } from "react"; export function useFocusOutside(ref: React.RefObject, callback: () => void) { useEffect(() => { function handleEvent(event: FocusEvent | MouseEvent) { - if (ref.current && !ref.current.contains(event.target as Node)) { + if (document.visibilityState === "visible" && ref.current && !ref.current.contains(event.target as Node)) { callback(); } } - document.addEventListener("focusin", handleEvent); document.addEventListener("mousedown", handleEvent); return () => { - document.removeEventListener("focusin", handleEvent); document.removeEventListener("mousedown", handleEvent); }; }, [ref, callback]); diff --git a/web/src/layout/Header/navbar/DappList.tsx b/web/src/layout/Header/navbar/DappList.tsx index fb345be6a..e097d5a54 100644 --- a/web/src/layout/Header/navbar/DappList.tsx +++ b/web/src/layout/Header/navbar/DappList.tsx @@ -29,32 +29,32 @@ const ITEMS = [ { text: "Tokens", Icon: Tokens, - url: "https://tokens.kleros.io/", + url: "https://tokens.kleros.io", }, { text: "POH", Icon: POH, - url: "https://www.proofofhumanity.id", + url: "https://app.proofofhumanity.id", }, { text: "Curate", Icon: Curate, - url: "https://curate.kleros.io/", + url: "https://curate.kleros.io", }, { text: "Resolver", Icon: Resolver, - url: "https://resolve.kleros.io/", + url: "https://resolve.kleros.io", }, { text: "Linguo", Icon: Linguo, - url: "https://linguo.kleros.io/", + url: "https://linguo.kleros.io", }, { text: "Governor", Icon: Governor, - url: "https://governor.kleros.io/", + url: "https://governor.kleros.io", }, ]; diff --git a/web/src/layout/Header/navbar/Menu/Help.tsx b/web/src/layout/Header/navbar/Menu/Help.tsx index f94b3b049..28fb34c4c 100644 --- a/web/src/layout/Header/navbar/Menu/Help.tsx +++ b/web/src/layout/Header/navbar/Menu/Help.tsx @@ -12,7 +12,7 @@ const ITEMS = [ { text: "Onboarding", Icon: Book, - url: "https://kleros.dodao.io/", + url: "", }, { text: "Get Help", @@ -22,22 +22,22 @@ const ITEMS = [ { text: "Report a Bug", Icon: Bug, - url: "https://github.com/kleros/kleros-v2/issues/new", + url: "https://github.com/kleros/kleros-v2/issues", }, { text: "DApp Guide", Icon: Guide, - url: "", + url: "https://docs.kleros.io/products/court-v2", }, { text: "Crypto Beginner's Guide", Icon: ETH, - url: "", + url: "https://ethereum.org/en/wallets/", }, { text: "FAQ", Icon: Faq, - url: "https://kleros.gitbook.io/docs/kleros-faq", + url: "https://docs.kleros.io/kleros-faq", }, ];