Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat: Rename from /share to /s

Richie McIlroyfd4ceff439e8
diff --git a/apps/desktop/src/components/windows/inner/Recorder.tsx b/apps/desktop/src/components/windows/inner/Recorder.tsx
index c4421595d..09c8d4efc 100644
--- a/apps/desktop/src/components/windows/inner/Recorder.tsx
+++ b/apps/desktop/src/components/windows/inner/Recorder.tsx
@@ -205,7 +205,7 @@ export const Recorder = () => {
const url =
process.env.NODE_ENV === "development"
- ? `${process.env.NEXT_PUBLIC_URL}/share/${await getLatestVideoId()}`
+ ? `${process.env.NEXT_PUBLIC_URL}/s/${await getLatestVideoId()}`
: `https://cap.link/${await getLatestVideoId()}`;
await openLinkInBrowser(url);
diff --git a/apps/web/app/dashboard/caps/Caps.tsx b/apps/web/app/dashboard/caps/Caps.tsx
index 2782d28ef..813dee3bb 100644
--- a/apps/web/app/dashboard/caps/Caps.tsx
+++ b/apps/web/app/dashboard/caps/Caps.tsx
@@ -52,7 +52,14 @@ export const Caps = ({ data }: { data: (typeof videos.$inferSelect)[] }) => {
key={index}
className="rounded-xl border border-filler overflow-hidden"
>
- <a className="group" href={`/share/${cap.id}`}>
+ <a
+ className="group"
+ href={
+ process.env.NEXT_PUBLIC_IS_CAP
+ ? `https://cap.link/${cap.id}`
+ : `${process.env.NEXT_PUBLIC_URL}/s/${cap.id}`
+ }
+ >
<div>
<VideoThumbnail
userId={cap.ownerId}
@@ -76,7 +83,7 @@ export const Caps = ({ data }: { data: (typeof videos.$inferSelect)[] }) => {
);
} else {
navigator.clipboard.writeText(
- `${process.env.NEXT_PUBLIC_URL}/share/${cap.id}`
+ `${process.env.NEXT_PUBLIC_URL}/s/${cap.id}`
);
}
toast.success("Link copied to clipboard!");
@@ -84,7 +91,7 @@ export const Caps = ({ data }: { data: (typeof videos.$inferSelect)[] }) => {
value={
process.env.NEXT_PUBLIC_IS_CAP
? `https://cap.link/${cap.id}`
- : `${process.env.NEXT_PUBLIC_URL}/share/${cap.id}`
+ : `${process.env.NEXT_PUBLIC_URL}/s/${cap.id}`
}
></input>
</div>
diff --git a/apps/web/app/share/[videoId]/Share.tsx b/apps/web/app/s/[videoId]/Share.tsx
similarity index 100%
rename from apps/web/app/share/[videoId]/Share.tsx
rename to apps/web/app/s/[videoId]/Share.tsx
diff --git a/apps/web/app/share/[videoId]/_components/AudioPlayer.tsx b/apps/web/app/s/[videoId]/_components/AudioPlayer.tsx
similarity index 100%
rename from apps/web/app/share/[videoId]/_components/AudioPlayer.tsx
rename to apps/web/app/s/[videoId]/_components/AudioPlayer.tsx
diff --git a/apps/web/app/share/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
similarity index 98%
rename from apps/web/app/share/[videoId]/_components/ShareHeader.tsx
rename to apps/web/app/s/[videoId]/_components/ShareHeader.tsx
index b4b65f4a9..b61a87cd8 100644
--- a/apps/web/app/share/[videoId]/_components/ShareHeader.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
@@ -97,7 +97,7 @@ export const ShareHeader = ({
);
} else {
navigator.clipboard.writeText(
- `${process.env.NEXT_PUBLIC_URL}/share/${data.id}`
+ `${process.env.NEXT_PUBLIC_URL}/s/${data.id}`
);
}
toast.success("Link copied to clipboard!");
diff --git a/apps/web/app/share/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
similarity index 100%
rename from apps/web/app/share/[videoId]/_components/ShareVideo.tsx
rename to apps/web/app/s/[videoId]/_components/ShareVideo.tsx
diff --git a/apps/web/app/share/[videoId]/_components/Toolbar.tsx b/apps/web/app/s/[videoId]/_components/Toolbar.tsx
similarity index 100%
rename from apps/web/app/share/[videoId]/_components/Toolbar.tsx
rename to apps/web/app/s/[videoId]/_components/Toolbar.tsx
diff --git a/apps/web/app/share/[videoId]/_components/VideoPlayer.tsx b/apps/web/app/s/[videoId]/_components/VideoPlayer.tsx
similarity index 100%
rename from apps/web/app/share/[videoId]/_components/VideoPlayer.tsx
rename to apps/web/app/s/[videoId]/_components/VideoPlayer.tsx
diff --git a/apps/web/app/share/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx
similarity index 100%
rename from apps/web/app/share/[videoId]/page.tsx
rename to apps/web/app/s/[videoId]/page.tsx
diff --git a/apps/web/app/share/loading.tsx b/apps/web/app/s/loading.tsx
similarity index 100%
rename from apps/web/app/share/loading.tsx
rename to apps/web/app/s/loading.tsx
diff --git a/apps/web/app/share/page.tsx b/apps/web/app/s/page.tsx
similarity index 100%
rename from apps/web/app/share/page.tsx
rename to apps/web/app/s/page.tsx
diff --git a/apps/web/components/Footer.tsx b/apps/web/components/Footer.tsx
index 2f30374e0..d41375e91 100644
--- a/apps/web/components/Footer.tsx
+++ b/apps/web/components/Footer.tsx
@@ -8,7 +8,7 @@ export const Footer = () => {
if (
pathname === "/login" ||
pathname.includes("/dashboard") ||
- pathname.includes("/share") ||
+ pathname.includes("/s/") ||
(typeof window !== "undefined" && window.location.href.includes("cap.link"))
)
return null;
diff --git a/apps/web/components/Navbar.tsx b/apps/web/components/Navbar.tsx
index 620c903ac..c8a42b48a 100644
--- a/apps/web/components/Navbar.tsx
+++ b/apps/web/components/Navbar.tsx
@@ -10,7 +10,7 @@ export const Navbar = () => {
if (
pathname === "/login" ||
pathname.includes("/dashboard") ||
- pathname.includes("/share") ||
+ pathname.includes("/s/") ||
(typeof window !== "undefined" && window.location.href.includes("cap.link"))
)
return null;
diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs
index 42dccace4..a0290a10e 100644
--- a/apps/web/next.config.mjs
+++ b/apps/web/next.config.mjs
@@ -40,21 +40,6 @@ const nextConfig = {
},
],
},
- async redirects() {
- return [
- {
- source: "/:path*",
- has: [
- {
- type: "host",
- value: "cap.link",
- },
- ],
- destination: "https://cap.so/share/:path*",
- permanent: true,
- },
- ];
- },
async rewrites() {
return [
{