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.

Improve default Dub domains

Steven Tey3e582280a8a8
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx
index 0bdc0c7c35..2ec33ca5f8 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx
@@ -5,7 +5,13 @@ import useDefaultDomains from "@/lib/swr/use-default-domains";
import useWorkspace from "@/lib/swr/use-workspace";
import { DomainCardTitleColumn } from "@/ui/domains/domain-card-title-column";
import { Logo, Switch } from "@dub/ui";
-import { Amazon, ChatGPT, GitHubEnhanced, Spotify } from "@dub/ui/src/icons";
+import {
+ Amazon,
+ ChatGPT,
+ GitHubEnhanced,
+ GoogleEnhanced,
+ Spotify,
+} from "@dub/ui/src/icons";
import { DUB_DOMAINS } from "@dub/utils";
import Link from "next/link";
import { useEffect, useState } from "react";
@@ -21,6 +27,8 @@ function DubDomainsIcon(domain: string) {
return Spotify;
case "amzn.id":
return Amazon;
+ case "ggl.link":
+ return GoogleEnhanced;
default:
return Logo;
}
diff --git a/apps/web/prisma/schema.prisma b/apps/web/prisma/schema.prisma
index 8ef96fa420..2758cd08d1 100644
--- a/apps/web/prisma/schema.prisma
+++ b/apps/web/prisma/schema.prisma
@@ -167,6 +167,7 @@ model DefaultDomains {
sptifi Boolean @default(true)
gitnew Boolean @default(true)
amznid Boolean @default(true)
+ ggllink Boolean @default(true)
loooooooong Boolean @default(false)
projectId String @unique
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
diff --git a/apps/web/ui/domains/domain-card-title-column.tsx b/apps/web/ui/domains/domain-card-title-column.tsx
index 2578e59e28..751097ff5c 100644
--- a/apps/web/ui/domains/domain-card-title-column.tsx
+++ b/apps/web/ui/domains/domain-card-title-column.tsx
@@ -1,5 +1,5 @@
import { ArrowTurnRight2, Flag2, Globe } from "@dub/ui/src/icons";
-import { punycode } from "@dub/utils";
+import { cn, punycode } from "@dub/utils";
export function DomainCardTitleColumn({
domain,
@@ -19,8 +19,14 @@ export function DomainCardTitleColumn({
return (
<div className="flex min-w-0 items-center gap-4">
<div className="hidden rounded-full border border-gray-200 sm:block">
- <div className="rounded-full border border-white bg-gradient-to-t from-gray-100 p-1 md:p-3">
- <Icon className="h-5 w-5" />
+ <div
+ className={cn(
+ "rounded-full",
+ !defaultDomain &&
+ "border border-white bg-gradient-to-t from-gray-100 p-1 md:p-3",
+ )}
+ >
+ <Icon className={cn("size-5", defaultDomain && "size-8")} />
</div>
</div>
<div className="overflow-hidden">
diff --git a/packages/ui/src/icons/default-domains/google.tsx b/packages/ui/src/icons/default-domains/google.tsx
new file mode 100644
index 0000000000..4fe6a892fb
--- /dev/null
+++ b/packages/ui/src/icons/default-domains/google.tsx
@@ -0,0 +1,88 @@
+import { cn } from "@dub/utils";
+
+export function GoogleEnhanced({ className }: { className?: string }) {
+ return (
+ <svg
+ className={cn("h-full w-full", className)}
+ viewBox="0 0 222 222"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <circle cx="111" cy="111" r="111" fill="url(#paint0_radial_8328_50)" />
+ <path
+ d="M182.248 111.875C182.248 105.853 181.76 101.458 180.702 96.9003H111.931V124.083H152.298C151.484 130.838 147.089 141.011 137.323 147.848L137.186 148.758L158.93 165.603L160.437 165.753C174.272 152.975 182.248 134.175 182.248 111.875Z"
+ fill="url(#paint1_linear_8328_50)"
+ />
+ <path
+ d="M111.931 183.495C131.707 183.495 148.31 176.984 160.437 165.753L137.323 147.848C131.138 152.161 122.836 155.172 111.931 155.172C92.561 155.172 76.1211 142.395 70.2607 124.734L69.4017 124.807L46.7918 142.305L46.4961 143.127C58.5411 167.055 83.2826 183.495 111.931 183.495Z"
+ fill="url(#paint2_linear_8328_50)"
+ />
+ <path
+ d="M70.2607 124.734C68.7144 120.177 67.8195 115.293 67.8195 110.248C67.8195 105.201 68.7144 100.318 70.1794 95.7607L70.1384 94.7901L47.2451 77.0109L46.4961 77.3672C41.5318 87.2964 38.6832 98.4466 38.6832 110.248C38.6832 122.048 41.5318 133.198 46.4961 143.127L70.2607 124.734Z"
+ fill="url(#paint3_linear_8328_50)"
+ />
+ <path
+ d="M111.931 65.3222C125.685 65.3222 134.963 71.2633 140.253 76.2282L160.925 56.0444C148.229 44.2434 131.707 37 111.931 37C83.2826 37 58.5411 53.4399 46.4961 77.3672L70.1794 95.7607C76.1211 78.1 92.561 65.3222 111.931 65.3222Z"
+ fill="url(#paint4_linear_8328_50)"
+ />
+ <defs>
+ <radialGradient
+ id="paint0_radial_8328_50"
+ cx="0"
+ cy="0"
+ r="1"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-26 -7.31473e-06) rotate(38.1183) scale(289.169)"
+ >
+ <stop stop-color="white" />
+ <stop offset="0.5" stop-color="white" />
+ <stop offset="1" stop-color="#ECECEC" />
+ </radialGradient>
+ <linearGradient
+ id="paint1_linear_8328_50"
+ x1="176.5"
+ y1="148.5"
+ x2="112"
+ y2="97"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stop-color="#4285F4" />
+ <stop offset="1" stop-color="#76A7F9" />
+ </linearGradient>
+ <linearGradient
+ id="paint2_linear_8328_50"
+ x1="38.5"
+ y1="164.5"
+ x2="110.5"
+ y2="154"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stop-color="#8DFBAA" />
+ <stop offset="1" stop-color="#34A853" />
+ </linearGradient>
+ <linearGradient
+ id="paint3_linear_8328_50"
+ x1="66.5"
+ y1="119"
+ x2="36"
+ y2="110"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stop-color="#FBBC05" />
+ <stop offset="1" stop-color="#FFE28F" />
+ </linearGradient>
+ <linearGradient
+ id="paint4_linear_8328_50"
+ x1="92.5"
+ y1="66"
+ x2="78"
+ y2="45.5"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stop-color="#EB4335" />
+ <stop offset="1" stop-color="#FF968D" />
+ </linearGradient>
+ </defs>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/index.tsx b/packages/ui/src/icons/index.tsx
index a41b1d2d5e..c3b780a942 100644
--- a/packages/ui/src/icons/index.tsx
+++ b/packages/ui/src/icons/index.tsx
@@ -38,6 +38,7 @@ export * from "./youtube";
export * from "./default-domains/amazon";
export * from "./default-domains/chatgpt";
export * from "./default-domains/github";
+export * from "./default-domains/google";
export * from "./default-domains/spotify";
// Nucleo icons
diff --git a/packages/ui/src/nav/content/resources-content.tsx b/packages/ui/src/nav/content/resources-content.tsx
index f7bb98f0e0..a11b2d1d03 100644
--- a/packages/ui/src/nav/content/resources-content.tsx
+++ b/packages/ui/src/nav/content/resources-content.tsx
@@ -1,6 +1,12 @@
import { cn } from "@dub/utils";
import { RESOURCES } from "../../content";
-import { Amazon, ChatGPT, GitHubEnhanced, Spotify } from "../../icons";
+import {
+ Amazon,
+ ChatGPT,
+ GitHubEnhanced,
+ GoogleEnhanced,
+ Spotify,
+} from "../../icons";
import { ContentProps, createHref } from "../shared";
import {
ContentLinkCard,
@@ -29,6 +35,11 @@ export function ResourcesContent({ domain }: ContentProps) {
href={createHref("/tools/github-link-shortener", domain)}
icon={<GitHubEnhanced />}
/>
+ <ToolLinkCard
+ name="Google Link Shortener"
+ href={createHref("/tools/google-link-shortener", domain)}
+ icon={<GoogleEnhanced />}
+ />
<ToolLinkCard
name="Amazon Link Shortener"
href={createHref("/tools/amazon-link-shortener", domain)}
diff --git a/packages/utils/src/constants/dub-domains.ts b/packages/utils/src/constants/dub-domains.ts
index 51d060a5a9..ad3cfa0021 100644
--- a/packages/utils/src/constants/dub-domains.ts
+++ b/packages/utils/src/constants/dub-domains.ts
@@ -68,6 +68,28 @@ export const DUB_DOMAINS = [
"Branded domain for Amazon links (products, wishlists, etc.).",
projectId: DUB_WORKSPACE_ID,
},
+ {
+ id: "cloxw8qtk000bjt08n9b812vs",
+ slug: "ggl.link",
+ verified: true,
+ primary: false,
+ archived: false,
+ placeholder:
+ "https://docs.google.com/document/d/15-GOZA12SXGEh8lNwU5QI1jBi04TCPgY2-LChTbXVpA",
+ allowedHostnames: [
+ "google.com",
+ "google.co.uk",
+ "google.ca",
+ "google.es",
+ "google.fr",
+ "docs.google.com",
+ "drive.google.com",
+ "maps.google.com",
+ ],
+ description:
+ "Branded domain for Google links (Search, Docs, Sheets, Slides, Drive, Maps, etc.).",
+ projectId: DUB_WORKSPACE_ID,
+ },
{
id: "clugy7euh000a11h6ignmj42o",
slug: "loooooooo.ng",
@@ -76,7 +98,7 @@ export const DUB_DOMAINS = [
archived: true,
placeholder: "https://d.to/long",
description:
- "Branded domain for lengthening links instead of shortening them.",
+ "Branded domain for lengthening links instead of shortening them (April Fool's Prank).",
projectId: DUB_WORKSPACE_ID,
},
]