Skip to content

Open source CapCut alternative.

TypeScript

feat(site): offer the Mac app from the Cut account menu

David Lede779ad779c7
diff --git a/site/src/app/cut/_components/landing/CutLocal.tsx b/site/src/app/cut/_components/landing/CutLocal.tsx
index cac2b927..356f7a72 100644
--- a/site/src/app/cut/_components/landing/CutLocal.tsx
+++ b/site/src/app/cut/_components/landing/CutLocal.tsx
@@ -6,13 +6,7 @@ import {
Headline,
PillButton,
} from "@/app/_components/landing/LandingPrimitives";
-import { DONKEY_INSTALL_URL } from "@/app/_components/landing/data";
-
-// The install page is served on donkeycut.com and local dev only, so the
-// hosted apex (root "/cut") has to leave for the canonical host.
-function installHref(root: string) {
- return root ? DONKEY_INSTALL_URL : "/install";
-}
+import { cutInstallHref } from "@/cut/lib/install";
export function CutLocal({ root }: { root: string }) {
return (
@@ -30,7 +24,7 @@ export function CutLocal({ root }: { root: string }) {
transcribes audio on device.
</p>
<div className="mt-8">
- <PillButton href={installHref(root)} variant="primary" size="md">
+ <PillButton href={cutInstallHref(root)} variant="primary" size="md">
Download for Mac
</PillButton>
</div>
diff --git a/site/src/cut/components/NavUser.tsx b/site/src/cut/components/NavUser.tsx
index 6b6e0836..b2ee300e 100644
--- a/site/src/cut/components/NavUser.tsx
+++ b/site/src/cut/components/NavUser.tsx
@@ -1,7 +1,14 @@
"use client";
import { useRouter } from "next/navigation";
-import { ChartColumn, CreditCard, EllipsisVertical, Flag, LogOut } from "lucide-react";
+import {
+ ChartColumn,
+ CreditCard,
+ EllipsisVertical,
+ Flag,
+ LogOut,
+ MonitorDown,
+} from "lucide-react";
import {
DropdownMenu,
DropdownMenuContent,
@@ -11,6 +18,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
+import { cutInstallHref } from "@/cut/lib/install";
import { useCutBase } from "@/cut/lib/nav";
import { authClient } from "@/lib/auth-client";
@@ -35,6 +43,7 @@ export function NavUser() {
if (!session) return null;
const { name, email, image } = session.user;
+ const root = base.replace(/\/app$/, "");
const signOut = () => {
// Sign out everywhere: revoke every session for this user (so the Mac app
@@ -46,7 +55,7 @@ export function NavUser() {
await authClient.revokeSessions();
} finally {
await authClient.signOut();
- router.push(base.replace(/\/app$/, "") || "/");
+ router.push(root || "/");
}
})();
};
@@ -79,6 +88,13 @@ export function NavUser() {
<DropdownMenuItem onClick={() => router.push(`${base}/settings/usage`)}>
<ChartColumn /> Usage
</DropdownMenuItem>
+ {/* The install page lives outside the editor, so it opens in its own
+ tab rather than navigating away from an open project. */}
+ <DropdownMenuItem
+ onClick={() => window.open(cutInstallHref(root), "_blank", "noopener")}
+ >
+ <MonitorDown /> Run Donkey Cut locally
+ </DropdownMenuItem>
<DropdownMenuItem onClick={() => router.push(`${base}/settings/flags`)}>
<Flag /> Feature flags
</DropdownMenuItem>
diff --git a/site/src/cut/lib/install.ts b/site/src/cut/lib/install.ts
new file mode 100644
index 00000000..59ae5b07
--- /dev/null
+++ b/site/src/cut/lib/install.ts
@@ -0,0 +1,9 @@
+import { DONKEYCUT_CANONICAL } from "@/cut/lib/hosts";
+
+// Where "get the Mac app" points. The install page is served on donkeycut.com
+// and local dev only, so anywhere the Cut tree runs unrewritten — the hosted
+// apex, where in-app links carry a "/cut" root — the link leaves for the
+// canonical host.
+export function cutInstallHref(root: string): string {
+ return root ? `${DONKEYCUT_CANONICAL}/install` : "/install";
+}