Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Share page

Steven Tey5a2e1d76a4ad
diff --git a/apps/web/app/[domain]/page.tsx b/apps/web/app/[domain]/page.tsx
index caf061f184..dc71b470cb 100644
--- a/apps/web/app/[domain]/page.tsx
+++ b/apps/web/app/[domain]/page.tsx
@@ -1,4 +1,5 @@
-import { Background } from "@dub/ui";
+import { NewBackground } from "@/ui/shared/new-background";
+import { Nav, NavMobile } from "@dub/ui";
import { constructMetadata } from "@dub/utils";
import PlaceholderContent from "./placeholder";
@@ -24,9 +25,11 @@ export async function generateMetadata({
export default function CustomDomainPage() {
return (
- <>
- <Background />
+ <div className="flex min-h-screen flex-col justify-between bg-gray-50/80">
+ <NavMobile />
+ <Nav />
+ <NewBackground />
<PlaceholderContent />
- </>
+ </div>
);
}
diff --git a/apps/web/app/[domain]/layout.tsx b/apps/web/app/app.dub.co/(share)/layout.tsx
similarity index 59%
rename from apps/web/app/[domain]/layout.tsx
rename to apps/web/app/app.dub.co/(share)/layout.tsx
index cd3d427e19..7621f75ebb 100644
--- a/apps/web/app/[domain]/layout.tsx
+++ b/apps/web/app/app.dub.co/(share)/layout.tsx
@@ -1,11 +1,16 @@
import { Footer, Nav, NavMobile } from "@dub/ui";
+import { ReactNode } from "react";
-export default function CustomDomainLayout(props) {
+export default function ShareAnalyticsLayout({
+ children,
+}: {
+ children: ReactNode;
+}) {
return (
<div className="flex min-h-screen flex-col justify-between bg-gray-50/80">
<NavMobile />
<Nav />
- {props.children}
+ {children}
<Footer />
</div>
);
diff --git a/apps/web/app/[domain]/stats/[key]/page.tsx b/apps/web/app/app.dub.co/(share)/share/[id]/page.tsx
similarity index 96%
rename from apps/web/app/[domain]/stats/[key]/page.tsx
rename to apps/web/app/app.dub.co/(share)/share/[id]/page.tsx
index 3e7f0115ce..cf2d1e2493 100644
--- a/apps/web/app/[domain]/stats/[key]/page.tsx
+++ b/apps/web/app/app.dub.co/(share)/share/[id]/page.tsx
@@ -25,7 +25,7 @@ export async function generateMetadata({
});
}
-export default async function StatsPage({
+export default async function SharePage({
params,
}: {
params: { domain: string; key: string };
diff --git a/apps/web/prisma/schema/share.prisma b/apps/web/prisma/schema/share.prisma
new file mode 100644
index 0000000000..a62518c92c
--- /dev/null
+++ b/apps/web/prisma/schema/share.prisma
@@ -0,0 +1,17 @@
+model SharePage {
+ id String @id @default(cuid())
+ name String
+ slug String @unique
+
+ password String?
+
+ link Link? @relation(fields: [linkId], references: [id], onUpdate: Cascade, onDelete: Cascade)
+ linkId String?
+
+ // Project that the share page belongs to
+ project Project? @relation(fields: [projectId], references: [id], onUpdate: Cascade, onDelete: Cascade)
+ projectId String?
+
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+}