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 image zoom in effect

Steven Tey308b52a3936b
diff --git a/app/dub.sh/changelog/[slug]/page.tsx b/app/dub.sh/changelog/[slug]/page.tsx
index 0330214d4f..dac2767c2f 100644
--- a/app/dub.sh/changelog/[slug]/page.tsx
+++ b/app/dub.sh/changelog/[slug]/page.tsx
@@ -114,7 +114,7 @@ export default async function ChangelogPost({
</Link>
</div>
</div>
- <MDX code={post.body.code} />
+ <MDX code={post.body.code} className="mx-5 sm:prose-lg md:mx-0" />
<div className="mt-10 flex justify-end border-t border-gray-200 pt-5">
<Link
href={`https://github.com/steven-tey/dub/blob/main/posts/changelog/${params.slug}.mdx`}
diff --git a/app/dub.sh/changelog/page.tsx b/app/dub.sh/changelog/page.tsx
index 118817d27c..3ba02da05e 100644
--- a/app/dub.sh/changelog/page.tsx
+++ b/app/dub.sh/changelog/page.tsx
@@ -69,41 +69,39 @@ export default async function Changelog() {
</time>
</Link>
</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={630}
- 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"
+ <div className="flex flex-col gap-6 md:col-span-3">
+ <Link href={`/changelog/${post.slug}`}>
+ <BlurImage
+ src={post.image}
+ alt={post.title}
+ width={1200}
+ height={630}
+ 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"
>
- <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>
+ {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}
+ className="mx-5 sm:prose-lg md:mx-0"
+ />
</div>
</div>
))}
diff --git a/app/dub.sh/help/article/[slug]/page.tsx b/app/dub.sh/help/article/[slug]/page.tsx
index a9a838c806..1c2a2591c1 100644
--- a/app/dub.sh/help/article/[slug]/page.tsx
+++ b/app/dub.sh/help/article/[slug]/page.tsx
@@ -107,7 +107,7 @@ export default async function HelpArticle({
</div>
<div className="flex flex-col space-y-4">
<Link href={`/help/article/${data.slug}`}>
- <h1 className="font-display text-2xl font-bold sm:text-4xl">
+ <h1 className="font-display text-3xl font-bold !leading-snug sm:text-4xl">
{data.title}
</h1>
</Link>
diff --git a/app/ui/content/author.tsx b/app/ui/content/author.tsx
index 2b9dd44541..6b5b4f39f1 100644
--- a/app/ui/content/author.tsx
+++ b/app/ui/content/author.tsx
@@ -17,6 +17,11 @@ export default async function Author({
image:
"https://pbs.twimg.com/profile_images/1506792347840888834/dS-r50Je_400x400.jpg",
},
+ fmerian: {
+ name: "Flo Merian",
+ image:
+ "https://pbs.twimg.com/profile_images/846637761792790528/WtCc8Xy7_400x400.jpg",
+ },
};
return imageOnly ? (
diff --git a/app/ui/content/mdx.tsx b/app/ui/content/mdx.tsx
index 778b999151..f46e95f20b 100644
--- a/app/ui/content/mdx.tsx
+++ b/app/ui/content/mdx.tsx
@@ -6,6 +6,9 @@ import Tweet from "#/ui/tweet";
import GithubRepo, { GithubRepoProps } from "@/components/shared/github-repo";
import BlurImage from "#/ui/blur-image";
import { Tweet as TweetProps } from "react-tweet/api";
+import { cn } from "#/lib/utils";
+import Zoom from "react-medium-image-zoom";
+import "react-medium-image-zoom/dist/styles.css";
const CustomLink = (props: any) => {
const href = props.href;
@@ -47,9 +50,10 @@ interface MDXProps {
images?: { alt: string; src: string; blurDataURL: string }[];
tweets?: any[];
repos?: GithubRepoProps[];
+ className?: string;
}
-export function MDX({ code, images, tweets, repos }: MDXProps) {
+export function MDX({ code, images, tweets, repos, className }: MDXProps) {
const Component = useMDXComponent(code);
const MDXImage = (props: any) => {
@@ -60,16 +64,17 @@ export function MDX({ code, images, tweets, repos }: MDXProps) {
return (
<div className="not-prose flex flex-col items-center justify-center space-y-3">
- <BlurImage
- {...props}
- onClick={() => window.open(props.src, "_blank")}
- className="cursor-zoom-in rounded-lg border border-gray-200"
- placeholder="blur"
- blurDataURL={
- blurDataURL ||
- "data:image/webp;base64,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
- }
- />
+ <Zoom>
+ <BlurImage
+ {...props}
+ className="rounded-lg border border-gray-200"
+ placeholder="blur"
+ blurDataURL={
+ blurDataURL ||
+ "data:image/webp;base64,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
+ }
+ />
+ </Zoom>
<p className="text-sm italic text-gray-500">{props.alt}</p>
</div>
);
@@ -90,7 +95,10 @@ export function MDX({ code, images, tweets, repos }: MDXProps) {
return (
<article
data-mdx-container
- className="prose prose-gray w-full transition-all prose-headings:relative prose-headings:scroll-mt-20 prose-headings:font-display prose-headings:font-bold"
+ className={cn(
+ "prose prose-gray max-w-none transition-all prose-headings:relative prose-headings:scroll-mt-20 prose-headings:font-display prose-headings:font-bold",
+ className,
+ )}
>
<Component
components={{ ...components, Image: MDXImage, MDXTweet, MDXRepo }}
diff --git a/package.json b/package.json
index 8f3e17cf2d..797e339155 100644
--- a/package.json
+++ b/package.json
@@ -69,6 +69,7 @@
"react-dom-confetti": "^0.2.0",
"react-email": "^1.9.4",
"react-highlight-words": "^0.20.0",
+ "react-medium-image-zoom": "^5.1.6",
"react-parallax-tilt": "^1.7.70",
"react-spring": "^9.5.5",
"react-textarea-autosize": "^8.4.0",
diff --git a/posts/changelog/public-stats-pages.mdx b/posts/changelog/public-stats-pages.mdx
index ec32152708..051622b38d 100644
--- a/posts/changelog/public-stats-pages.mdx
+++ b/posts/changelog/public-stats-pages.mdx
@@ -10,7 +10,4 @@ You can now create a public stats dashboard for your short links on Dub.
This allows you to share the stats for a given short link with clients or other external stakeholders without having to invite them to your Dub project.
-### How to create a public stats page
-
-- Go to your dashboard and click on the number of clicks next to the QR Code button to open the **Stats** page.
-- Click on the **Share** button and toggle **Public Stats Page** on.
+Read more on how to create a public stats page [here](/help/article/public-stats-pages).
diff --git a/posts/help/how-to-use-tags.mdx b/posts/help/how-to-use-tags.mdx
index d5775aeb04..bab94f46c2 100644
--- a/posts/help/how-to-use-tags.mdx
+++ b/posts/help/how-to-use-tags.mdx
@@ -9,6 +9,13 @@ categories:
Tags are a great way to organize your links on Dub. You can use tags to group links together and make it easier to find them later.
+<Image
+ alt="Using tags to organize links on Dub"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/new-tag-creation-flow.png"
+ width={1824}
+ height={995}
+/>
+
## What is a Tag?
A tag is a label that you can assign to a link. Tags are color coded
diff --git a/posts/help/public-stats-pages.mdx b/posts/help/public-stats-pages.mdx
new file mode 100644
index 0000000000..8da0fbbf53
--- /dev/null
+++ b/posts/help/public-stats-pages.mdx
@@ -0,0 +1,13 @@
+---
+title: Public stats pages
+updatedAt: 2023-07-18
+summary: Learn how to create public stats pages for your Dub short links.
+author: fmerian
+categories:
+ - link-management
+---
+
+## Introduction
+
+- Go to your dashboard and click on the number of clicks next to the QR Code button to open the **Stats** page.
+- Click on the **Share** button and toggle **Public Stats Page** on.
diff --git a/yarn.lock b/yarn.lock
index bce29fa732..e0f8e016fa 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7257,6 +7257,11 @@ react-is@^16.13.1:
resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
+react-medium-image-zoom@^5.1.6:
+ version "5.1.6"
+ resolved "https://registry.yarnpkg.com/react-medium-image-zoom/-/react-medium-image-zoom-5.1.6.tgz#1ec9dabbc88da664f3aacc03a93cf79cb1b70a23"
+ integrity sha512-0QolPce1vNJsF5HKrGkU1UT6kLNvY9EOnLBqz++LlVnBQduaHLkJlY73ayj3SxY09XWRrnxKDMTHPDkrQYdREw==
+
react-merge-refs@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/react-merge-refs/-/react-merge-refs-1.1.0.tgz"