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.

Added first changelog

Steven Tey3f4e3d6d740a
diff --git a/app/(marketing)/changelog/[slug]/page.tsx b/app/(marketing)/changelog/[slug]/page.tsx
index 8961a3d6fb..9ce753adad 100644
--- a/app/(marketing)/changelog/[slug]/page.tsx
+++ b/app/(marketing)/changelog/[slug]/page.tsx
@@ -67,10 +67,8 @@ export default async function ChangelogPost({
notFound();
}
- const images = await getImages(post.images || []);
-
return (
- <div className="mx-auto my-20 max-w-screen-md">
+ <div className="mx-auto my-20 flex max-w-screen-md flex-col space-y-8">
<div className="mx-5 grid gap-5 md:mx-0">
<div className="flex space-x-4">
<Link
@@ -86,7 +84,7 @@ export default async function ChangelogPost({
{formatDate(post.publishedAt)}
</time>
</div>
- <h1 className="font-display text-4xl font-bold tracking-tight text-gray-800 sm:text-5xl">
+ <h1 className="font-display text-3xl font-bold tracking-tight text-gray-800 sm:text-4xl">
{post.title}
</h1>
</div>
@@ -98,7 +96,7 @@ export default async function ChangelogPost({
priority // since it's above the fold
placeholder="blur"
blurDataURL={await getBlurDataURL(post.image!)}
- className="my-10 md:rounded-2xl"
+ className="border border-gray-100 md:rounded-2xl"
/>
<div className="mb-10 flex items-center justify-between">
{/* @ts-expect-error Async Server Component */}
@@ -131,7 +129,7 @@ export default async function ChangelogPost({
</Link>
</div>
</div>
- <MDX code={post.body.code} images={images} />
+ <MDX code={post.body.code} />
</div>
);
}
diff --git a/app/(marketing)/changelog/opengraph-image.png b/app/(marketing)/changelog/opengraph-image.png
new file mode 100644
index 0000000000..193475024a
Binary files /dev/null and b/app/(marketing)/changelog/opengraph-image.png differ
diff --git a/app/(marketing)/changelog/page.tsx b/app/(marketing)/changelog/page.tsx
index 4fbd46baf7..9f83e5d8c6 100644
--- a/app/(marketing)/changelog/page.tsx
+++ b/app/(marketing)/changelog/page.tsx
@@ -1,3 +1,90 @@
-export default function Changelog() {
- return <div></div>;
+import BlurImage from "@/components/shared/blur-image";
+import { getBlurDataURL } from "@/lib/images";
+import { allChangelogPosts } from "contentlayer/generated";
+import { Metadata } from "next";
+import { formatDate } from "@/lib/utils";
+import Link from "next/link";
+import { MDX } from "../components/mdx";
+
+export const metadata: Metadata = {
+ title: "Changelog - Dub",
+ description:
+ "All the latest updates, improvements, and fixes to Dub - the link management tool for modern marketing teams.",
+};
+
+export default async function Changelog() {
+ return (
+ <div className="mx-auto max-w-screen-xl md:px-20">
+ <div className="grid border-b border-gray-200 py-20 md:grid-cols-4">
+ <div className="md:col-span-1" />
+ <div className="mx-5 flex flex-col space-y-6 md:col-span-3 md:mx-0">
+ <h1 className="font-display text-4xl font-bold tracking-tight text-gray-800 md:text-5xl">
+ Changelog
+ </h1>
+ <p className="text-lg text-gray-500">
+ All the latest updates, improvements, and fixes to Dub
+ </p>
+ </div>
+ </div>
+
+ <div className="divide-y divide-gray-200">
+ {/* @ts-expect-error Async Server Component */}
+ {allChangelogPosts
+ .sort((a, b) => {
+ if (new Date(a.publishedAt) > new Date(b.publishedAt)) {
+ return -1;
+ }
+ return 1;
+ })
+ .map(async (post, idx) => (
+ <div
+ key={idx}
+ className="grid py-20 md:grid-cols-4 md:px-5 xl:px-0"
+ >
+ <div className="sticky top-10 hidden self-start md:col-span-1 md:block">
+ <time dateTime={post.publishedAt} className="text-gray-500">
+ {formatDate(post.publishedAt)}
+ </time>
+ </div>
+ <div className="md:col-span-3">
+ <div className="flex flex-col gap-6">
+ <Link href={`/changelog/${post.slug}`}>
+ <BlurImage
+ src={post.image}
+ alt={post.title}
+ width={1200}
+ height={900}
+ priority={idx === 0} // since it's above the fold
+ placeholder="blur"
+ blurDataURL={await getBlurDataURL(post.image!)}
+ className="border border-gray-100 md:rounded-2xl"
+ />
+ </Link>
+ <Link
+ href={`/changelog/${post.slug}`}
+ className="group mx-5 flex items-center space-x-3 md:mx-0"
+ >
+ <time
+ dateTime={post.publishedAt}
+ className="text-sm text-gray-500 transition-all group-hover:text-gray-800 md:hidden"
+ >
+ {formatDate(post.publishedAt)}
+ </time>
+ </Link>
+ <Link
+ href={`/changelog/${post.slug}`}
+ className="mx-5 md:mx-0"
+ >
+ <h2 className="font-display text-3xl font-bold tracking-tight text-gray-800 hover:underline hover:decoration-1 hover:underline-offset-4 md:text-4xl">
+ {post.title}
+ </h2>
+ </Link>
+ <MDX code={post.body.code} />
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+ );
}
diff --git a/app/(marketing)/components/author.tsx b/app/(marketing)/components/author.tsx
index 50a3656069..83d7a8ee36 100644
--- a/app/(marketing)/components/author.tsx
+++ b/app/(marketing)/components/author.tsx
@@ -1,7 +1,13 @@
import BlurImage from "@/components/shared/blur-image";
import Link from "next/link";
-export default async function Author({ username }: { username: string }) {
+export default async function Author({
+ username,
+ imageOnly,
+}: {
+ username: string;
+ imageOnly?: boolean;
+}) {
const response = await fetch(
`https://api.twitter.com/1.1/users/show.json?screen_name=${username}`,
{
@@ -22,7 +28,15 @@ export default async function Author({ username }: { username: string }) {
return null;
}
- return (
+ return imageOnly ? (
+ <BlurImage
+ src={data.profile_image_url_https.replace("_normal", "")}
+ alt={data.name}
+ width={36}
+ height={36}
+ className="rounded-full transition-all group-hover:brightness-90"
+ />
+ ) : (
<Link
href={`https://twitter.com/${data.screen_name}`}
className="group flex items-center space-x-3"
diff --git a/app/(marketing)/components/mdx.tsx b/app/(marketing)/components/mdx.tsx
index 8bf540ce2e..33313d0d7c 100644
--- a/app/(marketing)/components/mdx.tsx
+++ b/app/(marketing)/components/mdx.tsx
@@ -30,7 +30,7 @@ const components = {
interface MDXProps {
code: string;
- images: { url: string; blurDataURL: string }[];
+ images?: { url: string; blurDataURL: string }[];
tweets?: any[];
repos?: GithubRepoProps[];
}
@@ -39,6 +39,7 @@ export function MDX({ code, images, tweets, repos }: MDXProps) {
const Component = useMDXComponent(code);
const MDXImage = (props: any) => {
+ if (!images) return null;
const blurDataURL = images.find(
(image) => image.url === props.src,
)?.blurDataURL;
@@ -68,7 +69,7 @@ export function MDX({ code, images, tweets, repos }: MDXProps) {
};
return (
- <article className="prose prose-neutral mx-5 prose-headings:font-display prose-h2:text-3xl prose-thead:text-lg sm:mx-auto">
+ <article className="prose-lg prose-gray mx-5 w-full prose-headings:font-display prose-h2:text-3xl prose-thead:text-lg sm:mx-auto">
<Component components={{ ...components, MDXImage, MDXTweet, MDXRepo }} />
</article>
);
diff --git a/components/app/links/link-filters.tsx b/components/app/links/link-filters.tsx
index 3b0684e1f5..af64997a22 100644
--- a/components/app/links/link-filters.tsx
+++ b/components/app/links/link-filters.tsx
@@ -34,7 +34,7 @@ export default function LinkFilters() {
param="domain"
options={
domains.length === 0
- ? [{ value: primaryDomain, count: 0 }]
+ ? [{ value: primaryDomain || "", count: 0 }]
: domains.map(({ domain, _count }) => ({
value: domain,
count: _count,
@@ -147,7 +147,7 @@ const FilterGroup = ({
</label>
</div>
))}
- {router.query.slug && (
+ {router.query.slug && cta.href && (
<Link
href={cta.href}
className="rounded-md border border-gray-300 p-1 text-center text-sm"
diff --git a/components/app/links/links-container.tsx b/components/app/links/links-container.tsx
index 6f09b0adbd..a6043feb43 100644
--- a/components/app/links/links-container.tsx
+++ b/components/app/links/links-container.tsx
@@ -12,7 +12,7 @@ export default function LinksContainer({
}: {
AddEditLinkButton: () => JSX.Element;
}) {
- const { links, loading } = useLinks();
+ const { links } = useLinks();
const { LinkFiltersButton, LinkFiltersModal } = useLinkFiltersModal();
return (
@@ -28,14 +28,16 @@ export default function LinksContainer({
<LinkFilters />
</div>
<ul className="col-span-1 grid auto-rows-min grid-cols-1 gap-3 lg:col-span-5">
- {loading ? (
+ {links ? (
+ links.length > 0 ? (
+ links.map((props) => <LinkCard key={props.id} props={props} />)
+ ) : (
+ <NoLinksPlaceholder AddEditLinkButton={AddEditLinkButton} />
+ )
+ ) : (
Array.from({ length: 5 }).map((_, i) => (
<LinkCardPlaceholder key={i} />
))
- ) : links.length > 0 ? (
- links.map((props) => <LinkCard key={props.id} props={props} />)
- ) : (
- <NoLinksPlaceholder AddEditLinkButton={AddEditLinkButton} />
)}
</ul>
</div>
diff --git a/lib/swr/use-links-count.ts b/lib/swr/use-links-count.ts
index 0fd3ff00e8..31e38e60cb 100644
--- a/lib/swr/use-links-count.ts
+++ b/lib/swr/use-links-count.ts
@@ -2,9 +2,7 @@ import { useRouter } from "next/router";
import useSWR from "swr";
import { fetcher, getQueryString } from "@/lib/utils";
-export default function useLinksCount({
- groupBy,
-}: { groupBy?: "domain" } = {}) {
+export default function useLinksCount({ groupBy }: { groupBy: "domain" }) {
const router = useRouter();
const { slug } = router.query as {
diff --git a/posts/changelog/first-changelog.mdx b/posts/changelog/first-changelog.mdx
deleted file mode 100644
index 08be5b8f8e..0000000000
--- a/posts/changelog/first-changelog.mdx
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: First Changelog
-publishedAt: 2023-03-31
-summary: "Description"
-image: "https://d2vwwcvoksz7ty.cloudfront.net/changelog/domains-filter.jpeg"
-author: "steventey"
----
-
-Content
diff --git a/posts/changelog/improved-pricing.mdx b/posts/changelog/improved-pricing.mdx
new file mode 100644
index 0000000000..e429c19970
--- /dev/null
+++ b/posts/changelog/improved-pricing.mdx
@@ -0,0 +1,9 @@
+---
+title: Improved pricing, with higher limits for Pro users.
+publishedAt: 2023-04-26
+summary: "Description"
+image: "https://d2vwwcvoksz7ty.cloudfront.net/changelog/unlimited-domains.png"
+author: "steventey"
+---
+
+You can now add unlimied custom domains per project
diff --git a/posts/changelog/unlimited-domains.mdx b/posts/changelog/unlimited-domains.mdx
new file mode 100644
index 0000000000..f0f80cfdbf
--- /dev/null
+++ b/posts/changelog/unlimited-domains.mdx
@@ -0,0 +1,13 @@
+---
+title: Unlimited custom domains per project
+publishedAt: 2023-04-27
+summary: "Description"
+image: "https://d2vwwcvoksz7ty.cloudfront.net/changelog/unlimited-domains.png"
+author: "steventey"
+---
+
+You can now use as many custom domains as you want with your Dub project – you no longer need to create multiple projects for all of your company domains.
+
+You can also filter by domains
+
+This works for all plans, including the Free plan.