From ada2c5c99e5113573bd3062f4335fd23b6dfa029 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Fri, 28 Jun 2024 15:13:26 +0100 Subject: [PATCH] More improvements to the app-wide usage indicators --- .../components/billing/v2/FreePlanUsage.tsx | 2 +- .../components/billing/v2/UpgradePrompt.tsx | 10 +++++- .../app/components/navigation/SideMenu.tsx | 33 +++++++++++-------- .../_app.orgs.$organizationSlug/route.tsx | 2 -- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/apps/webapp/app/components/billing/v2/FreePlanUsage.tsx b/apps/webapp/app/components/billing/v2/FreePlanUsage.tsx index a09475a1a..729d55d8b 100644 --- a/apps/webapp/app/components/billing/v2/FreePlanUsage.tsx +++ b/apps/webapp/app/components/billing/v2/FreePlanUsage.tsx @@ -28,7 +28,7 @@ export function FreePlanUsage({ to, percentage }: { to: string; percentage: numb Free Plan - Learn more + Upgrade
diff --git a/apps/webapp/app/components/billing/v2/UpgradePrompt.tsx b/apps/webapp/app/components/billing/v2/UpgradePrompt.tsx index c9939e097..b4584216d 100644 --- a/apps/webapp/app/components/billing/v2/UpgradePrompt.tsx +++ b/apps/webapp/app/components/billing/v2/UpgradePrompt.tsx @@ -6,6 +6,7 @@ import { v3BillingPath } from "~/utils/pathBuilder"; import { LinkButton } from "../../primitives/Buttons"; import { Icon } from "../../primitives/Icon"; import { Paragraph } from "../../primitives/Paragraph"; +import { DateTime } from "~/components/primitives/DateTime"; export function UpgradePrompt() { const organization = useOrganization(); @@ -15,6 +16,11 @@ export function UpgradePrompt() { return null; } + const nextMonth = new Date(); + nextMonth.setMonth(nextMonth.getMonth() + 1); + nextMonth.setDate(1); + nextMonth.setHours(0, 0, 0, 0); + return (
You have exceeded the monthly $ - {(plan.v3Subscription?.plan?.limits.includedUsage ?? 500) / 100} free credits. + {(plan.v3Subscription?.plan?.limits.includedUsage ?? 500) / 100} free credits. No runs + will execute in Prod until , or you + upgrade.
(null); const [showHeaderDivider, setShowHeaderDivider] = useState(false); const currentPlan = useCurrentPlan(); + const { isManagedCloud } = useFeatures(); useEffect(() => { const handleScroll = () => { @@ -179,20 +180,24 @@ export function SideMenu({ user, project, organization, organizations }: SideMen iconColor="text-sky-500" data-action="team" /> - - + {isManagedCloud && ( + <> + + + + )} {organization.projects.some((proj) => proj.version === "V2") && (