diff --git a/wasp-ai/src/client/RootComponent.jsx b/wasp-ai/src/client/RootComponent.jsx index 340b709ac..929dbf9d3 100644 --- a/wasp-ai/src/client/RootComponent.jsx +++ b/wasp-ai/src/client/RootComponent.jsx @@ -1,4 +1,5 @@ -import { useEffect } from "react"; +import { useEffect, useMemo } from "react"; +import { useLocation } from "react-router-dom"; import Prism from "prismjs"; import "prismjs/components/prism-json"; import addWaspLangauge from "./prism/wasp"; @@ -12,6 +13,13 @@ addWaspLangauge(Prism); export function RootComponent({ children }) { // const { isAlreadyShown } = useWelcomeDialog(); // const [isDialogOpen, setIsDialogOpen] = useState(!isAlreadyShown); + const location = useLocation(); + + const shouldDisplayTopBanner = useMemo(() => { + return !(location.pathname.startsWith("/result/")); + }, [location]); + + useEffect(() => { const script = document.createElement("script"); @@ -24,47 +32,51 @@ export function RootComponent({ children }) { document.body.removeChild(script); }; }, []); + return ( <> -
window.open("https://github.com/wasp-lang/wasp")} - > + { shouldDisplayTopBanner && (
window.open("https://github.com/wasp-lang/wasp/tree/wasp-ai")} > - - - 🔮 This is a Wasp powered project. If you like it,{" "} - star us on GitHub! - - - - - + + 🔮 This is a Wasp powered project. If you like it,{" "} + star us on GitHub! + + + + - Star - - + + Star + + +
- + )} +
{children}