Skip to content

Commit

Permalink
Merge pull request #961 from kleros/fix(web)/fix-links-and-modal-beha…
Browse files Browse the repository at this point in the history
…vior

fix: fixed links and modal behavior
  • Loading branch information
alcercu authored Jun 23, 2023
2 parents 5acd04a + 1277bec commit 031a528
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
4 changes: 1 addition & 3 deletions web/src/hooks/useFocusOutside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import React, { useEffect } from "react";
export function useFocusOutside(ref: React.RefObject<HTMLDivElement>, 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]);
Expand Down
12 changes: 6 additions & 6 deletions web/src/layout/Header/navbar/DappList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,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",
},
];

Expand Down
10 changes: 5 additions & 5 deletions web/src/layout/Header/navbar/Menu/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ITEMS = [
{
text: "Onboarding",
Icon: Book,
url: "https://kleros.dodao.io/",
url: "",
},
{
text: "Get Help",
Expand All @@ -23,22 +23,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",
},
];

Expand Down

0 comments on commit 031a528

Please sign in to comment.