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.

Pushed up changes

Steven Tey9e3efbc5d662
diff --git a/app/ui/home/changelog.tsx b/app/ui/home/changelog.tsx
index 6142bea421..a6659fdc00 100644
--- a/app/ui/home/changelog.tsx
+++ b/app/ui/home/changelog.tsx
@@ -1,6 +1,6 @@
import { formatDate } from "#/lib/utils";
import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
-import { allChangelogPosts } from "contentlayer/generated";
+import { allBlogPosts, allChangelogPosts } from "contentlayer/generated";
import Link from "next/link";
export default function Changelog() {
@@ -18,11 +18,8 @@ export default function Changelog() {
</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)),
- )
+ {[...allBlogPosts, ...allChangelogPosts]
+ .sort((a, b) => b.publishedAt.localeCompare(a.publishedAt))
.slice(0, 6)
.map((post) => (
<li key={post.slug}>
@@ -43,7 +40,7 @@ export default function Changelog() {
const DesktopChangelogEntry = ({ post }) => (
<Link
- href={`/changelog/${post.slug}`}
+ href={`/${post.type === "BlogPost" ? "blog" : "changelog"}/${post.slug}`}
className="group hidden grid-cols-5 items-center md:grid"
>
<dl>
@@ -66,7 +63,7 @@ const DesktopChangelogEntry = ({ post }) => (
const MobileChangelogEntry = ({ post }) => (
<Link
- href={`/changelog/${post.slug}`}
+ href={`/${post.type === "BlogPost" ? "blog" : "changelog"}/${post.slug}`}
className="flex items-center space-x-4 rounded-lg active:bg-gray-100 md:hidden"
>
<div className="relative">
diff --git a/app/ui/home/nav.tsx b/app/ui/home/nav.tsx
index 20eba022a9..93d686f854 100644
--- a/app/ui/home/nav.tsx
+++ b/app/ui/home/nav.tsx
@@ -20,7 +20,7 @@ export const navItems = [
slug: "changelog",
},
{
- name: "Help Center",
+ name: "Help",
slug: "help",
},
{
diff --git a/app/ui/modal.tsx b/app/ui/modal.tsx
index b906641973..65e2703824 100644
--- a/app/ui/modal.tsx
+++ b/app/ui/modal.tsx
@@ -83,6 +83,7 @@ export default function Modal({
<Dialog.Content
onOpenAutoFocus={(e) => e.preventDefault()}
onCloseAutoFocus={(e) => e.preventDefault()}
+ onInteractOutside={(e) => e.preventDefault()}
className={cn(
"fixed inset-0 z-50 m-auto max-h-fit w-full max-w-md animate-scale-in overflow-hidden rounded-2xl border border-gray-200 bg-white p-0 shadow-xl",
className,
diff --git a/app/ui/popover.tsx b/app/ui/popover.tsx
index 681a016f13..f7df4b6b38 100644
--- a/app/ui/popover.tsx
+++ b/app/ui/popover.tsx
@@ -49,7 +49,7 @@ export default function Popover({
<PopoverPrimitive.Content
sideOffset={4}
align={align}
- className="z-20 hidden animate-slide-up-fade items-center rounded-md border border-gray-200 bg-white drop-shadow-lg md:block"
+ className="z-50 hidden animate-slide-up-fade items-center rounded-md border border-gray-200 bg-white drop-shadow-lg md:block"
>
{content}
</PopoverPrimitive.Content>
diff --git a/app/ui/tooltip.tsx b/app/ui/tooltip.tsx
index 86ccdcaf20..57fdd29157 100644
--- a/app/ui/tooltip.tsx
+++ b/app/ui/tooltip.tsx
@@ -70,10 +70,8 @@ export default function Tooltip({
className="z-50 hidden animate-slide-up-fade items-center overflow-hidden rounded-md border border-gray-100 bg-white shadow-md sm:block"
>
{typeof content === "string" ? (
- <div className="px-4 py-2">
- <span className="block max-w-xs text-center text-sm text-gray-700">
- {content}
- </span>
+ <div className="block max-w-xs px-4 py-2 text-center text-sm text-gray-700">
+ {content}
</div>
) : (
content
diff --git a/components/app/modals/add-edit-domain-modal.tsx b/components/app/modals/add-edit-domain-modal.tsx
index ce7f19db1f..9c1213e11a 100644
--- a/components/app/modals/add-edit-domain-modal.tsx
+++ b/components/app/modals/add-edit-domain-modal.tsx
@@ -240,7 +240,7 @@ function AddEditDomainModal({
Domain is already in use.{" "}
<a
className="underline"
- href="mailto:[email protected]?subject=My Domain Is Already In Use"
+ href="mailto:[email protected]?subject=My Domain Is Already In Use"
>
Contact us
</a>{" "}
diff --git a/components/app/modals/add-edit-link-modal/index.tsx b/components/app/modals/add-edit-link-modal/index.tsx
index 035f838402..85625d74ff 100644
--- a/components/app/modals/add-edit-link-modal/index.tsx
+++ b/components/app/modals/add-edit-link-modal/index.tsx
@@ -35,7 +35,11 @@ import ExpirationSection from "./expiration-section";
import IOSSection from "./ios-section";
import AndroidSection from "./android-section";
import Preview from "./preview";
-import { DEFAULT_LINK_PROPS, GOOGLE_FAVICON_URL } from "#/lib/constants";
+import {
+ DEFAULT_LINK_PROPS,
+ GOOGLE_FAVICON_URL,
+ HOME_DOMAIN,
+} from "#/lib/constants";
import useDomains from "#/lib/swr/use-domains";
import { toast } from "sonner";
import va from "@vercel/analytics";
diff --git a/components/app/modals/add-edit-link-modal/tags-section.tsx b/components/app/modals/add-edit-link-modal/tags-section.tsx
index c1f5722509..64fb842c71 100644
--- a/components/app/modals/add-edit-link-modal/tags-section.tsx
+++ b/components/app/modals/add-edit-link-modal/tags-section.tsx
@@ -16,6 +16,7 @@ import { toast } from "sonner";
import { mutate } from "swr";
import { LoadingCircle } from "#/ui/icons";
import Tooltip from "#/ui/tooltip";
+import { HOME_DOMAIN } from "#/lib/constants";
export default function TagsSection({
data,
@@ -111,7 +112,24 @@ export default function TagsSection({
{creatingTag ? (
<LoadingCircle />
) : (
- <Tooltip content="Tags are used to organize your links in your Dub dashboard. You can edit and customize your tags under the Tags filter section on the left sidebar.">
+ <Tooltip
+ content={
+ <div className="block max-w-xs px-4 py-2 text-center text-sm text-gray-700">
+ <p>
+ Tags are used to organize your links in your Dub
+ dashboard.{" "}
+ <a
+ href={`${HOME_DOMAIN}/help/article/how-to-use-tags`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-gray-500 underline underline-offset-4 hover:text-gray-800"
+ >
+ Learn more about tags.
+ </a>
+ </p>
+ </div>
+ }
+ >
<Tag className="h-4 w-4" />
</Tooltip>
)}
diff --git a/components/app/modals/add-project-modal.tsx b/components/app/modals/add-project-modal.tsx
index 4c185e108d..fb7a500a60 100644
--- a/components/app/modals/add-project-modal.tsx
+++ b/components/app/modals/add-project-modal.tsx
@@ -19,6 +19,7 @@ import va from "@vercel/analytics";
import Button from "#/ui/button";
import { toast } from "sonner";
import { InfoTooltip } from "#/ui/tooltip";
+import { HOME_DOMAIN } from "#/lib/constants";
function AddProjectModalHelper({
showAddProjectModal,
@@ -92,6 +93,14 @@ function AddProjectModalHelper({
<div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 px-4 py-4 pt-8 sm:px-16">
<Logo />
<h3 className="text-lg font-medium">Create a new project</h3>
+ <a
+ href={`${HOME_DOMAIN}/help/article/what-is-a-project`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="-translate-y-2 text-center text-xs text-gray-500 underline underline-offset-4 hover:text-gray-800"
+ >
+ What is a project?
+ </a>
</div>
<form
@@ -260,7 +269,7 @@ function AddProjectModalHelper({
Domain is already in use.{" "}
<a
className="underline"
- href="mailto:[email protected]?subject=My Domain Is Already In Use"
+ href="mailto:[email protected]?subject=My Domain Is Already In Use"
>
Contact us
</a>{" "}
diff --git a/components/app/modals/delete-project-modal.tsx b/components/app/modals/delete-project-modal.tsx
index bdbf8ec637..614bb374f0 100644
--- a/components/app/modals/delete-project-modal.tsx
+++ b/components/app/modals/delete-project-modal.tsx
@@ -51,87 +51,82 @@ function DeleteProjectModal({
showModal={showDeleteProjectModal}
setShowModal={setShowDeleteProjectModal}
>
- <div className="inline-block w-full transform overflow-hidden bg-white align-middle transition-all">
- <div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 px-4 py-4 pt-8 sm:px-16">
- <BlurImage
- src={logo || `https://avatar.vercel.sh/${id}`}
- alt={id || "Delete Project"}
- className="h-10 w-10 rounded-full border border-gray-200"
- width={20}
- height={20}
- />
- <h3 className="text-lg font-medium">Delete Project</h3>
- <p className="text-center text-sm text-gray-500">
- Warning: This will permanently delete your project, custom domain,
- and all associated links and their respective stats.
- </p>
- </div>
+ <div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 px-4 py-4 pt-8 sm:px-16">
+ <BlurImage
+ src={logo || `https://avatar.vercel.sh/${id}`}
+ alt={id || "Delete Project"}
+ className="h-10 w-10 rounded-full border border-gray-200"
+ width={20}
+ height={20}
+ />
+ <h3 className="text-lg font-medium">Delete Project</h3>
+ <p className="text-center text-sm text-gray-500">
+ Warning: This will permanently delete your project, custom domain, and
+ all associated links and their respective stats.
+ </p>
+ </div>
- <form
- onSubmit={async (e) => {
- e.preventDefault();
- toast.promise(deleteProject(), {
- loading: "Deleting project...",
- success: "Project deleted successfully!",
- error: (err) => err,
- });
- }}
- className="flex flex-col space-y-6 bg-gray-50 px-4 py-8 text-left sm:px-16"
- >
- <div>
- <label
- htmlFor="project-slug"
- className="block text-sm font-medium text-gray-700"
- >
- Enter the project slug{" "}
- <span className="font-semibold text-black">{slug}</span> to
- continue:
- </label>
- <div className="relative mt-1 rounded-md shadow-sm">
- <input
- type="text"
- name="project-slug"
- id="project-slug"
- autoFocus={false}
- autoComplete="off"
- pattern={slug}
- className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
- />
- </div>
+ <form
+ onSubmit={async (e) => {
+ e.preventDefault();
+ toast.promise(deleteProject(), {
+ loading: "Deleting project...",
+ success: "Project deleted successfully!",
+ error: (err) => err,
+ });
+ }}
+ className="flex flex-col space-y-6 bg-gray-50 px-4 py-8 text-left sm:px-16"
+ >
+ <div>
+ <label
+ htmlFor="project-slug"
+ className="block text-sm font-medium text-gray-700"
+ >
+ Enter the project slug{" "}
+ <span className="font-semibold text-black">{slug}</span> to
+ continue:
+ </label>
+ <div className="relative mt-1 rounded-md shadow-sm">
+ <input
+ type="text"
+ name="project-slug"
+ id="project-slug"
+ autoFocus={false}
+ autoComplete="off"
+ pattern={slug}
+ className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
+ />
</div>
+ </div>
- <div>
- <label
- htmlFor="verification"
- className="block text-sm text-gray-700"
- >
- To verify, type{" "}
- <span className="font-semibold text-black">
- confirm delete project
- </span>{" "}
- below
- </label>
- <div className="relative mt-1 rounded-md shadow-sm">
- <input
- type="text"
- name="verification"
- id="verification"
- pattern="confirm delete project"
- required
- autoFocus={false}
- autoComplete="off"
- className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
- />
- </div>
+ <div>
+ <label htmlFor="verification" className="block text-sm text-gray-700">
+ To verify, type{" "}
+ <span className="font-semibold text-black">
+ confirm delete project
+ </span>{" "}
+ below
+ </label>
+ <div className="relative mt-1 rounded-md shadow-sm">
+ <input
+ type="text"
+ name="verification"
+ id="verification"
+ pattern="confirm delete project"
+ required
+ autoFocus={false}
+ autoComplete="off"
+ className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
+ />
</div>
+ </div>
- <Button
- text="Confirm delete project"
- variant="danger"
- loading={deleting}
- />
- </form>
- </div>
+ <Button
+ text="Confirm delete project"
+ variant="danger"
+ loading={deleting}
+ />
+ </form>
</Modal>
);
}
diff --git a/content/blog/help-center.mdx b/content/blog/help-center.mdx
index 8154a2b644..7846e3cb7d 100644
--- a/content/blog/help-center.mdx
+++ b/content/blog/help-center.mdx
@@ -1,6 +1,6 @@
---
title: Introducing the Dub Help Center
-publishedAt: 2023-07-27
+publishedAt: 2023-07-26
summary: Today, we're excited to launch the Dub Help Center – a one-stop shop for all your Dub-related questions.
image: https://d2vwwcvoksz7ty.cloudfront.net/blog/help-center.png
author: steventey
@@ -30,7 +30,7 @@ We've also created categories to help you find the articles you're looking for:
## Intuitive Search Experience – at your fingertips
-The Help Center features a search bar that allows you to search for any topic you're interested in.
+The Help Center features a beautiful search experience that lets you find answers to your questions in a snap.
<Image
alt="Fuzzy search for a typo-tolerant search experience in the Dub Help Center"
@@ -39,9 +39,11 @@ The Help Center features a search bar that allows you to search for any topic yo
height={946}
/>
-This search feature is typo-tolerant and can be accessed anywhere on Dub with the magic command `CMD+K` (or `CTRL+K` on Windows).
+Our new search feature is typo-tolerant and lets you search for articles based on their title and anchor headings.
-We're also planning to add an AI assistant to help you find answers to your questions in the future – stay tuned!
+The best part: **It can be accessed anywhere on Dub – even inside the [Dub dashboard](https://app.dub.sh) itself**! All you need to do is enter the magic command: `CMD+K` (or `CTRL+K` on Windows). Go ahead and give it a try!
+
+We're also planning to add an AI assistant to help you find answers to your questions in the future:
<Image
alt="AI assistant to help you find answers to your questions"
@@ -50,4 +52,8 @@ We're also planning to add an AI assistant to help you find answers to your ques
height={504}
/>
-## What's next?
+## Better support experience for our users
+
+This is a long-awaited feature that will help us provide better support to our users.
+
+If you have any questions or feedback about the Help Center, feel free to [send us an email](mailto:[email protected]?subject=Feedback%20on%20the%20Dub%20Help%20Center) or [reach out to us on Twitter](https://twitter.com/dubdotsh).
diff --git a/content/changelog/detailed-link-stats.mdx b/content/changelog/detailed-link-stats.mdx
new file mode 100644
index 0000000000..47dc608965
--- /dev/null
+++ b/content/changelog/detailed-link-stats.mdx
@@ -0,0 +1,15 @@
+---
+title: Detailed Link Stats
+publishedAt: 2023-07-28
+summary: "A better way to explore your link's stats"
+image: "https://d2vwwcvoksz7ty.cloudfront.net/changelog/detailed-link-stats.png"
+author: "steventey"
+---
+
+We've added "View All" buttons for the **Locations**, **Devices**, and **Referrer** sections on the Link Stats page.
+
+When clicked, this opens up a modal that lets you explore all data points for a given section via a fuzzy search interface. Here's an [example](https://dub.sh/stats/github).
+
+This is helpful for sections like `City` that tend to have a lot of data points. Instead of scrolling through a long list, you can now search for a specific city.
+
+Learn more about [how you can create links](/help/article/how-to-create-link) and [beautiful stats pages](/help/article/public-stats-pages) like this on Dub.
diff --git a/pages/app/welcome.tsx b/pages/app/welcome.tsx
index 423c4fd583..baad4d9b16 100644
--- a/pages/app/welcome.tsx
+++ b/pages/app/welcome.tsx
@@ -54,20 +54,21 @@ export default function Welcome() {
<AddEditLinkModal />
<UpgradePlanModal />
<AnimatePresence mode="wait">
- {router.query.type ? (
- <button
- className="group absolute left-10 top-10 z-40 rounded-full p-2 transition-all hover:bg-gray-100"
- onClick={() => router.back()}
- >
- <ArrowLeft
- size={20}
- className="text-gray-500 group-hover:text-gray-700 group-active:scale-90"
- />
- </button>
- ) : (
- <Intro key="intro" />
+ {!router.query.type && <Intro key="intro" />}
+ {router.query.type === "interim" && (
+ <>
+ <button
+ className="group fixed left-10 top-10 z-[99] rounded-full p-2 transition-all hover:bg-gray-100"
+ onClick={() => router.back()}
+ >
+ <ArrowLeft
+ size={20}
+ className="text-gray-500 group-hover:text-gray-700 group-active:scale-90"
+ />
+ </button>
+ <Interim key="interim" />
+ </>
)}
- {router.query.type === "interim" && <Interim key="interim" />}
</AnimatePresence>
</div>
);
diff --git a/yarn.lock b/yarn.lock
index 62051628ab..378e6a7e35 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7900,7 +7900,7 @@ socks@^2.6.2:
sonner@^0.5.0:
version "0.5.0"
- resolved "https://registry.npmjs.org/sonner/-/sonner-0.5.0.tgz"
+ resolved "https://registry.yarnpkg.com/sonner/-/sonner-0.5.0.tgz#48e4c1c8894c974fdb944ce4cd88ceb04ca7b8f8"
integrity sha512-V5L4918wScYxpe3x1H92MV0vSkUqRREu8dwFf7dDTQmRMQ58r1vzSKCsULZ5HCTqxNkfCdhQXHf7rRMaj/MukQ==
sort-keys@^5.0.0: