diff --git a/src/popup/pages/home.tsx b/src/popup/pages/home.tsx index 4b08b9b2..1d344ced 100644 --- a/src/popup/pages/home.tsx +++ b/src/popup/pages/home.tsx @@ -18,7 +18,7 @@ import PostOnHighlight from "./posthighlight"; import { getRepoAPIURL } from "../../utils/urlMatchers"; import { getEmojis, getHighlights } from "../../utils/fetchOpenSaucedApiData"; import Help from "./help"; -import { useEffect, useState } from "react"; +import { useEffect, useState, useRef } from "react"; import Settings from "./settings"; import { OPEN_SAUCED_INSIGHTS_DOMAIN } from "../../constants"; import type { Highlight } from "../../ts/types"; @@ -31,6 +31,7 @@ const Home = () => { const { prUrl: pageURL, prTitle, type: GitHubPageType } = usGetGitHubPageInfo(); const [highlights, setHighlights] = useState([]); const [emojis, setEmojis] = useState[]>([]); + const toolsRef = useRef(null); useEffect(() => { const fetchHighlights = async () => { @@ -112,7 +113,7 @@ const Home = () => { rel="noreferrer" target="_blank" > - Highlights feed + Highlights feed @@ -137,10 +138,12 @@ const Home = () => { )} + {Boolean(toolsRef.current?.children.length) &&

Tools:

} -

Tools:

- -
+
{GitHubPageType === "REPO" && (