From 803e5884d9a57271c7f04281dcd4b06ffa6afe6d Mon Sep 17 00:00:00 2001 From: Colin Spence Date: Thu, 21 Mar 2024 11:18:30 -0600 Subject: [PATCH] Creates Intro Pop Up --- web/app/page.tsx | 6 +----- web/components/Disclaimer.tsx | 10 ++++++--- web/components/IntroPopUp.tsx | 39 +++++++++++++++++++++++++++++++++++ web/components/Prompt.tsx | 11 ++++++++-- 4 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 web/components/IntroPopUp.tsx diff --git a/web/app/page.tsx b/web/app/page.tsx index c223470..0b3bcac 100644 --- a/web/app/page.tsx +++ b/web/app/page.tsx @@ -24,9 +24,5 @@ function generateUniqueIndexes(arrayLength: number, count: number): number[] { export default function HomePage() { const promptIdxs = generateUniqueIndexes(EXAMPLE_PROMPTS.length, 6); - return ( -
- -
- ); + return ; } diff --git a/web/components/Disclaimer.tsx b/web/components/Disclaimer.tsx index 6f5cce3..2b89920 100644 --- a/web/components/Disclaimer.tsx +++ b/web/components/Disclaimer.tsx @@ -10,7 +10,7 @@ const Disclaimer = () => {
setShowDisclaimer(false)} - className='absolute top-4 right-4 text-indigo-800 hover:text-indigo-500 cursor-pointer' + className='absolute top-3 right-3 text-indigo-800 hover:text-indigo-500 cursor-pointer' size={20} weight='bold' /> @@ -18,8 +18,12 @@ const Disclaimer = () => {
This AI agent is experimental.
-
- The agent is evaluating projects based on self-reported data through past Gitcoin applications and therefore cannot guarantee their accuracy at this time. The agent also cannot guarantee that each project is still in control of its address, so please double check before sending large amounts. +
+ The agent is evaluating projects based on self-reported data through + past Gitcoin applications and therefore cannot guarantee their + accuracy at this time. The agent also cannot guarantee that each + project is still in control of its address, so please double check + before sending large amounts.
diff --git a/web/components/IntroPopUp.tsx b/web/components/IntroPopUp.tsx new file mode 100644 index 0000000..9cd61db --- /dev/null +++ b/web/components/IntroPopUp.tsx @@ -0,0 +1,39 @@ +"use client"; + +import { X } from "@phosphor-icons/react/dist/ssr"; +import { SparkleIcon } from "./Icons"; +import { Dispatch, SetStateAction } from "react"; + +interface IntroPopupProps { + setShowDisclaimer: Dispatch>; +} + +const IntroPopUp = ({ setShowDisclaimer }: IntroPopupProps) => { + return ( +
+ setShowDisclaimer(false)} + className='absolute top-3 right-3 text-indigo-800 hover:text-indigo-500 cursor-pointer' + size={20} + weight='bold' + /> +
+
+ +
+ Welcome to fundpublicgoods.ai! +
+
+
+ As a proof-of-concept project, fundpublicgoods.ai showcases the + potential of AI in revolutionizing funding for public goods. Our + platform offers personalized strategies to maximize the impact of your + contributions. Engage with our platform and community today to be part + of this innovative approach to philanthropy. +
+
+
+ ); +}; + +export default IntroPopUp; diff --git a/web/components/Prompt.tsx b/web/components/Prompt.tsx index 61ea4f3..b3721ad 100644 --- a/web/components/Prompt.tsx +++ b/web/components/Prompt.tsx @@ -9,9 +9,11 @@ import { startRun } from "@/app/actions"; import clsx from "clsx"; import { EXAMPLE_PROMPTS } from "@/utils/examplePrompts"; import { toast } from "react-toastify"; +import IntroPopUp from "./IntroPopUp"; export default function Prompt({ promptIdxs }: { promptIdxs: number[] }) { const [prompt, setPrompt] = useState(""); + const [showDisclaimer, setShowDisclaimer] = useState(true); const [isWaiting, setIsWaiting] = useState(false); const { data: session } = useSession(); const searchParams = useSearchParams(); @@ -43,7 +45,11 @@ export default function Prompt({ promptIdxs }: { promptIdxs: number[] }) { }, [searchParams, router]); return ( - <> +
@@ -88,6 +94,7 @@ export default function Prompt({ promptIdxs }: { promptIdxs: number[] }) {
- + {showDisclaimer && } +
); }