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 help article

Steven Tey5200d84da57d
diff --git a/app/dub.sh/help/not-found.tsx b/app/dub.sh/help/not-found.tsx
index 4a88f3534e..390568bbdf 100644
--- a/app/dub.sh/help/not-found.tsx
+++ b/app/dub.sh/help/not-found.tsx
@@ -3,7 +3,7 @@ import Link from "next/link";
export default function NotFound() {
return (
- <div className="flex min-h-[50vh] flex-col items-center justify-center">
+ <div className="flex min-h-screen flex-col items-center justify-center">
<h1 className="font-display text-6xl font-bold">404</h1>
<BlurImage
src="/_static/illustrations/call-waiting.svg"
diff --git a/app/ui/modals/link-qr-modal.tsx b/app/ui/modals/link-qr-modal.tsx
index c24a0f4e0f..f6a617b189 100644
--- a/app/ui/modals/link-qr-modal.tsx
+++ b/app/ui/modals/link-qr-modal.tsx
@@ -232,9 +232,9 @@ function AdvancedSettings({ qrData, setFgColor, showLogo, setShowLogo }) {
<Tooltip
content={
<TooltipContent
- title="As a freemium product, we rely on word of mouth to spread the word about Dub. If you'd like to remove the Dub logo/upload your own, please consider upgrading to a Pro plan."
+ title="You need to be on the Pro plan to customize your QR Code logo."
cta="Upgrade to Pro"
- href={isApp ? "/settings" : "/pricing"}
+ href="/pricing"
/>
}
>
diff --git a/app/ui/switch.tsx b/app/ui/switch.tsx
index e68d6d5fa6..6bb6b8292a 100644
--- a/app/ui/switch.tsx
+++ b/app/ui/switch.tsx
@@ -6,9 +6,9 @@ import { cn } from "#/lib/utils";
const Switch = ({
fn,
- trackDimensions = "h-4 w-8",
- thumbDimensions = "h-3 w-3",
- thumbTranslate = "translate-x-4",
+ trackDimensions,
+ thumbDimensions,
+ thumbTranslate,
checked = true,
disabled = false,
}: {
@@ -26,15 +26,20 @@ const Switch = ({
onCheckedChange={(checked) => fn(checked)}
disabled={disabled}
className={cn(
- disabled ? "cursor-not-allowed" : "cursor-pointer",
- `relative inline-flex ${trackDimensions} flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring focus-visible:ring-blue-500 focus-visible:ring-opacity-75 radix-state-checked:bg-blue-500 radix-state-unchecked:bg-gray-200`,
+ disabled
+ ? "cursor-not-allowed bg-gray-300"
+ : "cursor-pointer focus:outline-none focus-visible:ring focus-visible:ring-blue-500 focus-visible:ring-opacity-75 radix-state-checked:bg-blue-500 radix-state-unchecked:bg-gray-200",
+ `relative inline-flex h-4 w-8 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,
+ trackDimensions,
)}
>
<SwitchPrimitive.Thumb
className={cn(
`radix-state-checked:${thumbTranslate}`,
"radix-state-unchecked:translate-x-0",
- `pointer-events-none ${thumbDimensions} transform ${thumbTranslate} rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`,
+ `pointer-events-none h-3 w-3 translate-x-4 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`,
+ thumbDimensions,
+ thumbTranslate,
)}
/>
</SwitchPrimitive.Root>
diff --git a/components/app/links/link-filters.tsx b/components/app/links/link-filters.tsx
index 3abd810f6c..70a0e305ac 100644
--- a/components/app/links/link-filters.tsx
+++ b/components/app/links/link-filters.tsx
@@ -141,7 +141,7 @@ const SearchBox = ({ searchInputRef }) => {
<input
ref={searchInputRef}
type="text"
- className="peer w-full rounded-md border border-gray-300 pl-10 text-sm text-black placeholder:text-gray-400 focus:border-black focus:ring-0"
+ className="peer w-full rounded-md border border-gray-300 pl-10 text-black placeholder:text-gray-400 focus:border-black focus:ring-0 sm:text-sm"
placeholder="Search..."
defaultValue={router.query.search}
onChange={(e) => {
diff --git a/components/app/modals/link-qr-modal.tsx b/components/app/modals/link-qr-modal.tsx
index 1ac86042d1..a5aff03a4b 100644
--- a/components/app/modals/link-qr-modal.tsx
+++ b/components/app/modals/link-qr-modal.tsx
@@ -2,6 +2,7 @@ import {
Dispatch,
SetStateAction,
useCallback,
+ useContext,
useMemo,
useRef,
useState,
@@ -25,8 +26,15 @@ import { getApexDomain, linkConstructor } from "#/lib/utils";
import IconMenu from "@/components/shared/icon-menu";
import Popover from "#/ui/popover";
import { toast } from "sonner";
-import { GOOGLE_FAVICON_URL, HOME_DOMAIN } from "#/lib/constants";
+import {
+ APP_HOSTNAMES,
+ FADE_IN_ANIMATION_SETTINGS,
+ GOOGLE_FAVICON_URL,
+ HOME_DOMAIN,
+} from "#/lib/constants";
import { useRouter } from "next/router";
+import { ModalContext } from "#/ui/modal-provider";
+import { motion } from "framer-motion";
function LinkQRModalHelper({
showLinkQRModal,
@@ -38,7 +46,7 @@ function LinkQRModalHelper({
props: SimpleLinkProps;
}) {
const anchorRef = useRef<HTMLAnchorElement>(null);
- const { logo } = useProject();
+ const { logo, plan } = useProject();
const { avatarUrl, apexDomain } = useMemo(() => {
try {
const apexDomain = getApexDomain(props.url);
@@ -55,11 +63,11 @@ function LinkQRModalHelper({
}, [props]);
const qrLogoUrl = useMemo(() => {
- if (logo) return logo;
+ if (logo && plan !== "free") return logo;
return typeof window !== "undefined" && window.location.origin
? new URL("/_static/logo.svg", window.location.origin).href
: "";
- }, [logo]);
+ }, [logo, plan]);
function download(url: string, extension: string) {
if (!anchorRef.current) return;
@@ -152,6 +160,7 @@ function LinkQRModalHelper({
setFgColor={setFgColor}
showLogo={showLogo}
setShowLogo={setShowLogo}
+ setShowLinkQRModal={setShowLinkQRModal}
/>
<div className="grid grid-cols-2 gap-2 px-4 sm:px-16">
@@ -186,16 +195,20 @@ function LinkQRModalHelper({
);
}
-function AdvancedSettings({ qrData, setFgColor, showLogo, setShowLogo }) {
+function AdvancedSettings({
+ qrData,
+ setFgColor,
+ showLogo,
+ setShowLogo,
+ setShowLinkQRModal,
+}) {
const router = useRouter();
const { slug } = router.query;
const { plan, logo } = useProject();
const [expanded, setExpanded] = useState(false);
- const isApp = useMemo(() => {
- if (typeof window === "undefined") return false;
- return window.location.host.startsWith("app.");
- }, []);
+ const { setShowAddProjectModal, setShowUpgradePlanModal } =
+ useContext(ModalContext);
return (
<div>
@@ -214,7 +227,11 @@ function AdvancedSettings({ qrData, setFgColor, showLogo, setShowLogo }) {
</button>
</div>
{expanded && (
- <div className="mt-4 grid gap-5 border-b border-t border-gray-200 bg-white px-4 py-8 sm:px-16">
+ <motion.div
+ key="advanced-options"
+ {...FADE_IN_ANIMATION_SETTINGS}
+ className="mt-4 grid gap-5 border-b border-t border-gray-200 bg-white px-4 py-8 sm:px-16"
+ >
<div>
<label
htmlFor="logo-toggle"
@@ -227,7 +244,7 @@ function AdvancedSettings({ qrData, setFgColor, showLogo, setShowLogo }) {
<SimpleTooltipContent
title=""
cta="How to update my QR Code logo?"
- href={`${HOME_DOMAIN}/help/article/how-to-set-custom-qrcode`}
+ href={`${HOME_DOMAIN}/help/article/custom-qrcodes`}
/>
}
/>
@@ -250,9 +267,20 @@ function AdvancedSettings({ qrData, setFgColor, showLogo, setShowLogo }) {
<Tooltip
content={
<TooltipContent
- title="As a freemium product, we rely on word of mouth to spread the word about Dub. If you'd like to remove the Dub logo/upload your own, please consider upgrading to a Pro plan."
- cta="Upgrade to Pro"
- href={isApp ? "/settings" : "/pricing"}
+ title="You need to be on the Pro plan to customize your QR Code logo."
+ cta={slug ? "Upgrade to Pro" : "Create a project"}
+ {...(APP_HOSTNAMES.has(window.location.hostname)
+ ? {
+ onClick: () => {
+ setShowLinkQRModal(false);
+ if (slug) {
+ setShowUpgradePlanModal(true);
+ } else {
+ setShowAddProjectModal(true);
+ }
+ },
+ }
+ : { href: `${HOME_DOMAIN}/pricing` })}
/>
}
>
@@ -307,7 +335,7 @@ function AdvancedSettings({ qrData, setFgColor, showLogo, setShowLogo }) {
/>
</div>
</div>
- </div>
+ </motion.div>
)}
</div>
);
diff --git a/components/app/projects/upload-logo.tsx b/components/app/projects/upload-logo.tsx
index aaba194f23..a07c6715a1 100644
--- a/components/app/projects/upload-logo.tsx
+++ b/components/app/projects/upload-logo.tsx
@@ -152,7 +152,8 @@ export default function UploadLogo() {
<div className="flex items-center justify-between rounded-b-lg border-t border-gray-200 bg-gray-50 p-3 sm:px-10">
<p className="text-sm text-gray-500">
- Accepted file types: .png, .jpg, .jpeg. Max file size: 5MB
+ Square image recommended. Accepted file types: .png, .jpg. Max file
+ size: 5MB.
</p>
<div>
<Button
diff --git a/components/stats/toggle.tsx b/components/stats/toggle.tsx
index f0716ab15e..58cb39431d 100644
--- a/components/stats/toggle.tsx
+++ b/components/stats/toggle.tsx
@@ -18,7 +18,7 @@ import Tooltip, { TooltipContent } from "#/ui/tooltip";
import { ModalContext } from "#/ui/modal-provider";
import punycode from "punycode/";
-export default function Toggle({ atModalTop }: { atModalTop?: boolean }) {
+export default function Toggle() {
const router = useRouter();
const { slug: projectSlug } = router.query as { slug?: string };
diff --git a/content/help/custom-qrcodes.mdx b/content/help/custom-qrcodes.mdx
new file mode 100644
index 0000000000..beca95d86c
--- /dev/null
+++ b/content/help/custom-qrcodes.mdx
@@ -0,0 +1,52 @@
+---
+title: Custom QR Codes
+updatedAt: 2023-07-30
+summary: Learn how custom QR codes work on Dub.
+author: steventey
+categories:
+ - link-management
+related:
+ - pro-plan
+ - what-is-a-project
+ - how-to-create-link
+---
+
+<Note variant="success">
+ This feature is only available for [Pro plans and above](pro-plan).
+</Note>
+
+As a freemium product, we rely on word of mouth to spread the word about Dub. Therefore, on Dub's free plan, you can only use the default QR code logo for your short links.
+
+<Image
+ alt="Default QR Code logo on Dub"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/free-plan-qrcode.png"
+ width={986}
+ height={654}
+/>
+
+If you'd like to remove the Dub logo/upload your own, please consider [upgrading to a Pro plan](pro-plan#how-to-upgrade-to-pro) to support us. Thank you!
+
+## How to set a custom QR Code logo?
+
+Once you're on a Pro plan, you can set a custom QR code for your short links.
+
+Your QR code logo is connected to your project's logo on Dub. To set a custom QR code, you'll need to set your project's logo first by following the steps below:
+
+1. Go to your project settings page by clicking on the **Settings** link in the menu bar at the top of your project dashboard.
+2. Scroll down to the **Project Logo** section and upload your company's logo. We recommend using a square image for the best results.
+
+<Image
+ alt="Project Logo section"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/project-logo-section.png"
+ width={966}
+ height={358}
+/>
+
+Once you've set your project's logo, your QR code will automatically update to use your project's logo.
+
+<Image
+ alt="Custom QR Code logo"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/custom-qrcode.png"
+ width={759}
+ height={541}
+/>
diff --git a/content/help/how-to-set-custom-qrcode.mdx b/content/help/how-to-set-custom-qrcode.mdx
deleted file mode 100644
index 9593ace7a7..0000000000
--- a/content/help/how-to-set-custom-qrcode.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: How to set a custom QR Code for a link?
-updatedAt: 2023-07-26
-summary: Learn how to set a custom QR Code for a link
-author: steventey
-categories:
- - link-management
-related:
- - how-to-create-link
- - what-is-a-project
----
-
-<Note variant="success">
- This feature is only available for [Pro plans and above](pro-plan).
-</Note>
-
-Your QR Code
diff --git a/content/help/what-is-a-project.mdx b/content/help/what-is-a-project.mdx
index 57c71a9470..160181b71e 100644
--- a/content/help/what-is-a-project.mdx
+++ b/content/help/what-is-a-project.mdx
@@ -8,6 +8,7 @@ categories:
- getting-started
- link-management
related:
+ - project-settings
- how-to-create-link
- how-to-add-custom-domain
- how-to-invite-teammates