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.

add changelog section to landing page

Steven Tey1b0e3caf5547
diff --git a/app/dub.sh/page.tsx b/app/dub.sh/page.tsx
index 5bd14bcf5c..bea6dfb775 100644
--- a/app/dub.sh/page.tsx
+++ b/app/dub.sh/page.tsx
@@ -7,6 +7,7 @@ import Logos from "#/ui/home/logos";
import OSS from "#/ui/home/oss";
import Testimonials from "#/ui/home/testimonials";
import { constructMetadata } from "#/lib/utils";
+import Changelog from "#/ui/home/changelog";
export const metadata = constructMetadata({});
@@ -20,6 +21,7 @@ export default function Home() {
<Stats />
<Features />
<Testimonials />
+ <Changelog />
<OSS />
</>
);
diff --git a/app/ui/home/changelog.tsx b/app/ui/home/changelog.tsx
new file mode 100644
index 0000000000..6142bea421
--- /dev/null
+++ b/app/ui/home/changelog.tsx
@@ -0,0 +1,90 @@
+import { formatDate } from "#/lib/utils";
+import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { allChangelogPosts } from "contentlayer/generated";
+import Link from "next/link";
+
+export default function Changelog() {
+ return (
+ <MaxWidthWrapper className="space-y-5 pt-20 md:space-y-10">
+ <div className="mx-auto max-w-md text-center sm:max-w-xl">
+ <h2 className="font-display text-4xl font-extrabold leading-tight text-black sm:text-5xl sm:leading-tight">
+ We ship{" "}
+ <span className="bg-gradient-to-br from-green-600 to-green-300 bg-clip-text pr-2 italic text-transparent">
+ fast
+ </span>
+ </h2>
+ <p className="mt-5 text-gray-600 sm:text-lg">
+ Check out our changelog to see what's new on Dub.
+ </p>
+ </div>
+ <ul className="mx-5 max-w-2xl md:mx-auto md:translate-x-28">
+ {allChangelogPosts
+ .sort(
+ (a, b) =>
+ Number(new Date(b.publishedAt)) - Number(new Date(a.publishedAt)),
+ )
+ .slice(0, 6)
+ .map((post) => (
+ <li key={post.slug}>
+ <DesktopChangelogEntry post={post} />
+ <MobileChangelogEntry post={post} />
+ </li>
+ ))}
+ </ul>
+ <Link
+ href="/changelog"
+ className="mx-auto block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white hover:bg-white hover:text-black"
+ >
+ Full changelog
+ </Link>
+ </MaxWidthWrapper>
+ );
+}
+
+const DesktopChangelogEntry = ({ post }) => (
+ <Link
+ href={`/changelog/${post.slug}`}
+ className="group hidden grid-cols-5 items-center md:grid"
+ >
+ <dl>
+ <dt className="sr-only">Published on</dt>
+ <dd className="text-base font-medium text-gray-400 transition-colors group-hover:text-gray-700">
+ <time dateTime={post.publishedAt}>{formatDate(post.publishedAt)}</time>
+ </dd>
+ </dl>
+ <div className="col-span-4 flex items-center">
+ <div className="relative">
+ <div className="h-16 border-l border-gray-400 pr-8" />
+ <div className="absolute -left-1 top-[1.6875rem] h-2.5 w-2.5 rounded-full bg-gray-400 transition-colors group-hover:bg-gray-700" />
+ </div>
+ <h3 className="text-2xl font-medium tracking-tight text-gray-700 transition-colors group-hover:text-black">
+ {post.title}
+ </h3>
+ </div>
+ </Link>
+);
+
+const MobileChangelogEntry = ({ post }) => (
+ <Link
+ href={`/changelog/${post.slug}`}
+ className="flex items-center space-x-4 rounded-lg active:bg-gray-100 md:hidden"
+ >
+ <div className="relative">
+ <div className="h-16 border-l border-gray-400" />
+ <div className="absolute -left-1 top-5 h-2.5 w-2.5 rounded-full bg-gray-400" />
+ </div>
+ <div>
+ <dl>
+ <dt className="sr-only">Published on</dt>
+ <dd className="text-sm font-medium text-gray-400">
+ <time dateTime={post.publishedAt}>
+ {formatDate(post.publishedAt)}
+ </time>
+ </dd>
+ </dl>
+ <h3 className="text-lg font-medium tracking-tight text-gray-700">
+ {post.title}
+ </h3>
+ </div>
+ </Link>
+);
diff --git a/app/ui/home/oss.tsx b/app/ui/home/oss.tsx
index 11edcb13fc..957e3ea827 100644
--- a/app/ui/home/oss.tsx
+++ b/app/ui/home/oss.tsx
@@ -21,36 +21,38 @@ export default async function OSS() {
).then((res) => res.json());
return (
- <div className="mt-28 border-t border-gray-200 bg-white/10 py-20 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur">
- <div className="mx-auto max-w-md text-center sm:max-w-xl">
- <h2 className="bg-gradient-to-r from-gray-800 via-gray-500 to-gray-800 bg-clip-text font-display text-4xl font-extrabold leading-tight text-transparent sm:text-5xl sm:leading-tight">
- Proudly open-source
- </h2>
- <p className="mt-5 text-gray-600 sm:text-lg">
- Our source code is available on GitHub - feel free to read, review, or
- contribute to it however you want!
- </p>
- </div>
- <div className="flex items-center justify-center py-10">
- <a
- href="https://github.com/steven-tey/dub"
- target="_blank"
- rel="noreferrer"
- >
- <div className="flex items-center">
- <div className="flex h-10 items-center space-x-2 rounded-md border border-gray-600 bg-gray-800 p-4">
- <Github className="h-5 w-5 text-white" />
- <p className="font-medium text-white">Star</p>
+ <div className="mt-20 border-t border-gray-200 bg-white/10 py-20 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur">
+ <MaxWidthWrapper>
+ <div className="mx-auto max-w-md text-center sm:max-w-xl">
+ <h2 className="bg-gradient-to-r from-gray-800 via-gray-500 to-gray-800 bg-clip-text font-display text-4xl font-extrabold leading-tight text-transparent sm:text-5xl sm:leading-tight">
+ Proudly open-source
+ </h2>
+ <p className="mt-5 text-gray-600 sm:text-lg">
+ Our source code is available on GitHub - feel free to read, review,
+ or contribute to it however you want!
+ </p>
+ </div>
+ <div className="flex items-center justify-center py-10">
+ <a
+ href="https://github.com/steven-tey/dub"
+ target="_blank"
+ rel="noreferrer"
+ >
+ <div className="flex items-center">
+ <div className="flex h-10 items-center space-x-2 rounded-md border border-gray-600 bg-gray-800 p-4">
+ <Github className="h-5 w-5 text-white" />
+ <p className="font-medium text-white">Star</p>
+ </div>
+ <div className={styles.label}>
+ <CountingNumbers
+ value={stars}
+ className="font-display font-medium text-white"
+ />
+ </div>
</div>
- <div className={styles.label}>
- <CountingNumbers
- value={stars}
- className="font-display font-medium text-white"
- />
- </div>
- </div>
- </a>
- </div>
+ </a>
+ </div>
+ </MaxWidthWrapper>
</div>
);
}
diff --git a/components/shared/max-width-wrapper.tsx b/components/shared/max-width-wrapper.tsx
index 199af481b3..038979c9a0 100644
--- a/components/shared/max-width-wrapper.tsx
+++ b/components/shared/max-width-wrapper.tsx
@@ -1,3 +1,4 @@
+import { cn } from "#/lib/utils";
import { ReactNode } from "react";
export default function MaxWidthWrapper({
@@ -9,7 +10,10 @@ export default function MaxWidthWrapper({
}) {
return (
<div
- className={`mx-auto w-full max-w-screen-xl px-2.5 md:px-20 ${className}`}
+ className={cn(
+ "mx-auto w-full max-w-screen-xl px-2.5 md:px-20",
+ className,
+ )}
>
{children}
</div>