Skip to content

Commit

Permalink
Pushed all domain changes 🥴
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Aug 21, 2023
1 parent c6cf0c2 commit 3a50454
Show file tree
Hide file tree
Showing 88 changed files with 264 additions and 205 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="https://dub.sh">
<a href="https://dub.co">
<img alt="Dub – an open-source link management tool for modern marketing teams to create, share, and track short links." src="https://user-images.githubusercontent.com/28986134/200727801-6355c62e-60b5-45d7-a83d-44b11545e471.png">
<h1 align="center">Dub</h1>
</a>
Expand Down Expand Up @@ -31,6 +31,7 @@
Dub is an open-source link management tool for modern marketing teams to create, share, and track short links. Built with [Vercel Edge Functions](http://vercel.com/edge), [Upstash Redis](https://docs.upstash.com/redis), and [PlanetScale MySQL](https://planetscale.com/).

Here are some of the features that Dub provides out-of-the-box:

- [Built-in Analytics](#built-in-analytics)
- [Custom Domains](#custom-domains)
- [QR Code Generator](#qr-code-generator)
Expand Down
2 changes: 1 addition & 1 deletion app/[domain]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function generateMetadata({
}: {
params: { domain: string };
}) {
const title = `${params.domain.toUpperCase()} - A Dub.sh Custom Domain`;
const title = `${params.domain.toUpperCase()} - A Dub.co Custom Domain`;
const description = `${params.domain.toUpperCase()} is a custom domain on Dub - an open-source link management tool for modern marketing teams to create, share, and track short links.`;

return constructMetadata({
Expand Down
4 changes: 2 additions & 2 deletions app/[domain]/placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function PlaceholderContent() {
<InlineSnippet>{domain}</InlineSnippet> is a custom domain on{" "}
<a
className="bg-gradient-to-r from-purple-400 to-pink-600 bg-clip-text font-semibold text-transparent decoration-rose-600 hover:underline"
href="https://dub.sh"
href="https://dub.co"
onClick={() =>
va.track("Referred from custom domain", {
domain,
Expand All @@ -80,7 +80,7 @@ export default function PlaceholderContent() {
</motion.p>
<motion.a
variants={STAGGER_CHILD_VARIANTS}
href="https://dub.sh"
href="https://dub.co"
onClick={() =>
va.track("Referred from custom domain", {
domain,
Expand Down
2 changes: 1 addition & 1 deletion app/admin/components/impersonate-project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Form = () => {
return (
<div className="relative flex w-full rounded-md shadow-sm">
<span className="inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-5 text-gray-500 sm:text-sm">
app.dub.sh
app.dub.co
</span>
<input
name="slug"
Expand Down
2 changes: 1 addition & 1 deletion app/app/(auth)/login/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default function LoginForm() {
Project Slug
</h2>
<InfoTooltip
content={`This is your project's unique identifier on Dub. E.g. app.dub.sh/acme is "acme".`}
content={`This is your project's unique identifier on Dub. E.g. app.dub.co/acme is "acme".`}
/>
</div>
<input
Expand Down
2 changes: 1 addition & 1 deletion app/app/(auth)/register/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function RegisterForm() {
Project Slug
</h2>
<InfoTooltip
content={`This is your project's unique identifier on Dub. E.g. app.dub.sh/acme is "acme".`}
content={`This is your project's unique identifier on Dub. E.g. app.dub.co/acme is "acme".`}
/>
</div>
<input
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 9 additions & 7 deletions app/dub.sh/atom/route.ts → app/dub.co/atom/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ export async function GET() {
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Dub</title>
<subtitle>Changelog</subtitle>
<link href="https://dub.sh/atom" rel="self"/>
<link href="https://dub.sh/"/>
<link href="https://dub.co/atom" rel="self"/>
<link href="https://dub.co/"/>
<updated>${allChangelogPosts[0].publishedAt}</updated>
<id>https://dub.sh/</id>${allChangelogPosts.map((post) => {
return `
<id>https://dub.co/</id>${allChangelogPosts
.map((post) => {
return `
<entry>
<id>https://dub.sh/changelog/${post.slug}</id>
<id>https://dub.co/changelog/${post.slug}</id>
<title>${post.title}</title>
<link href="https://dub.sh/changelog/${post.slug}"/>
<link href="https://dub.co/changelog/${post.slug}"/>
<updated>${post.publishedAt}</updated>
<author><name>${post.author}</name></author>
</entry>`;
}).join("")}
})
.join("")}
</feed>`,
{
headers: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default async function ChangelogPost({
<Author username={post.author} />
<div className="flex items-center space-x-6">
<Link
href={`https://twitter.com/intent/tweet?text=${post.title}&url=https://dub.sh/changelog/${post.slug}&via=${post.author}`}
href={`https://twitter.com/intent/tweet?text=${post.title}&url=https://dub.co/changelog/${post.slug}&via=${post.author}`}
target="_blank"
rel="noopener noreferrer"
className="transition-all hover:scale-110"
Expand All @@ -98,15 +98,15 @@ export default async function ChangelogPost({
</Link>
<Link
href={`
http://www.linkedin.com/shareArticle?mini=true&url=https://dub.sh/changelog/${post.slug}`}
http://www.linkedin.com/shareArticle?mini=true&url=https://dub.co/changelog/${post.slug}`}
target="_blank"
rel="noopener noreferrer"
className="transition-all hover:scale-110"
>
<LinkedIn className="h-6 w-6" fill="black" />
</Link>
<Link
href={`https://www.facebook.com/sharer/sharer.php?u=https://dub.sh/changelog/${post.slug}`}
href={`https://www.facebook.com/sharer/sharer.php?u=https://dub.co/changelog/${post.slug}`}
target="_blank"
rel="noopener noreferrer"
className="transition-all hover:scale-110"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function MetatagsContent() {
className="hover:bg/black-[0.08] group relative flex cursor-copy items-center space-x-5 rounded-full bg-black/5 py-2.5 pl-5 pr-3 transition-all"
onClick={() => {
navigator.clipboard.writeText(
`https://api.dub.sh/metatags?url=${getUrlFromString(url)}`,
`https://api.dub.co/metatags?url=${getUrlFromString(url)}`,
);
setCopied(true);
toast.success("Copied URL to clipboard!");
Expand All @@ -117,7 +117,7 @@ export default function MetatagsContent() {
>
<div className="w-11/12 overflow-scroll scrollbar-hide">
<p className="whitespace-nowrap text-sm font-medium text-gray-600">
https://api.dub.sh/metatags?url=
https://api.dub.co/metatags?url=
<span className="text-amber-600">{getUrlFromString(url)}</span>
</p>
</div>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function generateMetadata({
return constructMetadata({
title: `Stats for dub.sh/${params.key} – Dub`,
description: `Dub is an open-source link management tool for modern marketing teams to create, share, and track short links.`,
image: `https://dub.sh/api/og/stats?domain=dub.sh&key=${params.key}`,
image: `https://dub.co/api/og/stats?domain=dub.sh&key=${params.key}`,
});
}

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/protected/[domain]/[key]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PasswordForm from "./form";
const title = "Password Required";
const description =
"This link is password protected. Please enter the password to view it.";
const image = "https://dub.sh/_static/password-protected.png";
const image = "https://dub.co/_static/password-protected.png";

export const metadata = constructMetadata({
title,
Expand All @@ -20,7 +20,7 @@ export default function PasswordProtectedLinkPage() {
<Background />
<div className="w-full max-w-md overflow-hidden rounded-2xl border border-gray-100 shadow-xl">
<div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 py-6 pt-8 text-center sm:px-16">
<a href="https://dub.sh" target="_blank" rel="noreferrer">
<a href="https://dub.co" target="_blank" rel="noreferrer">
<Logo />
</a>
<h3 className="text-xl font-semibold">{title}</h3>
Expand Down
4 changes: 2 additions & 2 deletions app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { isHomeHostname } from "#/lib/utils";
import { MetadataRoute } from "next";
import { headers } from "next/headers";
import { isHomeHostname } from "#/lib/constants";

export default function robots(): MetadataRoute.Robots {
const headersList = headers();
let domain = headersList.get("host") as string;
if (isHomeHostname(domain)) domain = "dub.sh";
if (isHomeHostname(domain)) domain = "dub.co";

return {
rules: {
Expand Down
6 changes: 3 additions & 3 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
allHelpPosts,
allLegalPosts,
} from "contentlayer/generated";
import { isHomeHostname } from "#/lib/utils";
import { isHomeHostname } from "#/lib/constants";
import { BLOG_CATEGORIES, HELP_CATEGORIES } from "#/lib/constants/content";

export default async function Sitemap() {
const headersList = headers();
let domain = headersList.get("host") as string;
if (isHomeHostname(domain)) domain = "dub.sh";
if (isHomeHostname(domain)) domain = "dub.co";

const links = await prisma.link.findMany({
where: {
Expand All @@ -34,7 +34,7 @@ export default async function Sitemap() {
url: `https://${domain}`,
lastModified: new Date(),
},
...(domain === "dub.sh"
...(domain === "dub.co"
? [
{
url: `https://${domain}/pricing`,
Expand Down
18 changes: 9 additions & 9 deletions app/ui/home/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const navigation = {
};

export default function Footer() {
const { domain = "dub.sh" } = useParams() as { domain: string };
const { domain = "dub.co" } = useParams() as { domain: string };

const createHref = (href: string) =>
domain === "dub.sh" ? href : `https://dub.sh${href}`;
domain === "dub.co" ? href : `https://dub.co${href}`;

return (
<footer className="z-10 border-t border-gray-200 bg-white/50 py-8 backdrop-blur-lg">
Expand All @@ -36,7 +36,7 @@ export default function Footer() {
<div className="space-y-8 xl:col-span-2">
<Link
href={createHref("/")}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand All @@ -45,7 +45,7 @@ export default function Footer() {
},
})}
>
<span className="sr-only">Dub.sh Logo</span>
<span className="sr-only">Dub.co Logo</span>
<LogoType className="h-7 text-gray-600" />
</Link>
<p className="max-w-xs text-sm text-gray-500">
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function Footer() {
<li key={item.name}>
<Link
href={createHref(item.href)}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand All @@ -116,7 +116,7 @@ export default function Footer() {
<li key={item.name}>
<Link
href={createHref(item.href)}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand All @@ -143,7 +143,7 @@ export default function Footer() {
<li key={item.name}>
<Link
href={createHref(item.href)}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand All @@ -166,7 +166,7 @@ export default function Footer() {
<li key={item.name}>
<Link
href={createHref(item.href)}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand All @@ -187,7 +187,7 @@ export default function Footer() {
</div>
<div className="mt-16 border-t border-gray-900/10 pt-8 sm:mt-20 lg:mt-24">
<p className="text-sm leading-5 text-gray-500">
© {new Date().getFullYear()} Dub.sh
© {new Date().getFullYear()} Dub.co
</p>
</div>
</MaxWidthWrapper>
Expand Down
8 changes: 4 additions & 4 deletions app/ui/home/nav-mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ const sidebar = {
};

export default function MobileNav() {
const { domain = "dub.sh" } = useParams() as { domain: string };
const { domain = "dub.co" } = useParams() as { domain: string };

const [isOpen, toggleOpen] = useCycle(false, true);
const containerRef = useRef(null);
const { height } = useDimensions(containerRef);
const { data: session, status } = useSession() || {
status: "unauthenticated", // if `useSession` is undefined, we're on a non dub.sh domain
status: "unauthenticated", // if `useSession` is undefined, we're on a non dub.co domain
};

return (
Expand All @@ -60,9 +60,9 @@ export default function MobileNav() {
<MenuItem>
<Link
href={
domain === "dub.sh"
domain === "dub.co"
? `/${slug}`
: `https://dub.sh/${slug}?utm_source=${domain}&utm_medium=referral&utm_campaign=custom-domain`
: `https://dub.co/${slug}?utm_source=${domain}&utm_medium=referral&utm_campaign=custom-domain`
}
onClick={() => toggleOpen()}
className="flex w-full font-semibold capitalize"
Expand Down
20 changes: 10 additions & 10 deletions app/ui/home/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ export const navItems = [
];

export default function Nav() {
const { domain = "dub.sh" } = useParams() as { domain: string };
const { domain = "dub.co" } = useParams() as { domain: string };
const scrolled = useScroll(80);
const selectedLayout = useSelectedLayoutSegment();
const helpCenter = selectedLayout === "help";
const { data: session, status } =
domain === "dub.sh"
domain === "dub.co"
? useSession()
: {
data: null,
status: "unauthenticated", // if `useSession` is undefined, we're on a non dub.sh domain
status: "unauthenticated", // if `useSession` is undefined, we're on a non dub.co domain
};

return (
Expand All @@ -58,8 +58,8 @@ export default function Nav() {
<div className="flex h-14 items-center justify-between">
<div className="flex items-center space-x-4">
<Link
href={domain === "dub.sh" ? "/" : `https://dub.sh`}
{...(domain !== "dub.sh" && {
href={domain === "dub.co" ? "/" : `https://dub.co`}
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand Down Expand Up @@ -87,11 +87,11 @@ export default function Nav() {
id={`nav-${slug}`}
key={slug}
href={
domain === "dub.sh"
domain === "dub.co"
? `/${slug}`
: `https://dub.sh/${slug}`
: `https://dub.co/${slug}`
}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand Down Expand Up @@ -125,7 +125,7 @@ export default function Nav() {
<>
<Link
href={`${APP_DOMAIN}/login`}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand All @@ -139,7 +139,7 @@ export default function Nav() {
</Link>
<Link
href={`${APP_DOMAIN}/register`}
{...(domain !== "dub.sh" && {
{...(domain !== "dub.co" && {
onClick: () => {
va.track("Referred from custom domain", {
domain,
Expand Down
2 changes: 1 addition & 1 deletion app/ui/modals/add-edit-link-modal/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function Preview({
const { title, description, image, url, password } = data;
const [debouncedUrl] = useDebounce(url, 500);
const hostname = useMemo(() => {
if (password) return "dub.sh";
if (password) return "dub.co";
return getDomainWithoutWWW(debouncedUrl);
}, [password, debouncedUrl]);

Expand Down
2 changes: 1 addition & 1 deletion app/ui/modals/add-edit-link-modal/unsplash-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function UnsplashSearch({
className="underline underline-offset-2"
target="_blank"
rel="noopener noreferrer"
href={`${photo.user.links.html}?utm_source=dub.sh&utm_medium=referral`}
href={`${photo.user.links.html}?utm_source=dub.co&utm_medium=referral`}
>
{photo.user.name}
</a>
Expand Down
Loading

0 comments on commit 3a50454

Please sign in to comment.