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.

updated icons + fixed spacing

Steven Teycbd2e6a5ccab
diff --git a/apps/web/ui/analytics/device-icon.tsx b/apps/web/ui/analytics/device-icon.tsx
index 0512322d32..d4c92db205 100644
--- a/apps/web/ui/analytics/device-icon.tsx
+++ b/apps/web/ui/analytics/device-icon.tsx
@@ -1,7 +1,8 @@
import { DeviceTabs } from "@/lib/analytics/types";
-import { Apple, Chrome, Safari } from "@/ui/shared/icons/devices";
+import { Chrome, Safari } from "@/ui/shared/icons/devices";
import { BlurImage } from "@dub/ui";
import {
+ AppleLogo,
CursorRays,
Desktop,
GamingConsole,
@@ -66,7 +67,7 @@ export default function DeviceIcon({
/>
);
} else if (display === "iOS") {
- return <Apple className="-ml-1 h-5 w-5" />;
+ return <AppleLogo className="-ml-1 h-5 w-5" />;
} else {
return (
<BlurImage
diff --git a/apps/web/ui/domains/add-edit-domain-form.tsx b/apps/web/ui/domains/add-edit-domain-form.tsx
index 7f2f890ee3..4b80b5dd8f 100644
--- a/apps/web/ui/domains/add-edit-domain-form.tsx
+++ b/apps/web/ui/domains/add-edit-domain-form.tsx
@@ -6,7 +6,9 @@ import { createDomainBodySchema } from "@/lib/zod/schemas/domains";
import { AlertCircleFill, CheckCircleFill, Lock } from "@/ui/shared/icons";
import { UpgradeRequiredToast } from "@/ui/shared/upgrade-required-toast";
import {
+ AndroidLogo,
AnimatedSizeContainer,
+ AppleLogo,
Badge,
Button,
FileUpload,
@@ -20,12 +22,11 @@ import {
import { cn } from "@dub/utils";
import { motion } from "framer-motion";
import {
- Apple,
Binoculars,
+ ChevronDown,
Crown,
Milestone,
QrCode,
- Smartphone,
TextCursorInput,
} from "lucide-react";
import posthog from "posthog-js";
@@ -459,126 +460,109 @@ export function AddEditDomainForm({
</div>
<div className="flex flex-col">
- <div>
- <button
- type="button"
- className="flex w-full items-center gap-2"
- onClick={() => setShowAdvancedOptions(!showAdvancedOptions)}
+ <button
+ type="button"
+ className="flex w-full items-center gap-2"
+ onClick={() => setShowAdvancedOptions(!showAdvancedOptions)}
+ >
+ <p className="text-sm text-neutral-600">
+ {showAdvancedOptions ? "Hide" : "Show"} advanced settings
+ </p>
+ <motion.div
+ animate={{ rotate: showAdvancedOptions ? 180 : 0 }}
+ className="text-neutral-600"
>
- <p className="text-sm text-neutral-600">
- {showAdvancedOptions ? "Hide" : "Show"} advanced settings
- </p>
- <motion.div
- animate={{ rotate: showAdvancedOptions ? 180 : 0 }}
- className="text-neutral-600"
- >
- <svg
- className="h-4 w-4"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- d="M6 9L12 15L18 9"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- </svg>
- </motion.div>
- </button>
- </div>
+ <ChevronDown className="size-4" />
+ </motion.div>
+ </button>
- <AnimatedSizeContainer height className="mt-6">
- <div className="flex flex-col space-y-4">
- {showAdvancedOptions &&
- ADVANCED_OPTIONS.map(
- ({ id, title, description, icon: Icon, proFeature }) => {
- return (
- <div key={id} className="flex flex-col space-y-3">
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-3">
- <div className="hidden rounded-lg border border-neutral-200 bg-white p-2 sm:block">
- <Icon className="size-5 text-neutral-500" />
- </div>
- <div>
- <div className="flex items-center gap-2">
- <h2 className="text-sm font-medium text-neutral-900">
- {title}
- </h2>
- {proFeature && plan === "free" && (
- <Badge className="flex items-center space-x-1 bg-white">
- <Crown size={12} />
- <p className="uppercase">Pro</p>
- </Badge>
- )}
- </div>
- <p className="text-sm text-neutral-500">
- {description}
- </p>
+ <AnimatedSizeContainer height className="flex flex-col">
+ {showAdvancedOptions &&
+ ADVANCED_OPTIONS.map(
+ ({ id, title, description, icon: Icon, proFeature }) => {
+ return (
+ <div key={id} className="mt-4 flex flex-col space-y-3">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-3">
+ <div className="hidden rounded-lg border border-neutral-200 bg-white p-2 sm:block">
+ <Icon className="size-5 text-neutral-500" />
+ </div>
+ <div>
+ <div className="flex items-center gap-2">
+ <h2 className="text-sm font-medium text-neutral-900">
+ {title}
+ </h2>
+ {proFeature && plan === "free" && (
+ <Badge className="flex items-center space-x-1 bg-white">
+ <Crown size={12} />
+ <p className="uppercase">Pro</p>
+ </Badge>
+ )}
</div>
+ <p className="text-sm text-neutral-500">
+ {description}
+ </p>
</div>
+ </div>
+
+ <Switch
+ checked={showOptionStates[id]}
+ fn={(checked: boolean) => {
+ setShowOptionStates((prev) => ({
+ ...prev,
+ [id]: checked,
+ }));
+ if (!checked) {
+ setValue(id, "", {
+ shouldDirty: true,
+ });
+ }
+ }}
+ disabled={isSubmitting}
+ />
+ </div>
+
+ {showOptionStates[id] && (
+ <div className="rounded-md border border-neutral-200 bg-white">
+ <textarea
+ {...register(id)}
+ className="w-full resize-none rounded-md border-0 bg-transparent px-3 py-2 font-mono text-xs text-neutral-700 focus:outline-none focus:ring-0"
+ rows={4}
+ spellCheck={false}
+ onPaste={(e) => {
+ if (
+ [
+ "appleAppSiteAssociation",
+ "assetLinks",
+ ].includes(id)
+ ) {
+ e.preventDefault();
+ const pastedText =
+ e.clipboardData.getData("text");
- <Switch
- checked={showOptionStates[id]}
- fn={(checked: boolean) => {
- setShowOptionStates((prev) => ({
- ...prev,
- [id]: checked,
- }));
- if (!checked) {
- setValue(id, "", {
- shouldDirty: true,
- });
+ try {
+ const formattedJson = JSON.stringify(
+ JSON.parse(pastedText),
+ null,
+ 2,
+ );
+ setValue(id, formattedJson, {
+ shouldDirty: true,
+ });
+ } catch (err) {
+ setValue(id, pastedText, {
+ shouldDirty: true,
+ });
+ }
}
}}
- disabled={isSubmitting}
/>
</div>
-
- {showOptionStates[id] && (
- <div className="rounded-md border border-neutral-200 bg-white">
- <textarea
- {...register(id)}
- className="w-full resize-none rounded-md border-0 bg-transparent px-3 py-2 font-mono text-xs text-neutral-700 focus:outline-none focus:ring-0"
- rows={4}
- spellCheck={false}
- onPaste={(e) => {
- if (
- [
- "appleAppSiteAssociation",
- "assetLinks",
- ].includes(id)
- ) {
- e.preventDefault();
- const pastedText =
- e.clipboardData.getData("text");
-
- try {
- const formattedJson = JSON.stringify(
- JSON.parse(pastedText),
- null,
- 2,
- );
- setValue(id, formattedJson, {
- shouldDirty: true,
- });
- } catch (err) {
- setValue(id, pastedText, {
- shouldDirty: true,
- });
- }
- }
- }}
- />
- </div>
- )}
- </div>
- );
- },
- )}
- </div>
+ )}
+ </div>
+ );
+ },
+ )}
</AnimatedSizeContainer>
</div>
</>
@@ -634,14 +618,14 @@ const ADVANCED_OPTIONS = [
id: "appleAppSiteAssociation",
title: "Apple App Site Association",
description: "Provide a config file for iOS deep linking",
- icon: Apple,
+ icon: AppleLogo,
proFeature: true,
},
{
id: "assetLinks",
title: "Asset Link",
description: "Provide a config file for Android deep linking",
- icon: Smartphone,
+ icon: AndroidLogo,
proFeature: true,
},
] as const;
diff --git a/apps/web/ui/links/link-title-column.tsx b/apps/web/ui/links/link-title-column.tsx
index a03a73a6bf..ccd9ca5ce9 100644
--- a/apps/web/ui/links/link-title-column.tsx
+++ b/apps/web/ui/links/link-title-column.tsx
@@ -15,7 +15,7 @@ import {
useInViewport,
} from "@dub/ui";
import {
- Apple,
+ AppleLogo,
ArrowRight,
Bolt,
BoxArchive,
@@ -55,7 +55,7 @@ const quickViewSettings = [
{ label: "Link Cloaking", icon: Incognito, key: "rewrite" },
{ label: "Password Protection", icon: InputPassword, key: "password" },
{ label: "Link Expiration", icon: CircleHalfDottedClock, key: "expiresAt" },
- { label: "iOS Targeting", icon: Apple, key: "ios" },
+ { label: "iOS Targeting", icon: AppleLogo, key: "ios" },
{ label: "Android Targeting", icon: Robot, key: "android" },
{ label: "Geo Targeting", icon: EarthPosition, key: "geo" },
];
diff --git a/apps/web/ui/shared/icons/devices.tsx b/apps/web/ui/shared/icons/devices.tsx
index bb82535b26..7ef32a6de3 100644
--- a/apps/web/ui/shared/icons/devices.tsx
+++ b/apps/web/ui/shared/icons/devices.tsx
@@ -82,25 +82,3 @@ export function Safari({ className }: { className: string }) {
</svg>
);
}
-
-export function Apple({ className }: { className: string }) {
- return (
- <svg
- viewBox="0 0 2048 2048"
- width="2048px"
- height="2048px"
- className={className}
- >
- <path
- fill="#424242"
- fillRule="nonzero"
- d="M1318.64 413.756c-14.426,44.2737 -37.767,85.3075 -65.8997,119.436l0 0.0625985c-28.3855,34.324 -66.3012,64.6713 -108.482,84.7926 -38.713,18.4665 -81.1489,28.4114 -123.377,25.1197l-12.9236 -1.00748 -1.70197 -12.8681c-5.48622,-41.4992 0.849213,-83.5099 14.1921,-122.387 15.5268,-45.241 40.6772,-86.5205 67.6642,-117.8l-0.00472441 -0.00472441c27.9272,-32.7142 65.3788,-61.1776 105.487,-81.8009 40.2437,-20.6941 83.465,-33.6343 122.803,-35.237l14.8701 -0.605906 1.62992 14.8559c4.76457,43.4481 -1.02992,86.8489 -14.2571,127.445z"
- />
- <path
- fill="#424242"
- fillRule="nonzero"
- d="M1592.05 804.067c-14.2559,8.82048 -152.045,94.0808 -150.337,265.937 1.80236,207.182 177.474,279.003 187.171,282.966l0.0625985 0 0.419292 0.173622 13.7835 5.70709 -4.72087 14.1047c-0.279921,0.836221 0.0377953,-0.0531496 -0.370866,1.25906 -4.48229,14.361 -34.8685,111.708 -103.511,212.014 -31.1481,45.4985 -62.8831,90.9284 -100.352,125.971 -38.7957,36.2823 -83.1024,60.7737 -137.837,61.7906 -51.5894,0.968505 -85.3642,-13.6453 -120.474,-28.8366 -33.4784,-14.4862 -68.2949,-29.5524 -122.779,-29.5524 -57.2339,0 -93.8198,15.5858 -129.06,30.6 -33.1725,14.1319 -65.2548,27.7996 -111.474,29.6433l-0.0625985 0c-53.3693,1.98189 -99.6485,-24.0343 -140.778,-62.5678 -39.3496,-36.8646 -73.8249,-85.1398 -105.241,-130.579 -70.917,-102.399 -132.592,-251.392 -151.647,-402.892 -15.6732,-124.616 -2.57244,-251.206 57.6756,-355.753 33.6331,-58.4953 80.6398,-106.233 135.598,-139.543 54.7075,-33.1571 117.299,-52.0264 182.451,-53.0032l0 -0.0011811c57.0402,-1.03465 110.823,20.3091 157.884,38.9847 33.3059,13.2165 62.98,24.9933 85.226,24.9933 19.6536,0 48.6237,-11.4224 82.3949,-24.737 57.0367,-22.487 126.815,-49.9949 200.599,-42.6579 30.9862,1.34764 95.5265,8.76969 161.501,44.524 42.0284,22.7776 84.6579,56.9741 119.701,108.261l9.23977 13.5248 -13.8024 8.91261c-0.73819,0.477166 -0.0200788,-0.00944883 -1.25906,0.755906z"
- />
- </svg>
- );
-}
diff --git a/packages/ui/src/icons/nucleo/android-logo.tsx b/packages/ui/src/icons/nucleo/android-logo.tsx
new file mode 100644
index 0000000000..3a9ad8a852
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/android-logo.tsx
@@ -0,0 +1,49 @@
+import { SVGProps } from "react";
+
+export function AndroidLogo(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="24"
+ width="24"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g
+ fill="currentColor"
+ strokeLinecap="square"
+ strokeLinejoin="miter"
+ strokeMiterlimit="10"
+ >
+ <path
+ d="M20.5 3.5L18.5 7L18.722 6.61155"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ />
+ <path
+ d="M3.5 3.5L5.50001 7L5.27804 6.61155"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ />
+ <path
+ d="M2 19L22 19L22 15C22 9.47715 17.5228 5 12 5C6.47715 5 2 9.47715 2 15L2 19Z"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ />
+ <path
+ d="M7.25 15.25C7.94036 15.25 8.5 14.6904 8.5 14C8.5 13.3096 7.94036 12.75 7.25 12.75C6.55964 12.75 6 13.3096 6 14C6 14.6904 6.55964 15.25 7.25 15.25Z"
+ fill="currentColor"
+ stroke="none"
+ />
+ <path
+ d="M16.75 15.25C17.4404 15.25 18 14.6904 18 14C18 13.3096 17.4404 12.75 16.75 12.75C16.0596 12.75 15.5 13.3096 15.5 14C15.5 14.6904 16.0596 15.25 16.75 15.25Z"
+ fill="currentColor"
+ stroke="none"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/apple-logo.tsx b/packages/ui/src/icons/nucleo/apple-logo.tsx
new file mode 100644
index 0000000000..ac1204f1a2
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/apple-logo.tsx
@@ -0,0 +1,32 @@
+import { SVGProps } from "react";
+
+export function AppleLogo(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="24"
+ width="24"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g
+ fill="currentColor"
+ strokeLinecap="square"
+ strokeLinejoin="miter"
+ strokeMiterlimit="10"
+ >
+ <path
+ d="M20.1407 16.7842C19.676 17.8035 19.4543 18.2585 18.8551 19.1592C18.0214 20.417 16.8442 21.9835 15.3865 21.997C14.091 22.0092 13.758 21.1627 12 21.172C10.242 21.1813 9.87505 22.012 8.57954 21.9999C7.12182 21.987 6.00764 20.572 5.17254 19.3135C2.83863 15.7957 2.59497 11.6678 4.03427 9.47356C5.05708 7.91357 6.67134 7.00144 8.18855 7.00144C9.73339 7.00144 10.7045 7.84 11.9823 7.84C13.2218 7.84 13.9762 7.00001 15.7633 7.00001C17.1133 7.00001 18.5441 7.72786 19.5634 8.9857C16.2237 10.7993 16.7663 15.5214 20.1407 16.7842Z"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ />
+ <path
+ d="M15.3652 3.793C16.0815 2.87425 16.5702 1.63176 16.373 0.305766C15.203 0.386016 13.89 1.07576 13.0912 2.0455C12.3667 2.92525 11.7675 4.231 12 5.5C13.2765 5.53975 14.598 4.77775 15.3652 3.793Z"
+ fill="currentColor"
+ stroke="none"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/apple.tsx b/packages/ui/src/icons/nucleo/apple.tsx
deleted file mode 100644
index e630c6b91c..0000000000
--- a/packages/ui/src/icons/nucleo/apple.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { SVGProps } from "react";
-
-export function Apple(props: SVGProps<SVGSVGElement>) {
- return (
- <svg
- height="18"
- width="18"
- viewBox="0 0 18 18"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- >
- <g fill="currentColor">
- <path
- d="M13.964,5.405c-1.595-1.267-3.391-.223-4.909-.223s-3.131-1.107-4.909,.223-1.95,4.687,.025,7.801c1.895,2.989,3.805,1.817,4.886,1.817s2.992,1.174,4.886-1.817c1.973-3.114,1.489-6.639,.021-7.801Z"
- fill="none"
- stroke="currentColor"
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth="1.5"
- />
- <path
- d="M11.5,.25h0c.276,0,.5,.224,.5,.5h0c0,1.38-1.12,2.5-2.5,2.5h0c-.276,0-.5-.224-.5-.5h0c0-1.38,1.12-2.5,2.5-2.5Z"
- fill="currentColor"
- stroke="none"
- />
- </g>
- </svg>
- );
-}
diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts
index 9bf8a019d4..e45f297978 100644
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@ -1,4 +1,5 @@
-export * from "./apple";
+export * from "./android-logo";
+export * from "./apple-logo";
export * from "./arrow-bold-up";
export * from "./arrow-right";
export * from "./arrow-trend-up";