Open source CapCut alternative.
TypeScript
feat(site): remove Donkey Use payment UI, settings opens on Usage
David Leca92d0e7b6ee
diff --git a/site/src/app/_components/landing/BillingPortalButton.tsx b/site/src/app/_components/landing/BillingPortalButton.tsxdeleted file mode 100644index 4edeb252..00000000--- a/site/src/app/_components/landing/BillingPortalButton.tsx+++ /dev/null@@ -1,58 +0,0 @@-"use client";--import { useCallback, useState } from "react";--import { PillButton } from "@/app/_components/landing/LandingPrimitives";-import { authClient } from "@/lib/auth-client";-import { ApiError } from "@/queries/apiClient";-import { useOpenBillingPortal } from "@/queries/billing";--export function BillingPortalButton() {- const [statusMessage, setStatusMessage] = useState<string | null>(null);- const portal = useOpenBillingPortal();-- const handleOpenPortal = useCallback(async () => {- setStatusMessage(null);-- try {- const session = await portal.mutateAsync();- window.location.assign(session.url);- } catch (error) {- if (error instanceof ApiError && error.status === 401) {- await authClient.signIn.social({- callbackURL: "/pricing",- provider: "google",- });- return;- }-- setStatusMessage("Billing portal is not available yet.");- }- }, [portal]);-- return (- <div>- <PillButton- disabled={portal.isPending}- onClick={handleOpenPortal}- variant="secondary"- >- {portal.isPending ? "Opening..." : "Manage billing"}- </PillButton>- {statusMessage ? (- <div- role="status"- style={{- color: "rgba(255,255,255,0.7)",- fontSize: 13,- fontWeight: 600,- lineHeight: 1.4,- marginTop: 12,- }}- >- {statusMessage}- </div>- ) : null}- </div>- );-}diff --git a/site/src/app/_components/landing/DonkeyLanding.tsx b/site/src/app/_components/landing/DonkeyLanding.tsxindex 8f534bc8..70c55599 100644--- a/site/src/app/_components/landing/DonkeyLanding.tsx+++ b/site/src/app/_components/landing/DonkeyLanding.tsx@@ -7,7 +7,6 @@ import { Footer } from "@/app/_components/landing/Footer";import { Hero } from "@/app/_components/landing/Hero";import { MediaShowcase } from "@/app/_components/landing/media-showcase/MediaShowcase";import { OpenSource } from "@/app/_components/landing/OpenSource";-import { Pricing } from "@/app/_components/landing/Pricing";import { Solutions } from "@/app/_components/landing/Solutions";import { TopNav } from "@/app/_components/landing/TopNav";import { TrustedBy } from "@/app/_components/landing/TrustedBy";@@ -34,7 +33,6 @@ export default function DonkeyLanding() {/><Demo /><OpenSource />- <Pricing /><DonkeyVisionCTA /><FinalCTA /><Footer />diff --git a/site/src/app/_components/landing/FinalCTA.tsx b/site/src/app/_components/landing/FinalCTA.tsxindex dbe6330b..1ea3d96b 100644--- a/site/src/app/_components/landing/FinalCTA.tsx+++ b/site/src/app/_components/landing/FinalCTA.tsx@@ -27,9 +27,6 @@ export function FinalCTA() {<PillButton href={DONKEY_INSTALL_URL} variant="primary" size="lg">Download for Mac <ArrowRight size={18} /></PillButton>- <PillButton href="/pricing" variant="secondary" size="lg">- See pricing- </PillButton></div></div></div>diff --git a/site/src/app/_components/landing/Footer.tsx b/site/src/app/_components/landing/Footer.tsxindex 90ae3c7d..6e822ff2 100644--- a/site/src/app/_components/landing/Footer.tsx+++ b/site/src/app/_components/landing/Footer.tsx@@ -26,7 +26,6 @@ export function Footer() {{title: "Product",links: [- { href: "/pricing", label: "Pricing" },{ href: "/donkeyvision", label: "Donkey Vision API" },{ href: GITHUB_REPO_URL, label: "GitHub" },],diff --git a/site/src/app/_components/landing/Pricing.tsx b/site/src/app/_components/landing/Pricing.tsxdeleted file mode 100644index f0e2f2b7..00000000--- a/site/src/app/_components/landing/Pricing.tsx+++ /dev/null@@ -1,40 +0,0 @@-"use client";--import { Headline } from "@/app/_components/landing/LandingPrimitives";-import { PricingPlanCard } from "@/app/_components/landing/PricingPlanCard";-import { pricingPreviewPlans } from "@/app/_components/landing/pricingPlans";-import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";--export function Pricing() {- const isDesktop = useMediaQuery("(min-width: 768px)");-- return (- <section- id="pricing"- style={{- boxSizing: "border-box",- padding: isDesktop ? "96px 48px" : "80px 24px",- maxWidth: 1400,- margin: "0 auto",- width: "100%",- }}- >- <Headline size="lg">- Simple <span style={{ fontStyle: "italic" }}>pricing</span>- </Headline>- <div- style={{- marginTop: 48,- display: "grid",- gridTemplateColumns: isDesktop ? "1fr 1fr" : "1fr",- alignItems: "stretch",- gap: 24,- }}- >- {pricingPreviewPlans.map((plan) => (- <PricingPlanCard key={plan.name} plan={plan} />- ))}- </div>- </section>- );-}diff --git a/site/src/app/_components/landing/PricingPage.tsx b/site/src/app/_components/landing/PricingPage.tsxdeleted file mode 100644index 75384d21..00000000--- a/site/src/app/_components/landing/PricingPage.tsx+++ /dev/null@@ -1,78 +0,0 @@-"use client";--import { BillingPortalButton } from "@/app/_components/landing/BillingPortalButton";-import {- Headline,- PillButton,-} from "@/app/_components/landing/LandingPrimitives";-import { Footer } from "@/app/_components/landing/Footer";-import { PricingPlanCard } from "@/app/_components/landing/PricingPlanCard";-import { TopNav } from "@/app/_components/landing/TopNav";-import { pricingPlans } from "@/app/_components/landing/pricingPlans";--export function PricingPage() {- return (- <main className="min-h-screen w-full max-w-full overflow-x-hidden bg-background font-system text-ink antialiased">- <TopNav />- <section className="mx-auto w-full max-w-[1400px] px-6 pt-[44px] pb-12 md:px-12 md:pt-[72px] md:pb-16">- <h1 className="max-w-[700px] text-[52px] leading-[0.9] font-semibold tracking-normal break-words md:max-w-[1304px] md:text-[112px]">- Pick the plan.- <br />- <span className="whitespace-normal min-[1400px]:whitespace-nowrap">- Let Donkey <span className="italic">carry it.</span>- </span>- </h1>- <p className="mt-8 max-w-[640px] text-[18px] leading-[1.55] text-[#454545] md:text-[20px]">- Pro is the self-serve path. Enterprise stays personal: tell us what- your team needs, and we will shape the rollout around it.- </p>- </section>-- <section className="mx-auto w-full max-w-[1400px] px-6 pb-20 md:px-12 md:pb-24">- <div className="grid grid-cols-1 gap-6 md:grid-cols-2">- {pricingPlans.map((plan) => (- <PricingPlanCard key={plan.name} plan={plan} />- ))}- </div>- </section>-- <section className="mx-auto w-full max-w-[1400px] px-6 pb-20 md:px-12 md:pb-[120px]">- <div className="relative">- <div className="absolute inset-0 translate-x-2 translate-y-2 rounded-3xl bg-coral" />- <div className="relative grid grid-cols-1 gap-6 rounded-3xl border-2 border-ink bg-ink px-7 py-9 text-white md:grid-cols-[1fr_auto_auto] md:gap-9 md:px-12 md:py-14">- <div>- <div className="mb-[18px] text-xs font-semibold tracking-[0.12em] text-white/55 uppercase">- Already subscribed- </div>- <Headline size="lg">Keep billing boring.</Headline>- <p className="mt-[18px] max-w-[560px] text-[15px] leading-[1.55] text-white/72 md:text-[17px]">- Manage payment methods, receipts, and subscription details from- one secure place.- </p>- </div>- <ul className="hidden flex-col gap-3 self-center border-l border-white/15 pl-9 md:flex">- {["Update your card anytime", "Download every invoice", "Switch or cancel plans"].map(- (item) => (- <li- key={item}- className="flex items-center gap-2.5 text-[15px] leading-none text-white/72"- >- <span className="h-1.5 w-1.5 shrink-0 rounded-full bg-coral" />- {item}- </li>- ),- )}- </ul>- <div className="flex flex-wrap items-center gap-3 self-center">- <BillingPortalButton />- <PillButton href="/sign-in" variant="primary">- Log in- </PillButton>- </div>- </div>- </div>- </section>- <Footer />- </main>- );-}diff --git a/site/src/app/_components/landing/PricingPlanCard.tsx b/site/src/app/_components/landing/PricingPlanCard.tsxindex 2063163a..69e64dc3 100644--- a/site/src/app/_components/landing/PricingPlanCard.tsx+++ b/site/src/app/_components/landing/PricingPlanCard.tsx@@ -1,7 +1,6 @@"use client";import { Check } from "lucide-react";-import { useCallback, useState } from "react";import {PillButton,@@ -9,9 +8,6 @@ import {} from "@/app/_components/landing/LandingPrimitives";import type { PricingPlan } from "@/app/_components/landing/pricingPlans";import { useMediaQuery } from "@/app/_components/landing/useMediaQuery";-import { authClient } from "@/lib/auth-client";-import { ApiError } from "@/queries/apiClient";-import { useStartCheckout } from "@/queries/billing";type Props = {plan: PricingPlan;@@ -19,47 +15,13 @@ type Props = {export function PricingPlanCard({ plan }: Props) {const isDesktop = useMediaQuery("(min-width: 768px)");- const [statusMessage, setStatusMessage] = useState<string | null>(null);- const checkout = useStartCheckout();const action = plan.action;- const handleCheckout = useCallback(async () => {- if (action.kind !== "checkout") {- return;- }-- setStatusMessage(null);-- try {- const session = await checkout.mutateAsync(action.planKey);- window.location.assign(session.url);- } catch (error) {- if (error instanceof ApiError && error.status === 401) {- await authClient.signIn.social({- callbackURL: `/pricing?checkout=${action.planKey}`,- provider: "google",- });- return;- }-- setStatusMessage("Checkout is not available yet. Please try again soon.");- }- }, [action, checkout]);-- const button =- action.kind === "checkout" ? (- <PillButton- disabled={checkout.isPending}- onClick={handleCheckout}- variant="dark"- >- {checkout.isPending ? "Opening..." : action.label}- </PillButton>- ) : (- <PillButton href={action.href} variant="dark">- {action.label}- </PillButton>- );+ const button = (+ <PillButton href={action.href} variant="dark">+ {action.label}+ </PillButton>+ );return (<TapedCard@@ -148,23 +110,7 @@ export function PricingPlanCard({ plan }: Props) {</div>))}</div>- <div style={{ marginTop: "auto" }}>- {button}- {statusMessage ? (- <div- role="status"- style={{- color: "#4a403d",- fontSize: 13,- fontWeight: 600,- lineHeight: 1.4,- marginTop: 14,- }}- >- {statusMessage}- </div>- ) : null}- </div>+ <div style={{ marginTop: "auto" }}>{button}</div></div></TapedCard>);diff --git a/site/src/app/_components/landing/pricingPlans.ts b/site/src/app/_components/landing/pricingPlans.tsindex 621f39a4..c3421504 100644--- a/site/src/app/_components/landing/pricingPlans.ts+++ b/site/src/app/_components/landing/pricingPlans.ts@@ -1,17 +1,13 @@-import type { BillingPlanKey } from "@/queries/billing";import type { CardColor } from "@/app/_components/landing/theme";-export type PricingPlanAction =- | {- href: string;- kind: "contact" | "link";- label: string;- }- | {- kind: "checkout";- label: string;- planKey: BillingPlanKey;- };+// The shape pricing cards render from. Donkey Use no longer sells through the+// site, so plans exist only where a product still lists them (Cut's landing —+// see cutPricingPlans.ts); every action is a plain link.+export type PricingPlanAction = {+ href: string;+ kind: "contact" | "link";+ label: string;+};export type PricingPlan = {action: PricingPlanAction;@@ -24,58 +20,3 @@ export type PricingPlan = {tapeColor: CardColor;tapePosition?: "left" | "right" | "center";};--const enterpriseFeatures = [- "Team rollout planning",- "Security and deployment review",- "Custom support around your stack",-];--export const pricingPlans = [- {- action: {- kind: "checkout",- label: "Start checkout",- planKey: "pro",- },- body: "For people who want Donkey as a daily Mac assistant for planning, app work, and follow-through.",- color: "cream",- detail: "For individuals",- features: [- "Automate your Mac with text and voice input",- "Prioritized support and feature requests",- "Early access to new features",- ],- name: "Pro",- price: "$20/month",- tapeColor: "coral",- },- {- action: {- href: "mailto:[email protected]",- kind: "contact",- label: "Contact us",- },- body: "Running Donkey across an org? Reach out and we will figure out what makes sense.",- color: "coral",- detail: "built around your team",- features: enterpriseFeatures,- name: "Enterprise",- price: "Let's talk",- tapeColor: "yellow",- tapePosition: "right",- },-] satisfies PricingPlan[];--export const pricingPreviewPlans = [- {- ...pricingPlans[0],- action: {- href: "/sign-up",- kind: "link",- label: "Get Started",- },- body: "Start with the self-serve plan when you want Donkey helping with real Mac work.",- },- pricingPlans[1],-] satisfies PricingPlan[];diff --git a/site/src/app/app/settings/SettingsShell.tsx b/site/src/app/app/settings/SettingsShell.tsxindex cea6125b..7713a967 100644--- a/site/src/app/app/settings/SettingsShell.tsx+++ b/site/src/app/app/settings/SettingsShell.tsx@@ -4,26 +4,18 @@ import Link from "next/link";import { usePathname, useRouter } from "next/navigation";import { useEffect, type ReactNode } from "react";-import { DONKEY_APEX_ORIGIN, isDonkeycutHost } from "@/cut/lib/hosts";import { authClient } from "@/lib/auth-client";import { cn } from "@/lib/utils";import { Skeleton } from "@/components/ui/skeleton";const navItems = [- { href: "/app/settings", label: "Overview" },{ href: "/app/settings/usage", label: "Usage" },{ href: "/app/settings/api-keys", label: "API keys" },];-// On donkeycut.com the same routes serve as Donkey Cut's settings: the Vision-// API keys tab is Donkey-only (its page also redirects there), and sign-in must-// go through the apex one-time-token handoff because Google OAuth cannot-// complete on that domain (see /cut-auth). Reading window.location is safe from-// hydration mismatch: everything host-dependent renders only after the client-// session resolves.-const onDonkeycut = () =>- typeof window !== "undefined" && isDonkeycutHost(window.location.host);-+// The apex Donkey settings. Donkey Cut has its own billing and usage pages+// inside the Cut app (src/app/cut/app/(home)/settings), so this shell serves+// donkeyuse.com only.// The settings UI is fully client-rendered. We guard on the client session and,// if signed out, send the user to Google sign-in (API routes also enforce auth).export function SettingsShell({ children }: { children: ReactNode }) {@@ -33,12 +25,6 @@ export function SettingsShell({ children }: { children: ReactNode }) {useEffect(() => {if (!isPending && !session) {- if (onDonkeycut()) {- window.location.assign(- `${DONKEY_APEX_ORIGIN}/cut-auth?next=${encodeURIComponent("/app/settings")}`,- );- return;- }void authClient.signIn.social({callbackURL: "/app/settings",provider: "google",@@ -69,13 +55,10 @@ export function SettingsShell({ children }: { children: ReactNode }) {className="block h-full w-full object-contain"/></div>- <span>{onDonkeycut() ? "Donkey Cut" : "Donkey"}</span>+ <span>Donkey</span></Link><nav className="flex items-center gap-1">- {(onDonkeycut()- ? navItems.filter((item) => item.label !== "API keys")- : navItems- ).map((item) => (+ {navItems.map((item) => (<Linkkey={item.href}href={item.href}diff --git a/site/src/app/app/settings/_components/SubscriptionCard.tsx b/site/src/app/app/settings/_components/SubscriptionCard.tsxdeleted file mode 100644index ad006b97..00000000--- a/site/src/app/app/settings/_components/SubscriptionCard.tsx+++ /dev/null@@ -1,112 +0,0 @@-"use client";--import {- useOpenBillingPortal,- useStartCheckout,- useSubscription,-} from "@/queries/billing";-import { Badge } from "@/components/ui/badge";-import { Button } from "@/components/ui/button";-import {- Card,- CardContent,- CardDescription,- CardFooter,- CardHeader,- CardTitle,-} from "@/components/ui/card";-import { Skeleton } from "@/components/ui/skeleton";--export function SubscriptionCard() {- const subscription = useSubscription();- const checkout = useStartCheckout();- const portal = useOpenBillingPortal();-- if (subscription.isLoading) {- return (- <Card>- <CardHeader>- <Skeleton className="h-6 w-40" />- </CardHeader>- <CardContent>- <Skeleton className="h-16 w-full" />- </CardContent>- </Card>- );- }-- const data = subscription.data;- const isActive = data?.isActive ?? false;-- return (- <Card>- <CardHeader>- <CardTitle className="flex items-center gap-3">- Vision API plan- {data ? (- <Badge variant={isActive ? "default" : "secondary"}>- {data.status}- </Badge>- ) : null}- </CardTitle>- <CardDescription>- {data- ? `${data.monthlyCallQuota.toLocaleString()} API calls per month.`- : "$50/month · 5,000 API calls per month · 3 requests/second."}- </CardDescription>- </CardHeader>- <CardContent className="text-sm text-muted-foreground">- {data ? (- <div className="space-y-1">- <div>- Renews / ends:{" "}- {data.currentPeriodEnd- ? new Date(data.currentPeriodEnd).toLocaleDateString()- : "—"}- </div>- {data.cancelAtPeriodEnd ? (- <div className="text-foreground">- Cancels at the end of the current period.- </div>- ) : null}- </div>- ) : (- <p>- Subscribe for a monthly quota, or get started with your free calls.- </p>- )}- </CardContent>- <CardFooter className="gap-3">- {data ? (- <Button- disabled={portal.isPending}- onClick={() =>- portal.mutate(undefined, {- onSuccess: (result) => window.location.assign(result.url),- })- }- variant="secondary"- >- {portal.isPending ? "Opening…" : "Manage billing"}- </Button>- ) : (- <Button- disabled={checkout.isPending}- onClick={() =>- checkout.mutate(undefined, {- onSuccess: (result) => window.location.assign(result.url),- })- }- >- {checkout.isPending ? "Starting…" : "Subscribe — $50/mo"}- </Button>- )}- {checkout.isError || portal.isError ? (- <span className="text-sm text-destructive">- Billing is unavailable right now.- </span>- ) : null}- </CardFooter>- </Card>- );-}diff --git a/site/src/app/app/settings/api-keys/page.tsx b/site/src/app/app/settings/api-keys/page.tsxindex 7573f0ac..a1c27b73 100644--- a/site/src/app/app/settings/api-keys/page.tsx+++ b/site/src/app/app/settings/api-keys/page.tsx@@ -1,13 +1,5 @@-import { headers } from "next/headers";-import { redirect } from "next/navigation";-import { ApiKeysManager } from "@/app/app/settings/_components/ApiKeysManager";-import { isDonkeycutHost } from "@/cut/lib/hosts";-// Vision API keys are a Donkey product surface; on donkeycut.com the settings-// pages carry only the Cut-relevant tabs (see SettingsShell), and a deep link-// here lands on the overview instead.-export default async function ApiKeysPage() {- if (isDonkeycutHost((await headers()).get("host"))) redirect("/app/settings");+export default function ApiKeysPage() {return <ApiKeysManager />;}diff --git a/site/src/app/app/settings/page.tsx b/site/src/app/app/settings/page.tsxindex 7925b67f..01c7964a 100644--- a/site/src/app/app/settings/page.tsx+++ b/site/src/app/app/settings/page.tsx@@ -1,24 +1,6 @@-"use client";+import { redirect } from "next/navigation";-import { CreditsCard } from "@/app/app/settings/_components/CreditsCard";-import { ProCard } from "@/app/app/settings/_components/ProCard";-import { SubscriptionCard } from "@/app/app/settings/_components/SubscriptionCard";-import { SuperuserCreditsCard } from "@/app/app/settings/_components/SuperuserCreditsCard";--export default function SettingsOverviewPage() {- return (- <div className="space-y-8">- <div>- <h1 className="text-2xl font-semibold">Overview</h1>- <p className="mt-1 text-sm text-muted-foreground">- Your subscriptions, credit balance, and- usage this billing period.- </p>- </div>- <ProCard />- <CreditsCard />- <SubscriptionCard />- <SuperuserCreditsCard />- </div>- );+// Donkey Use no longer carries payment UI; settings opens on Usage.+export default function SettingsIndexPage() {+ redirect("/app/settings/usage");}diff --git a/site/src/app/pricing/page.tsx b/site/src/app/pricing/page.tsxdeleted file mode 100644index d2c1ce43..00000000--- a/site/src/app/pricing/page.tsx+++ /dev/null@@ -1,12 +0,0 @@-import type { Metadata } from "next";--import { PricingPage } from "@/app/_components/landing/PricingPage";--export const metadata: Metadata = {- title: "Pricing | Donkey",- description: "Pick a Donkey plan for self-serve Pro billing or team rollout.",-};--export default function Page() {- return <PricingPage />;-}diff --git a/site/src/app/use-cases/[slug]/page.tsx b/site/src/app/use-cases/[slug]/page.tsxindex 5b142e0b..b16e492d 100644--- a/site/src/app/use-cases/[slug]/page.tsx+++ b/site/src/app/use-cases/[slug]/page.tsx@@ -118,9 +118,6 @@ export default async function UseCasePage({ params }: PageProps) {Try this with Donkey<ArrowRight size={16} /></PillButton>- <PillButton href="/pricing" variant="secondary">- View pricing- </PillButton></div></div>diff --git a/site/src/app/use-cases/page.tsx b/site/src/app/use-cases/page.tsxindex 11804a5f..92e4d64e 100644--- a/site/src/app/use-cases/page.tsx+++ b/site/src/app/use-cases/page.tsx@@ -95,9 +95,6 @@ export default function UseCasesPage() {Try Donkey<ArrowRight size={16} /></PillButton>- <PillButton href="/pricing" variant="secondary">- View pricing- </PillButton></div></section>