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.

fixed search query, added Dub name origin

Steven Teye5f6c6d15aa6
diff --git a/app/ui/content/mdx.tsx b/app/ui/content/mdx.tsx
index 61bcd67312..4a0740444c 100644
--- a/app/ui/content/mdx.tsx
+++ b/app/ui/content/mdx.tsx
@@ -108,25 +108,22 @@ export function MDX({ code, images, tweets, repos, className }: MDXProps) {
)?.blurDataURL;
return (
- // we need to wrap the image in a HTML element or showModal will throw errors
- <div>
- <figure className="not-prose flex flex-col items-center justify-center space-y-3">
- <Zoom zoomMargin={isDesktop ? 45 : undefined}>
- <BlurImage
- {...props}
- className="rounded-lg border border-gray-200"
- placeholder="blur"
- blurDataURL={
- blurDataURL ||
- "data:image/webp;base64,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
- }
- />
- </Zoom>
- <figcaption className="text-center text-sm italic text-gray-500">
- {props.alt}
- </figcaption>
- </figure>
- </div>
+ <figure className="not-prose flex flex-col items-center justify-center space-y-3">
+ <Zoom zoomMargin={isDesktop ? 45 : undefined}>
+ <BlurImage
+ {...props}
+ className="rounded-lg border border-gray-200"
+ placeholder="blur"
+ blurDataURL={
+ blurDataURL ||
+ "data:image/webp;base64,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
+ }
+ />
+ </Zoom>
+ <figcaption className="text-center text-sm italic text-gray-500">
+ {props.alt}
+ </figcaption>
+ </figure>
);
};
diff --git a/content/help/what-is-dub.mdx b/content/help/what-is-dub.mdx
index 0d365ec646..d3bb3270b4 100644
--- a/content/help/what-is-dub.mdx
+++ b/content/help/what-is-dub.mdx
@@ -15,6 +15,12 @@ related:
Dub is the link management tool for modern marketing teams. With Dub, you can create, share, and track short links using your own [custom domain](how-to-add-custom-domain).
+<Note variant="info">
+ Fun fact: The name **Dub** comes from the literal definition of the word
+ **"dub"** – which is to "give an unofficial name or nickname to something" (_a
+ là what Dub does with longer URLs_).
+</Note>
+
## What can I do with Dub?
If you are a marketer or a business owner, Dub has the perfect suite of features for you to better manage your marketing campaigns with short links:
diff --git a/lib/api/links.ts b/lib/api/links.ts
index e091e951bf..5e44d90c4b 100644
--- a/lib/api/links.ts
+++ b/lib/api/links.ts
@@ -33,8 +33,9 @@ export async function getLinksForProject({
archived: showArchived ? undefined : false,
...(domain && { domain }),
...(search && {
- key: { search },
- url: { search },
+ // if search query is 4 characters or shorter, only search for exact matches, else use MySQL fullTextSearch
+ key: search.length <= 4 ? { contains: search } : { search },
+ url: search.length <= 4 ? { contains: search } : { search },
}),
...(tagId && { tagId }),
...(userId && { userId }),
@@ -71,8 +72,9 @@ export async function getLinksCount({
archived: showArchived ? undefined : false,
...(userId && { userId }),
...(search && {
- key: { search },
- url: { search },
+ // if search query is 4 characters or shorter, only search for exact matches, else use MySQL fullTextSearch
+ key: search.length <= 4 ? { contains: search } : { search },
+ url: search.length <= 4 ? { contains: search } : { search },
}),
// when filtering by domain, only filter by domain if the filter group is not "Domains"
...(domain &&