From decd05e76488a42111c6c21ce3be0612ce00457d Mon Sep 17 00:00:00 2001 From: Will Chen Date: Tue, 16 Sep 2025 22:51:46 -0700 Subject: [PATCH] add pro banners (#1269) ## Summary by cubic Adds rotating Pro banners on the home page to promote Dyad Pro (AI access, Smart Context savings, Turbo speed). Also tightens the home layout and centers the setup headline. - New Features - Added ProBanner with three variants (AI Access, Smart Context, Turbo). One shows at random and links to dyad.sh/pro with UTM tags. - Banners are hidden when Pro is enabled or the user has a budget (settings.enableDyadPro or userBudget). - Added OpenAI, Google, and Anthropic logo assets for the AI Access banner. - Home updates: show 3 inspiration prompts (was 5), center and constrain layout, and render ProBanner below content. - SetupBanner heading is centered and slightly smaller (text-5xl). --- assets/ai-logos/anthropic-logo.svg | 1 + assets/ai-logos/google-logo.svg | 1 + assets/ai-logos/openai-logo.svg | 1 + src/components/ProBanner.tsx | 184 +++++++++++++++++++++++++++++ src/components/SetupBanner.tsx | 2 +- src/pages/home.tsx | 8 +- 6 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 assets/ai-logos/anthropic-logo.svg create mode 100644 assets/ai-logos/google-logo.svg create mode 100644 assets/ai-logos/openai-logo.svg create mode 100644 src/components/ProBanner.tsx diff --git a/assets/ai-logos/anthropic-logo.svg b/assets/ai-logos/anthropic-logo.svg new file mode 100644 index 0000000..cbcc39e --- /dev/null +++ b/assets/ai-logos/anthropic-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ai-logos/google-logo.svg b/assets/ai-logos/google-logo.svg new file mode 100644 index 0000000..a2a0c4f --- /dev/null +++ b/assets/ai-logos/google-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ai-logos/openai-logo.svg b/assets/ai-logos/openai-logo.svg new file mode 100644 index 0000000..859d7af --- /dev/null +++ b/assets/ai-logos/openai-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/ProBanner.tsx b/src/components/ProBanner.tsx new file mode 100644 index 0000000..1b0c21c --- /dev/null +++ b/src/components/ProBanner.tsx @@ -0,0 +1,184 @@ +// @ts-ignore +import openAiLogo from "../../assets/ai-logos/openai-logo.svg"; +// @ts-ignore +import googleLogo from "../../assets/ai-logos/google-logo.svg"; +// @ts-ignore +import anthropicLogo from "../../assets/ai-logos/anthropic-logo.svg"; +import { IpcClient } from "@/ipc/ipc_client"; +import { useState } from "react"; + +import { useSettings } from "@/hooks/useSettings"; +import { useUserBudgetInfo } from "@/hooks/useUserBudgetInfo"; + +export function ProBanner() { + const { settings } = useSettings(); + const { userBudget } = useUserBudgetInfo(); + if (settings?.enableDyadPro || userBudget) { + return null; + } + + const [selectedBanner] = useState<"ai" | "smart" | "turbo">(() => { + const options = ["ai", "smart", "turbo"] as const; + return options[Math.floor(Math.random() * options.length)]; + }); + + return ( +
+ {selectedBanner === "ai" ? ( + + ) : selectedBanner === "smart" ? ( + + ) : ( + + )} +
+ ); +} + +export function AiAccessBanner() { + return ( +
{ + IpcClient.getInstance().openExternalUrl( + "https://www.dyad.sh/pro#ai?utm_source=dyad-app&utm_medium=app&utm_campaign=in-app-banner-ai-access", + ); + }} + > +