The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
bug fix
Steven Tey4a8b799d9a69
diff --git a/components/app/links/link-card.tsx b/components/app/links/link-card.tsxindex 5687727368..ad4bc58f37 100644--- a/components/app/links/link-card.tsx+++ b/components/app/links/link-card.tsx@@ -137,7 +137,7 @@ export default function LinkCard({ props }: { props: LinkProps }) {<div className="w-24 -translate-x-2 cursor-not-allowed truncate text-sm font-semibold text-gray-400 line-through sm:w-full sm:text-base">{linkConstructor({key,- domain: punycode.toUnicode(domain),+ domain: punycode.toUnicode(domain || ""),pretty: true,})}</div>@@ -151,7 +151,7 @@ export default function LinkCard({ props }: { props: LinkProps }) {>{linkConstructor({key,- domain: punycode.toUnicode(domain),+ domain: punycode.toUnicode(domain || ""),pretty: true,})}</a>diff --git a/components/app/links/link-filters.tsx b/components/app/links/link-filters.tsxindex af18932c89..3b0684e1f5 100644--- a/components/app/links/link-filters.tsx+++ b/components/app/links/link-filters.tsx@@ -142,7 +142,7 @@ const FilterGroup = ({htmlFor={value}className="flex w-full cursor-pointer justify-between px-3 py-2 pl-0 text-sm font-medium text-gray-700">- <p>{punycode.toUnicode(value)}</p>+ <p>{punycode.toUnicode(value || "")}</p><p className="text-gray-500">{nFormatter(count)}</p></label></div>diff --git a/components/app/modals/add-edit-link-modal/index.tsx b/components/app/modals/add-edit-link-modal/index.tsxindex a87a1c9d42..3ebb641570 100644--- a/components/app/modals/add-edit-link-modal/index.tsx+++ b/components/app/modals/add-edit-link-modal/index.tsx@@ -262,7 +262,7 @@ function AddEditLinkModal({{props? `Edit ${linkConstructor({key: props.key,- domain: punycode.toUnicode(props.domain),+ domain: punycode.toUnicode(props.domain || ""),pretty: true,})}`: "Create a new link"}@@ -429,7 +429,7 @@ function AddEditLinkModal({>{domains?.map(({ slug }) => (<option key={slug} value={slug}>- {punycode.toUnicode(slug)}+ {punycode.toUnicode(slug || "")}</option>))}</select>diff --git a/emails/BigUpdates.tsx b/emails/BigUpdates.tsxnew file mode 100644index 0000000000..bb4f899f77--- /dev/null+++ b/emails/BigUpdates.tsx@@ -0,0 +1,180 @@+import {+ Mjml,+ MjmlBody,+ MjmlColumn,+ MjmlImage,+ MjmlSection,+ MjmlText,+ MjmlWrapper,+} from "mjml-react";+import Divider from "./components/Divider";+import Footer from "./components/Footer";+import Head from "./components/Head";+import Header from "./components/Header";+import { grayDark } from "./components/theme";++export default function BigUpdates({ slug }): JSX.Element {+ return (+ <Mjml>+ <Head />+ <MjmlBody width={500}>+ <MjmlWrapper cssClass="container">+ <Header title="Exciting New Updates from Dub" />+ <MjmlSection padding="0">+ <MjmlColumn>+ <MjmlImage+ cssClass="hero"+ padding="0"+ align="left"+ src="https://d2vwwcvoksz7ty.cloudfront.net/email-assets/updates.gif"+ />+ </MjmlColumn>+ </MjmlSection>+ <MjmlSection cssClass="smooth">+ <MjmlColumn>+ <MjmlText cssClass="paragraph">Happy Friday! </MjmlText>+ <MjmlText cssClass="paragraph">+ Today, we are rolling out one of the biggest updates to{" "}+ <a href="https://dub.sh" target="_blank">+ Dub+ </a>+ :+ </MjmlText>+ <MjmlText cssClass="li">+ ◆ Unlimited custom domains per project+ </MjmlText>+ <MjmlText cssClass="li">+ ◆ Improved pricing (higher limits)+ </MjmlText>+ <MjmlText cssClass="li">◆ Link search</MjmlText>+ <MjmlText cssClass="li">+ ◆ Ability to duplicate a link+ </MjmlText>+ <MjmlText cssClass="li">+ ◆ Project-level billing+ </MjmlText>++ <Divider bottomPadding />+ <MjmlText cssClass="subtitle">+ 1. Unlimited custom domains per project+ </MjmlText>++ <MjmlText cssClass="paragraph">+ You can now use as many custom domains as you want with your Dub+ project - no need to create multiple projects for all your+ domains.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ The best part? Filtering your short links by custom domain+ </MjmlText>+ <MjmlImage+ cssClass="hero"+ padding="0"+ align="left"+ src="https://d2vwwcvoksz7ty.cloudfront.net/email-assets/domains-filter.jpeg"+ />++ <Divider bottomPadding />+ <MjmlText cssClass="subtitle">+ 2. Improved pricing, with higher limits for Pro users.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ Migrating to Tinybird earlier this year allowed us to scale our+ platform by magnitudes.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ Thanks to that, we're also increasing the limits for our Pro+ plan from 10K clicks/month to 50K clicks/month.+ </MjmlText>+ {slug ? (+ <MjmlText cssClass="paragraph">+ <a+ href={`https://app.dub.sh/${slug}/settings/billing`}+ target="_blank"+ >+ Upgrade to Pro+ </a>{" "}+ today.+ </MjmlText>+ ) : (+ <MjmlText cssClass="paragraph">+ Check out our{" "}+ <a href="https://dub.sh#pricing" target="_blank">+ new pricing structure+ </a>+ .+ </MjmlText>+ )}++ <Divider bottomPadding />+ <MjmlText cssClass="subtitle">3. Link search</MjmlText>+ <MjmlText cssClass="paragraph">+ You can now search through your existing short links by their+ key and destination URL.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ This has been a popular feature request for folks with a ton of+ short links, so I'm super excited to see this land.+ </MjmlText>+ <MjmlImage+ cssClass="hero"+ padding="0"+ align="left"+ src="https://d2vwwcvoksz7ty.cloudfront.net/email-assets/link-search.gif"+ />++ <Divider bottomPadding />+ <MjmlText cssClass="subtitle">+ 4. Ability to duplicate a link+ </MjmlText>+ <MjmlText cssClass="paragraph">+ This is a quality-of-life improvement for busy marketers who+ want to quickly create multiple version of a short link.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ Shoutout to Cameron Archer from Tinybird for the feature+ request!+ </MjmlText>+ <MjmlImage+ cssClass="hero"+ padding="0"+ align="left"+ src="https://d2vwwcvoksz7ty.cloudfront.net/email-assets/duplicate-link.gif"+ />++ <Divider bottomPadding />+ <MjmlText cssClass="subtitle">5. Project-level billing</MjmlText>++ <MjmlText cssClass="paragraph">+ Previously, having billing on a personal account level was a+ confusing UX.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ Often times, users would upgrade to Pro on their personal+ accounts but not their project. They also couldn't invite+ teammates to pay invoices.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ Migrating billing to the project-level fixes that.+ </MjmlText>++ <Divider bottomPadding />+ <MjmlText cssClass="paragraph">+ This update was many months in the making, so I'm very excited+ to see it finally land.+ </MjmlText>+ <MjmlText cssClass="paragraph">+ Have a wonderful weekend!+ </MjmlText>+ <MjmlText cssClass="paragraph" color={grayDark}>+ Steven from Dub+ </MjmlText>+ <Divider />+ </MjmlColumn>+ </MjmlSection>+ <Footer unsubscribe />+ </MjmlWrapper>+ </MjmlBody>+ </Mjml>+ );+}diff --git a/emails/FeatureUpdates.tsx b/emails/FeatureUpdates.tsxindex 5fada98f32..a1a83e5415 100644--- a/emails/FeatureUpdates.tsx+++ b/emails/FeatureUpdates.tsx@@ -11,7 +11,7 @@ import Divider from "./components/Divider";import Footer from "./components/Footer";import Head from "./components/Head";import Header from "./components/Header";-import { grayDark, purple } from "./components/theme";+import { grayDark } from "./components/theme";export default function FeatureUpdates(): JSX.Element {return (diff --git a/emails/components/Head.tsx b/emails/components/Head.tsxindex 3ba0b5f6ef..ece99be5c6 100644--- a/emails/components/Head.tsx+++ b/emails/components/Head.tsx@@ -52,6 +52,7 @@ export default function Head(): JSX.Element {.paragraph a, .li a {color: ${blue} !important;text-decoration: none;+ font-weight: 700;}.paragraph code, .li code {color: ${purple} !important;diff --git a/emails/previews/Sequences.tsx b/emails/previews/Sequences.tsxindex 2c224800f2..70f89a1b58 100644--- a/emails/previews/Sequences.tsx+++ b/emails/previews/Sequences.tsx@@ -1,5 +1,6 @@import { default as BelatedWelcomeEmail } from "../BelatedWelcome";import { default as FeatureUpdatesEmail } from "../FeatureUpdates";+import { default as BigUpdatesEmail } from "../BigUpdates";export function BelatedWelcome() {return <BelatedWelcomeEmail />;@@ -8,3 +9,7 @@ export function BelatedWelcome() {export function FeatureUpdates() {return <FeatureUpdatesEmail />;}++export function BigUpdates() {+ return <BigUpdatesEmail slug={"steven"} />;+}diff --git a/lib/utils.ts b/lib/utils.tsindex 0939c88f6f..a2e7339ceb 100644--- a/lib/utils.ts+++ b/lib/utils.ts@@ -66,6 +66,20 @@ export function capitalize(str: string) {return str.charAt(0).toUpperCase() + str.slice(1);}+export const chunk = <T>(array: T[], chunk_size: number): T[][] => {+ return array.reduce((resultArray, item, index) => {+ const chunkIndex = Math.floor(index / chunk_size);++ if (!resultArray[chunkIndex]) {+ resultArray[chunkIndex] = []; // start a new chunk+ }++ resultArray[chunkIndex].push(item);++ return resultArray;+ }, [] as T[][]);+};+export function linkConstructor({key,domain = "dub.sh",