From 25086730779bd495998841e954fbcb66412c96ab Mon Sep 17 00:00:00 2001 From: Will Chen Date: Wed, 21 May 2025 15:37:29 -0700 Subject: [PATCH] Add promo link for pro mode selector (#219) --- src/components/ProModeSelector.tsx | 171 ++++++++++++++++------------- 1 file changed, 97 insertions(+), 74 deletions(-) diff --git a/src/components/ProModeSelector.tsx b/src/components/ProModeSelector.tsx index 0ca2248..768ce3a 100644 --- a/src/components/ProModeSelector.tsx +++ b/src/components/ProModeSelector.tsx @@ -13,6 +13,7 @@ import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; import { Sparkles, Info } from "lucide-react"; import { useSettings } from "@/hooks/useSettings"; +import { IpcClient } from "@/ipc/ipc_client"; export function ProModeSelector() { const { settings, updateSettings } = useSettings(); @@ -33,9 +34,7 @@ export function ProModeSelector() { }); }; - if (!settings?.enableDyadPro) { - return null; - } + const proEnabled = Boolean(settings?.enableDyadPro); return ( @@ -63,80 +62,104 @@ export function ProModeSelector() {
-
-
- -
- - - - - - Note: using the free Gemini API lets Google use your data to - improve their models. - - -

- Uses your free Gemini API quota before consuming Dyad Pro AI - credits -

-
+ {!proEnabled && ( +
+ { + IpcClient.getInstance().openExternalUrl( + "https://dyad.sh/pro#ai", + ); + }} + > + Unlock Pro modes +
- -
-
-
- -
- - - - - - Edits files faster. - - -

- Makes editing files faster and cheaper. -

-
-
- -
-
-
- -
- - - - - - Improve efficiency and save credits working on large - codebases. - - -

- Automatically detects the most relevant files for your chat -

-
-
- -
+ )} + + +
); } + +function SelectorRow({ + id, + label, + description, + tooltip, + proEnabled, + settingEnabled, + toggle, +}: { + id: string; + label: string; + description: string; + tooltip: string; + proEnabled: boolean; + settingEnabled: boolean; + toggle: () => void; +}) { + return ( +
+
+ +
+ + + + + + {tooltip} + + +

+ {description} +

+
+
+ +
+ ); +}