From 71ceeb533f63349a21f436c441b17d5915be4efc Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Thu, 4 Jan 2024 16:04:40 -0800 Subject: [PATCH] =?UTF-8?q?Update=20=E2=80=9Cbuy=20credits=E2=80=9D=20UX?= =?UTF-8?q?=20in=20settings=20modal=20to=20do=20subscriptions=20instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/settings/AccessCodeSection.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/settings/AccessCodeSection.tsx b/frontend/src/components/settings/AccessCodeSection.tsx index 5135307..99ff0c7 100644 --- a/frontend/src/components/settings/AccessCodeSection.tsx +++ b/frontend/src/components/settings/AccessCodeSection.tsx @@ -6,6 +6,7 @@ import { Label } from "../ui/label"; import useThrottle from "../../hooks/useThrottle"; import { Progress } from "../ui/progress"; import { PICO_BACKEND_FORM_SECRET } from "../../config"; +import { useStore } from "../../store/store"; interface Props { settings: Settings; @@ -31,6 +32,7 @@ function AccessCodeSection({ settings, setSettings }: Props) { const [usedCredits, setUsedCredits] = useState(0); const [totalCredits, setTotalCredits] = useState(0); const throttledAccessCode = useThrottle(settings.accessCode || "", 500); + const setPricingDialogOpen = useStore((state) => state.setPricingDialogOpen); const fetchState = (() => { if (!settings.accessCode) return FetchState.EMPTY; @@ -100,11 +102,16 @@ function AccessCodeSection({ settings, setSettings }: Props) { {fetchState === "EMPTY" && (
- - - +
+ If you already have an access code, enter it above. +
+
)} @@ -129,9 +136,9 @@ function AccessCodeSection({ settings, setSettings }: Props) { {usedCredits} out of {totalCredits} credits used - - - + )}