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.

moved nav and footer over

Steven Teybddbdc681ea3
diff --git a/apps/web/app/[domain]/layout.tsx b/apps/web/app/[domain]/layout.tsx
index 7d72e9f65a..0a2b92a41b 100644
--- a/apps/web/app/[domain]/layout.tsx
+++ b/apps/web/app/[domain]/layout.tsx
@@ -1,11 +1,11 @@
-import MobileNav from "#/ui/home/nav-mobile";
-import Nav from "#/ui/home/nav";
-import Footer from "#/ui/home/footer";
+import { NavMobile } from "ui";
+import { Nav } from "ui";
+import { Footer } from "ui";
export default function CustomDomainLayout(props) {
return (
<div className="flex min-h-screen flex-col justify-between">
- <MobileNav />
+ <NavMobile />
<Nav />
{props.children}
<Footer />
diff --git a/apps/web/app/inspect/[domain]/[key]/page.tsx b/apps/web/app/inspect/[domain]/[key]/page.tsx
index a56cc20ea4..0bbfe8bfac 100644
--- a/apps/web/app/inspect/[domain]/[key]/page.tsx
+++ b/apps/web/app/inspect/[domain]/[key]/page.tsx
@@ -1,7 +1,7 @@
import { getLinkViaEdge } from "#/lib/planetscale";
import { constructMetadata, getApexDomain } from "#/lib/utils";
-import Footer from "#/ui/home/footer";
-import Nav from "#/ui/home/nav";
+import { Footer } from "ui";
+import { Nav } from "ui";
import { notFound } from "next/navigation";
import Background from "#/ui/home/background";
import LinkInspectorCard from "./card";
diff --git a/apps/web/components/app/links/links-container.tsx b/apps/web/components/app/links/links-container.tsx
index a3026bd59c..df695c2ada 100644
--- a/apps/web/components/app/links/links-container.tsx
+++ b/apps/web/components/app/links/links-container.tsx
@@ -1,4 +1,4 @@
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
import LinkCard from "./link-card";
import LinkCardPlaceholder from "./link-card-placeholder";
import LinkFilters from "./link-filters";
@@ -25,7 +25,7 @@ export default function LinksContainer({
<LinkSort />
</div>
<div className="grid grid-cols-1 gap-5 lg:grid-cols-7">
- <div className="sticky top-32 col-span-2 hidden max-h-[calc(100vh-150px)] self-start overflow-auto rounded-lg border border-gray-100 bg-white shadow scrollbar-hide lg:block">
+ <div className="scrollbar-hide sticky top-32 col-span-2 hidden max-h-[calc(100vh-150px)] self-start overflow-auto rounded-lg border border-gray-100 bg-white shadow lg:block">
<LinkFilters />
</div>
<div className="col-span-1 auto-rows-min grid-cols-1 lg:col-span-5">
diff --git a/apps/web/components/layout/app/index.tsx b/apps/web/components/layout/app/index.tsx
index bf00227cda..b49fe1c5fe 100644
--- a/apps/web/components/layout/app/index.tsx
+++ b/apps/web/components/layout/app/index.tsx
@@ -15,7 +15,7 @@ import { Badge } from "ui";
import { linkConstructor } from "#/lib/utils";
import { HOME_DOMAIN } from "#/lib/constants";
import { useAcceptInviteModal } from "@/components/app/modals/accept-invite-modal";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
import { LoadingSpinner, Logo } from "ui";
import { FileX2 } from "lucide-react";
import BlurImage from "#/ui/blur-image";
diff --git a/apps/web/components/layout/app/settings-layout.tsx b/apps/web/components/layout/app/settings-layout.tsx
index e318cc145a..96e8e176fd 100644
--- a/apps/web/components/layout/app/settings-layout.tsx
+++ b/apps/web/components/layout/app/settings-layout.tsx
@@ -4,7 +4,7 @@ import dynamic from "next/dynamic";
const AppLayout = dynamic(() => import("@/components/layout/app"), {
ssr: false,
});
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
import { ReactNode } from "react";
import { cn } from "#/lib/utils";
diff --git a/apps/web/lib/constants/content.tsx b/apps/web/lib/constants/content.tsx
index 4a9c453d42..0a90e57b11 100644
--- a/apps/web/lib/constants/content.tsx
+++ b/apps/web/lib/constants/content.tsx
@@ -1,17 +1,6 @@
import { Logo } from "ui";
import { allHelpPosts } from "contentlayer/generated";
-import {
- Airplay,
- BarChart,
- Globe,
- Import,
- Link2,
- Lock,
- QrCode,
- Settings,
- Users,
- Webhook,
-} from "lucide-react";
+import { Globe, Import, Link2, Lock, Settings, Webhook } from "lucide-react";
export const BLOG_CATEGORIES: {
title: string;
@@ -102,232 +91,3 @@ export const getPopularArticles = () => {
(slug) => allHelpPosts.find((post) => post.slug === slug)!,
);
};
-
-export const FEATURES_LIST = [
- {
- title: "Powerful Analytics For The Modern Marketer",
- shortTitle: "Advanced Analytics",
- accordionTitle: "Analytics that matter",
- description:
- "Dub provides powerful analytics for your links, including geolocation, device, browser, and referrer information.",
- icon: BarChart,
- slug: "analytics",
- thumbnail: "https://d2vwwcvoksz7ty.cloudfront.net/features/analytics.png",
- thumbnailBlurhash:
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE+0lEQVR4nL2Y63qiShBF5/2f8czkpjGCgoLQV+yzq6saGpVMYjznx/ok0JBa7GrQ/mWsC7fQhLE3MEEJl8eMteP51hH+L8g4e81SXUv8WhS5KFJpwlyhdSZicpGpYCf8VSgT+09EliQYPs5j3ZVIknA+41O5+9K5S6RXE0lEJZEok6Xhhwx/zaLU99L5lkguMJGOuyiiMxHnWMB/wi2py3TMF5L5skifiXQzbJTpIZJkpkQykWGBeHxJRtpLtn8s0pNILtGbcIrYSEcoJzIe53hcY2CRJCOFDxfM0xlGmVtz50EiNt79Too/dUxLn72LRBnlRWaYZPwZEsxwwf8iYpKItE+SaEWgOREu0naEx3EPoQEyQyZDBU8yudRcYrieJ9bHVr17sjOTCKWRJBpwhMShJdzIsfXY73GchIYo1Eehc5QhHOEzpP1szlh8zo9FXBQZJSBwhEDd2FAdbdgfXNhl7I8e+32o2wFSA6SGKNXrc0QRhtH2HFOb468Rkfw99U0RPpl6n+YAtc8RbVQ3VDAKr10oKhe2xF6oPPb5UNYeYgOkBqTFQi3RE2dc74zrnmNqiT4m6EdorqlR5oEiNBeohaqG7z5JfKD4zc6F91LYefztsd9HKRLaQ4YSOkhKKak2k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
- videoUrl:
- "https://www.youtube.com/embed/i05FamHTn_I?si=gRnWs5Kf2n6Qyqmd&autoplay=1",
- videoLength: "2:56",
- bentoTitle: "Detailed insights for every click",
- bentoDescription:
- "Dub provides detailed analytics for every click on your links. See where your audience is coming from and what devices they are using.",
- bentoFeatures: [
- {
- title: "Time-series data",
- description:
- "See how your links are performing over time with a beautiful time-series chart.",
- image:
- "https://d2vwwcvoksz7ty.cloudfront.net/features/time-series-data.png",
- },
- {
- title: "Geographic data",
- description:
- "Understand your audience with geographic data – on both a country and city level.",
- image: "https://d2vwwcvoksz7ty.cloudfront.net/features/geo-data.png",
- },
- {
- title: "Device data",
- description:
- "See what devices your audience is using to click on your links",
- },
- {
- title: "Referrer data",
- description:
- "Understand which websites are driving the most traffic to your links.",
- },
- {
- title: "404 monitoring",
- description:
- "Monitor your links for 404 errors and notifies you when they occur.",
- },
- ],
- },
- {
- title: "Branded Links That Stand Out",
- shortTitle: "Branded Links",
- accordionTitle: "Use your own domain",
- description:
- "Dub offers free and unlimited custom domains on all plans for you to create branded links that stand out.",
- icon: Airplay,
- slug: "branded-links",
- thumbnail:
- "https://d2vwwcvoksz7ty.cloudfront.net/features/branded-links.png",
- thumbnailBlurhash:
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAADYElEQVR4nMWY2XLDIAxF/f9/28QGs5myCSQBXtLM9OFO09axdXwlIVjccXjnotyJjqZw/UHkv6B83/gsY63XWvt9V15K6YUQfts2v64rVfjbtgkvwjX7vvsFgrVRNsoyuV7p+iPJcR0j2GulGMLzjDFeKZWCwxDv99u/ol7v9DlqXQNMuCYCLzMAg2Xgs6vK3zkqUAf2RxBwI775BPF6UUWYABhB43WL5QGHG0VpIjtQADKOwR0V7inQFGSlID8/ABNdKSkWQXLwWTVwTaWIbFWEwSJAD2F6kJZab0itgSMIxHQAOWAdbpi1KzOQRVAuCbuUa+k+TAeSakSmguY18io1QkD6N48BivYsuZsqgOFAZzBTiA5Ep2LnXSumUi70NUOsuXNtAXhRGIBDVACuBiQLDABp3dIMOtyVKxQkt1/oXA2mACWorbbf6EZswQsEX99+ukG0tkiqcCGW9ltQ/CmIQwimuPIcpKwjJr/YncAUIIAS2YkIIUI9LRxCIggCIFT4YpBUCSTDmAYzAAFXnoBAeun6ggGmAFWoBhH/t7Q64C7sSZtoWgvMWqGoM7FucEdrIO6y4OvCDOuYgbqFNCtAAAWfS8yXIBRGUU1AtM5rDQe504LppEHXN9pZNanrBYq6r4nY/rgjIIABEH0DxN1owf3c10YjDGUrFDSrhUBwEJZa3BVRHJEcpDzMfhuEL95PQMQEYisdDFpyghiBuPupNYKxCAaPUpcgo5QaCbqZLGtNdsOktDKD+rg/c30T5ARGJDWI7IauNxyn1ZMp+EMQ+YEjojgiU0ssIMwR2Mu4/0st2noBLAe/lwUIIFQdaVJbTFuAEYR7tDdpQPPOxYfcOQh6+y2lKExapDCIxiAWFfonjhydIyOQi641d0RiRwpEXJSuHLm3IJ61X/dJ+/0wtYojBu/3B4cYVy58ZR3BqTXURWrR9HJdwXOYuxB1xK8aguh5sU8gKsgO6WXmrkxg7kFQNxJEGoMGINNZawIiCojEICS9TH0wP1I6Oz8bHT2Zk5SiIGgnWIHkaEPV/o5rBIN0riBNz8guxO/zfRCUWgRGzWHwin8n6A6CpVQFUQbvR/oUmwoBcAgMMoN5Ihx8fzQ1Aqn7Ev0YpINh52K6jC51oDwNmmtwxlYn7fb7L/LDQmuPkz48AAAAAElFTkSuQmCC",
- videoUrl:
- "https://www.youtube.com/embed/LbgvQxLVqq4?si=7_sJVXFZINPxbAdM&autoplay=1",
- videoLength: "3:23",
- bentoTitle: "Impress your audience with branded links",
- bentoDescription:
- "Create custom short links that match your brand and stand out from the crowd, with free and unlimited custom domains on all plans.",
- bentoFeatures: [
- {
- title: "Unlimited custom domains",
- description:
- "Add as many custom domains as you want to your project at no extra cost.",
- image: "https://d2vwwcvoksz7ty.cloudfront.net/features/domains.png",
- href: "/help/article/how-to-add-custom-domain",
- },
- {
- title: "Custom Social Media Cards",
- description:
- "Customize the title, description, and image of your links when shared on social media.",
- image:
- "https://d2vwwcvoksz7ty.cloudfront.net/features/social-cards.png",
- href: "/help/article/how-to-create-link#custom-social-media-cards",
- },
- {
- title: "Free SSL certificates",
- description:
- "Dub automatically provisions SSL certificates for your custom domains.",
- },
- {
- title: "Link cloaking",
- description:
- "Hide your destination URL with link cloaking to make your links look cleaner.",
- href: "/help/article/how-to-create-link#link-cloaking",
- },
- {
- title: "Custom QR codes",
- description:
- "With Dub Pro, you can create branded QR codes for your links.",
- href: "/features/qr-codes",
- },
- ],
- },
- {
- title: "Free QR Code Generator",
- shortTitle: "QR Codes",
- accordionTitle: "Free QR Code Generator",
- description:
- "QR codes and short links are like peas in a pod. Dub offers free QR codes for every short link you create.",
- icon: QrCode,
- slug: "qr-codes",
- thumbnail: "https://d2vwwcvoksz7ty.cloudfront.net/features/qr-codes.png",
- thumbnailBlurhash:
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFvklEQVR4nL2Y23qaUBCF+/7v1CZpG1uTeD4jooIgCHISMb2arhnEIzbaNrmYD90aMv9ea2Y2flqnr5SsN9dFuqH1SeRrb/1t9v1XiZRjw/GL0tdftDkJWZd4PYv8Hqfx6X+AHH5nlXCk29jsIkkOoNZboC1MMUgBxJsg6eGubZMr2uU3QCTpVUrxhdhByfe3SSC5zeYyyKXEC0EOLXJppw9B1yd24uQ40ShGRCmFHOGagjBFZFde48/jmGFzoFyZ/waSx7kqR0kXAmwkQU7YD9a09BHLhLyDWC7xGdYDfJ4BZX9XBHKtla4GubT7pwpkAFnCrruixWJFjhOTvQu8x5rrJgLIsGGYweSqpFuY09r47yB7m2VFHK94Z3MAJO/GNLcjsuYhmWZIxizYRkgzvDetiGw7Fkgvh4nSE1VuK+43QHKYY7BDiEggsLs+E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M5VEu70hgAZQqC/Br7tdBaAqgCcodAMDESB2BuJvQaL4HOTWoXg1yNF5SwajLxbjDjbVTdntIZIdKJoknoeijAAxRnNAfegznLXmePByL4Lkavzjo+6l2OxUiaR7ZRZjGFbGgs2M2RyFbOI8ZaA1T3ehjaeihA4IVmM+d3BE8VBrfqG1TkGuBboS5FVa475Wkp0yHtoot2Qb6lhIkhXiOtA5oBRfDQCwEvx5rsbSD6Sd74t9PxT/5mnxepCDWtk/KfJzRSzquDmQ48FyC0maleIrq8BrDLFwMzX2ttqDrNMPBDl8WsyV4QbAzyl8xOf5wEAO7MNQfOVgAFYihzhW48+2usZefwVyCYaPMKwOzxoXCfOsyIMB2E45hNTGH211/mvj+jBOQa7+uXR9+pMQQLYwfMyIomMgTpihOHwOBsB6DlE0CI8T/3UhihX6DZrKi05GV59sAAAAAElFTkSuQmCC",
- videoUrl:
- "https://www.youtube.com/embed/fcWkUZoJJ7w?si=LKNOO67aL6Q-3xN4&autoplay=1",
- videoLength: "1:07",
- bentoTitle: "Gorgeous QR codes for your links",
- bentoDescription:
- "Create beautiful flyers and posters with QR codes for your links.",
- },
- {
- title: "Personalize Your Short Links",
- shortTitle: "Personalization",
- accordionTitle: "Personalize Your Short links",
- description:
- "Customize your link's behavior with device targeting, geo targeting, link cloaking, and more.",
- icon: Link2,
- slug: "personalization",
- thumbnail:
- "https://d2vwwcvoksz7ty.cloudfront.net/features/personalization.png",
- thumbnailBlurhash:
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlElEQVR4nL2YB1NUSxBG/fcUKGlJokiQjBIkZyTnnOMiGVzMEgz0m9NLrwOSCtZH1dRd7t6d6dNfh5n7SG74Ozs7k1+/fsnJyYl8//5dvnz5Ih8/fpRQKCT7+/uys7MrW1vbsrm5GRlbW1vu/o7s7u7qM+/fv5cPHz7Ip0+f3O8/6xyMr1+/6vj27ZvOfXR0pOucnp7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hqlxNlZWWSn5/vjM+WzMxMycjIkLS0NB18zsrKigDxLArV1dXp7wk3KuD09LSqwhrkIz2G8PLz5N4gdha5CoTSS6K/efNGSkpKJC8vT549e6bGJycHJDExyY1ESUpO1nsAohDApaWlmlMo09HRoWHKnCQ/uUJ4kfSsa2X43iD+oeoyCF0dkObmFs0Pwgoj8X5yICDx8fES9/ixxMbGymN3BSgQSHHfP9WQAwZlCDOcgSo0UHKF5knSW56Q8HfJkzuDsFeiidEDLLRMkQsgToEnT54oRExMjF75PzEpSVJTU1U1wgwVcQJVj1whvNgxUI7JE9azhMeGqICEt/EhXYA4pg8QDiQ7pZdQyc3L1fAJpAQkISFB4uLiFIIrCiU5EEIMEMLwLiAk/D8BQfKVlVWZnpnW7QdllGZI7ygoKNCwSU9PV1WAQYl4dwUiJeXuoXUVyG2V60YQvGAgJB+bPkokTYyGhgHNzc0aXqhC+aVCEWKEUcDlS4q7AvfUqcV3qEEo0jBxAp2fMKXrMy/z47DLoRUVEDvq+tsUa4pUHaoPJRUYvE2+PH/+XMOIKyrk5Obod0DQd+j4OMF6CV1+wc1L1cJhflN8MIj/KgiZqVx2JrGtPNULrwJDqGAkQHR16+7kA6HEd6iHEtYQ2erYDtnOLnaipMj4W/oHgVD6AME7eAlvBdeDqoq/nUcZPIyRFAASmYHh/E8DBJZneNbfSOKUJW+/RVj5+y2//D4IhMmYFC/ZSZFYpoEBY4csjOOAhULh80mrVjb+pzCggH/wIjz9I7Ft520HfPlc8qCqhaRMRp6E322FtPPSHIFBGYwhxvEuCmEo+cMIn+UH9T7G88x123g7k7COqXHXM8mNIPwQT5gq9soU6YHxX9QBxMYPA9k3YSyDz/bOizyw916UcVTAIYQTx4TrTolRA2Gi69//7mioUc3s9SlepnFyZQDKCL9SDd541LVDla/GbfnB3395WbgdqvKtmQAAAABJRU5ErkJggg==",
- videoUrl:
- "https://www.youtube.com/embed/K2UdLK8k1I4?si=79hu5XSW9pSjODOm&autoplay=1",
- videoLength: "2:25",
- bentoTitle: "Optimize your links for every audience",
- bentoDescription:
- "Get the most out of every click by delivering the right experience to the right audience.",
- bentoFeatures: [
- {
- title: "Device targeting",
- description:
- "Redirect your audience to different destinations based on their device type (e.g. iOS/Android).",
- image:
- "https://d2vwwcvoksz7ty.cloudfront.net/features/device-targeting.png",
- href: "/help/article/how-to-create-link#device-targeting-ios--android",
- },
- {
- title: "Geo targeting",
- description:
- "Redirect your audience to different destinations based on their country of origin.",
- image:
- "https://d2vwwcvoksz7ty.cloudfront.net/features/geo-targeting.png",
- href: "/help/article/how-to-create-link#geo-targeting",
- },
- {
- title: "Expiration dates",
- description:
- "Automatically disable your links after a certain date & time.",
- href: "/help/article/how-to-create-link#expiration-date",
- },
- {
- title: "Password protection",
- description:
- "Protect your links with passwords to prevent unauthorized access.",
- href: "/help/article/how-to-create-link#password-protection",
- },
- {
- title: "Link cloaking",
- description:
- "Hide your destination URL with link cloaking to make your links look cleaner.",
- href: "/help/article/how-to-create-link#link-cloaking",
- },
- ],
- },
- // { title: "Programmatic Link Creation", shortTitle: "API", slug: "api" },
- {
- title: "Collaborate With Your Team",
- shortTitle: "Team Collaboration",
- accordionTitle: "Collaborate With Your Team",
- description:
- "Invite your teammates to collaborate on your links. For enterprises, Dub offers SAML SSO for better security.",
- icon: Users,
- slug: "collaboration",
- thumbnail:
- "https://d2vwwcvoksz7ty.cloudfront.net/features/collaboration.png",
- thumbnailBlurhash:
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE0UlEQVR4nM2YC3eiWBCE5///yIlRQN6vyxu0p6ovILLZTMzDXc+pg6AJ/VnVfYFf8g2v6/Uql8tl1TRNq8ZxvNP2s+X7/HvqK69f3wGxgOyLH4bhTW2hvgvmW0D2EEvBfd+/qbdg/hOQ5aQW4opiLijqBsFiu65TtW27UTcfvwfaw3wG6CGQPYB1wkJYgEE6FMiCGxTeNI2qrqH5/QJFoC3M00DuIS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v1LtGYQxkthEDE6QyBGTYVBUFJ5o6O6Klt1gpEiBGPF/hgGe2swzSCXnwJZxu+4aXYFQcMv8TKYYAqjQuFafKsiQGVaXXuaup8hrBsWZLyBLK48sLp/AOTfxi9BAMHJZex6woIJsBedMGWjcbrBdHcw7BGuI9Pqyg3myyDX90AQiQWkJkjZasElldc3FVYEMcbC2GjxKQsfVvChhX0Cc+fK5fJQvB4EmWaQ5aKx11+XvzILVYii1qm0VUlh3JZlrdPKwjR3MP0MM+5gPhqvv4D88yHcclPFSLCIum71nsSCAKKo9P6Eq/aqwoq3w7y2MqaeHw01enliH9z1O1ceezz0B49+MX0EZnFXAAAAAElFTkSuQmCC",
- videoUrl:
- "https://www.youtube.com/embed/_m9RM8L6TOw?si=49_XIkQ7g-61dRtV&autoplay=1",
- videoLength: "2:13",
- bentoTitle: "Seamless collaboration for marketing teams",
- bentoDescription:
- "View and manage your team's links in one place, with fine-grained permissions and SAML SSO for enterprises.",
- bentoFeatures: [
- {
- title: "Unlimited teammates",
- description:
- "All paid plans come with unlimited teammates, so you can work with your team without worrying about extra costs.",
- image: "https://d2vwwcvoksz7ty.cloudfront.net/features/teammates.png",
- href: "/help/article/how-to-invite-teammates",
- },
- {
- title: "SAML SSO",
- description:
- "Dub offers SAML SSO for enterprises to provide better security and control over their projects.",
- image: "https://d2vwwcvoksz7ty.cloudfront.net/features/saml.png",
- href: "/help/category/saml-sso",
- },
- {
- title: "Tags & comments",
- description:
- "Organize your links with tags and comments to provide context for your team.",
- href: "/help/article/how-to-use-tags",
- },
- {
- title: "Fine-grained permissions",
- description:
- "Enterprises on Dub can set role-based access controls (RBAC) to control who can create, edit, and delete links.",
- },
- {
- title: "Team analytics",
- description:
- "See how your team is performing with team analytics, including link clicks and top referrers.",
- },
- ],
- },
-];
diff --git a/apps/web/pages/app.dub.co/[slug]/[domain]/[[...key]].tsx b/apps/web/pages/app.dub.co/[slug]/[domain]/[[...key]].tsx
index 9a57d2f261..d36db296a4 100644
--- a/apps/web/pages/app.dub.co/[slug]/[domain]/[[...key]].tsx
+++ b/apps/web/pages/app.dub.co/[slug]/[domain]/[[...key]].tsx
@@ -1,7 +1,7 @@
import { useContext } from "react";
import AppLayout from "@/components/layout/app";
import BlurImage from "#/ui/blur-image";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
import Stats from "@/components/stats";
import useProject from "#/lib/swr/use-project";
import { ModalContext } from "#/ui/modal-provider";
diff --git a/apps/web/pages/app.dub.co/[slug]/domains.tsx b/apps/web/pages/app.dub.co/[slug]/domains.tsx
index 8040e800c5..0edfc5d9d7 100644
--- a/apps/web/pages/app.dub.co/[slug]/domains.tsx
+++ b/apps/web/pages/app.dub.co/[slug]/domains.tsx
@@ -1,5 +1,5 @@
import { useAddEditDomainModal } from "@/components/app/modals/add-edit-domain-modal";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
import AppLayout from "components/layout/app";
import useProject from "#/lib/swr/use-project";
import DomainCard from "@/components/app/domains/domain-card";
diff --git a/apps/web/pages/app.dub.co/[slug]/index.tsx b/apps/web/pages/app.dub.co/[slug]/index.tsx
index 0e0918e28a..415e6db6ff 100644
--- a/apps/web/pages/app.dub.co/[slug]/index.tsx
+++ b/apps/web/pages/app.dub.co/[slug]/index.tsx
@@ -1,6 +1,6 @@
import LinksContainer from "@/components/app/links/links-container";
import { useAddEditLinkModal } from "@/components/app/modals/add-edit-link-modal";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
import AppLayout from "components/layout/app";
import { useRouter } from "next/router";
import useProject from "#/lib/swr/use-project";
diff --git a/apps/web/pages/app.dub.co/index.tsx b/apps/web/pages/app.dub.co/index.tsx
index 5379c0fe53..e04c151406 100644
--- a/apps/web/pages/app.dub.co/index.tsx
+++ b/apps/web/pages/app.dub.co/index.tsx
@@ -1,7 +1,7 @@
import NoProjectsPlaceholder from "@/components/app/projects/no-projects-placeholder";
import ProjectCard from "@/components/app/projects/project-card";
import ProjectCardPlaceholder from "@/components/app/projects/project-card-placeholder";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
import dynamic from "next/dynamic";
const AppLayout = dynamic(() => import("@/components/layout/app"), {
ssr: false,
diff --git a/apps/web/pages/app.dub.co/links/index.tsx b/apps/web/pages/app.dub.co/links/index.tsx
index 72a009ea53..6f8e135df5 100644
--- a/apps/web/pages/app.dub.co/links/index.tsx
+++ b/apps/web/pages/app.dub.co/links/index.tsx
@@ -4,7 +4,7 @@ const AppLayout = dynamic(() => import("@/components/layout/app"), {
});
import LinksContainer from "@/components/app/links/links-container";
import { useAddEditLinkModal } from "@/components/app/modals/add-edit-link-modal";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "ui";
export default function Links() {
const { AddEditLinkModal, AddEditLinkButton } = useAddEditLinkModal();
diff --git a/packages/ui/package.json b/packages/ui/package.json
index a5dc6d92aa..34d2102279 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -31,11 +31,15 @@
"typescript": "^5.1.6"
},
"dependencies": {
+ "@radix-ui/react-navigation-menu": "^1.1.2",
"@radix-ui/react-popover": "1.0.5",
"@radix-ui/react-switch": "^1.0.1",
"@radix-ui/react-tooltip": "^1.0.2",
+ "@vercel/analytics": "^1.0.0",
"class-variance-authority": "^0.7.0",
"clsx": "^1.2.1",
+ "lucide-react": "^0.269.0",
+ "next": "13.5.5-canary.4",
"tailwind-merge": "^1.13.2",
"vaul": "^0.6.8"
}
diff --git a/apps/web/app/ui/home/footer.tsx b/packages/ui/src/footer.tsx
similarity index 96%
rename from apps/web/app/ui/home/footer.tsx
rename to packages/ui/src/footer.tsx
index 30a412d979..86ca0940e1 100644
--- a/apps/web/app/ui/home/footer.tsx
+++ b/packages/ui/src/footer.tsx
@@ -1,12 +1,11 @@
"use client";
import Link from "next/link";
-import { LogoType } from "ui";
-import { Github, LinkedIn, Twitter } from "@/components/shared/icons";
+import { LogoType, Github, LinkedIn, Twitter } from "./icons";
import { useParams } from "next/navigation";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
+import { MaxWidthWrapper } from "./max-width-wrapper";
import va from "@vercel/analytics";
-import { FEATURES_LIST } from "#/lib/constants/content";
+import { FEATURES_LIST } from "./lib/constants/content";
const navigation = {
features: FEATURES_LIST.map(({ shortTitle, slug }) => ({
@@ -31,7 +30,7 @@ const navigation = {
],
};
-export default function Footer() {
+export function Footer() {
const { domain = "dub.co" } = useParams() as { domain: string };
const createHref = (href: string) =>
diff --git a/packages/ui/src/icons/github.tsx b/packages/ui/src/icons/github.tsx
new file mode 100644
index 0000000000..ff13f3937a
--- /dev/null
+++ b/packages/ui/src/icons/github.tsx
@@ -0,0 +1,14 @@
+export default function Github({ className }: { className?: string }) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="20"
+ height="20"
+ fill="currentColor"
+ viewBox="0 0 24 24"
+ className={className}
+ >
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/index.tsx b/packages/ui/src/icons/index.tsx
index 37d459ff9d..16c16dfd5d 100644
--- a/packages/ui/src/icons/index.tsx
+++ b/packages/ui/src/icons/index.tsx
@@ -4,3 +4,7 @@ export { default as LoadingDots } from "./loading-dots";
export { default as LoadingSpinner } from "./loading-spinner";
export { default as Logo } from "./logo";
export { default as LogoType } from "./logotype";
+export { default as Github } from "./github";
+export { default as LinkedIn } from "./linkedin";
+export { default as Twitter } from "./twitter";
+export { default as Unsplash } from "./unsplash";
diff --git a/packages/ui/src/icons/linkedin.tsx b/packages/ui/src/icons/linkedin.tsx
new file mode 100644
index 0000000000..bd02370314
--- /dev/null
+++ b/packages/ui/src/icons/linkedin.tsx
@@ -0,0 +1,22 @@
+export default function LinkedIn({
+ className,
+ fill = "#027ab5",
+}: {
+ className?: string;
+ fill?: string;
+}) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ className={className}
+ >
+ <path
+ fill={fill}
+ d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/twitter.tsx b/packages/ui/src/icons/twitter.tsx
new file mode 100644
index 0000000000..f65697a347
--- /dev/null
+++ b/packages/ui/src/icons/twitter.tsx
@@ -0,0 +1,31 @@
+import { cn } from "../lib/utils";
+
+export default function Twitter({ className }: { className?: string }) {
+ return (
+ <div className="group">
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 248 204"
+ className={cn("group-hover:hidden", className)}
+ >
+ <path
+ fill="currentColor"
+ d="M221.95 51.29c.15 2.17.15 4.34.15 6.53 0 66.73-50.8 143.69-143.69 143.69v-.04c-27.44.04-54.31-7.82-77.41-22.64 3.99.48 8 .72 12.02.73 22.74.02 44.83-7.61 62.72-21.66-21.61-.41-40.56-14.5-47.18-35.07 7.57 1.46 15.37 1.16 22.8-.87-23.56-4.76-40.51-25.46-40.51-49.5v-.64c7.02 3.91 14.88 6.08 22.92 6.32C11.58 63.31 4.74 33.79 18.14 10.71c25.64 31.55 63.47 50.73 104.08 52.76-4.07-17.54 1.49-35.92 14.61-48.25 20.34-19.12 52.33-18.14 71.45 2.19 11.31-2.23 22.15-6.38 32.07-12.26-3.77 11.69-11.66 21.62-22.2 27.93 10.01-1.18 19.79-3.86 29-7.95-6.78 10.16-15.32 19.01-25.2 26.16z"
+ />
+ </svg>
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 1668.56 1221.19"
+ className={cn("hidden scale-150 group-hover:block", className)}
+ >
+ <g transform="translate(52.390088,-25.058597)">
+ <path
+ fill="currentColor"
+ d="M283.94,167.31l386.39,516.64L281.5,1104h87.51l340.42-367.76L984.48,1104h297.8L874.15,558.3l361.92-390.99
+ h-87.51l-313.51,338.7l-253.31-338.7H283.94z M412.63,231.77h136.81l604.13,807.76h-136.81L412.63,231.77z"
+ />
+ </g>
+ </svg>
+ </div>
+ );
+}
diff --git a/packages/ui/src/icons/unsplash.tsx b/packages/ui/src/icons/unsplash.tsx
new file mode 100644
index 0000000000..ad04fc87d3
--- /dev/null
+++ b/packages/ui/src/icons/unsplash.tsx
@@ -0,0 +1,17 @@
+export default function Unsplash({ className }: { className?: string }) {
+ return (
+ <svg
+ width="32"
+ height="32"
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 32 32"
+ className={className}
+ >
+ <path
+ d="M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"
+ fill="currentColor"
+ fillRule="nonzero"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/index.tsx b/packages/ui/src/index.tsx
index 387ede5e89..cf696a9db7 100644
--- a/packages/ui/src/index.tsx
+++ b/packages/ui/src/index.tsx
@@ -4,7 +4,11 @@ import "./styles.css";
// components
export * from "./badge";
export * from "./button";
+export * from "./footer";
export * from "./icons";
+export * from "./max-width-wrapper";
+export * from "./nav";
+export * from "./nav-mobile";
export * from "./popover";
export * from "./switch";
export * from "./tooltip";
diff --git a/packages/ui/src/lib/constants/cctlds.ts b/packages/ui/src/lib/constants/cctlds.ts
new file mode 100644
index 0000000000..44ac32c872
--- /dev/null
+++ b/packages/ui/src/lib/constants/cctlds.ts
@@ -0,0 +1,276 @@
+const ccTLDs = new Set([
+ "af",
+ "ax",
+ "al",
+ "dz",
+ "as",
+ "ad",
+ "ao",
+ "ai",
+ "aq",
+ "ag",
+ "ar",
+ "am",
+ "aw",
+ "ac",
+ "au",
+ "at",
+ "az",
+ "bs",
+ "bh",
+ "bd",
+ "bb",
+ "eus",
+ "by",
+ "be",
+ "bz",
+ "bj",
+ "bm",
+ "bt",
+ "bo",
+ "bq",
+ "an",
+ "nl",
+ "ba",
+ "bw",
+ "bv",
+ "br",
+ "io",
+ "vg",
+ "bn",
+ "bg",
+ "bf",
+ "mm",
+ "bi",
+ "kh",
+ "cm",
+ "ca",
+ "cv",
+ "cat",
+ "ky",
+ "cf",
+ "td",
+ "cl",
+ "cn",
+ "cx",
+ "cc",
+ "co",
+ "km",
+ "cd",
+ "cg",
+ "ck",
+ "cr",
+ "ci",
+ "hr",
+ "cu",
+ "cw",
+ "cy",
+ "cz",
+ "dk",
+ "dj",
+ "dm",
+ "do",
+ "tl",
+ "tp",
+ "ec",
+ "eg",
+ "sv",
+ "gq",
+ "er",
+ "ee",
+ "et",
+ "eu",
+ "fk",
+ "fo",
+ "fm",
+ "fj",
+ "fi",
+ "fr",
+ "gf",
+ "pf",
+ "tf",
+ "ga",
+ "gal",
+ "gm",
+ "ps",
+ "ge",
+ "de",
+ "gh",
+ "gi",
+ "gr",
+ "gl",
+ "gd",
+ "gp",
+ "gu",
+ "gt",
+ "gg",
+ "gn",
+ "gw",
+ "gy",
+ "ht",
+ "hm",
+ "hn",
+ "hk",
+ "hu",
+ "is",
+ "in",
+ "id",
+ "ir",
+ "iq",
+ "ie",
+ "im",
+ "il",
+ "it",
+ "jm",
+ "jp",
+ "je",
+ "jo",
+ "kz",
+ "ke",
+ "ki",
+ "kw",
+ "kg",
+ "la",
+ "lv",
+ "lb",
+ "ls",
+ "lr",
+ "ly",
+ "li",
+ "lt",
+ "lu",
+ "mo",
+ "mk",
+ "mg",
+ "mw",
+ "my",
+ "mv",
+ "ml",
+ "mt",
+ "mh",
+ "mq",
+ "mr",
+ "mu",
+ "yt",
+ "mx",
+ "md",
+ "mc",
+ "mn",
+ "me",
+ "ms",
+ "ma",
+ "mz",
+ "mm",
+ "na",
+ "nr",
+ "np",
+ "nl",
+ "nc",
+ "nz",
+ "ni",
+ "ne",
+ "ng",
+ "nu",
+ "nf",
+ "nc",
+ "tr",
+ "kp",
+ "mp",
+ "no",
+ "om",
+ "pk",
+ "pw",
+ "ps",
+ "pa",
+ "pg",
+ "py",
+ "pe",
+ "ph",
+ "pn",
+ "pl",
+ "pt",
+ "pr",
+ "qa",
+ "ro",
+ "ru",
+ "rw",
+ "re",
+ "bq",
+ "an",
+ "bl",
+ "gp",
+ "fr",
+ "sh",
+ "kn",
+ "lc",
+ "mf",
+ "gp",
+ "fr",
+ "pm",
+ "vc",
+ "ws",
+ "sm",
+ "st",
+ "sa",
+ "sn",
+ "rs",
+ "sc",
+ "sl",
+ "sg",
+ "bq",
+ "an",
+ "nl",
+ "sx",
+ "an",
+ "sk",
+ "si",
+ "sb",
+ "so",
+ "so",
+ "za",
+ "gs",
+ "kr",
+ "ss",
+ "es",
+ "lk",
+ "sd",
+ "sr",
+ "sj",
+ "sz",
+ "se",
+ "ch",
+ "sy",
+ "tw",
+ "tj",
+ "tz",
+ "th",
+ "tg",
+ "tk",
+ "to",
+ "tt",
+ "tn",
+ "tr",
+ "tm",
+ "tc",
+ "tv",
+ "ug",
+ "ua",
+ "ae",
+ "uk",
+ "us",
+ "vi",
+ "uy",
+ "uz",
+ "vu",
+ "va",
+ "ve",
+ "vn",
+ "wf",
+ "eh",
+ "ma",
+ "ye",
+ "zm",
+ "zw",
+]);
+
+export default ccTLDs;
diff --git a/packages/ui/src/lib/constants/content.ts b/packages/ui/src/lib/constants/content.ts
new file mode 100644
index 0000000000..63f6212c63
--- /dev/null
+++ b/packages/ui/src/lib/constants/content.ts
@@ -0,0 +1,230 @@
+import { Airplay, BarChart, Link2, QrCode, Users } from "lucide-react";
+
+export const FEATURES_LIST = [
+ {
+ title: "Powerful Analytics For The Modern Marketer",
+ shortTitle: "Advanced Analytics",
+ accordionTitle: "Analytics that matter",
+ description:
+ "Dub provides powerful analytics for your links, including geolocation, device, browser, and referrer information.",
+ icon: BarChart,
+ slug: "analytics",
+ thumbnail: "https://d2vwwcvoksz7ty.cloudfront.net/features/analytics.png",
+ thumbnailBlurhash:
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE+0lEQVR4nL2Y63qiShBF5/2f8czkpjGCgoLQV+yzq6saGpVMYjznx/ok0JBa7GrQ/mWsC7fQhLE3MEEJl8eMteP51hH+L8g4e81SXUv8WhS5KFJpwlyhdSZicpGpYCf8VSgT+09EliQYPs5j3ZVIknA+41O5+9K5S6RXE0lEJZEok6Xhhwx/zaLU99L5lkguMJGOuyiiMxHnWMB/wi2py3TMF5L5skifiXQzbJTpIZJkpkQykWGBeHxJRtpLtn8s0pNILtGbcIrYSEcoJzIe53hcY2CRJCOFDxfM0xlGmVtz50EiNt79Too/dUxLn72LRBnlRWaYZPwZEsxwwf8iYpKItE+SaEWgOREu0naEx3EPoQEyQyZDBU8yudRcYrieJ9bHVr17sjOTCKWRJBpwhMShJdzIsfXY73GchI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klBMqWWpQyqw4WKrRuGuK/4UahpL55yYhtpWfj4vSdwSSSyIpDRYQilIKCUy/UyIkbYDbSdyHcOFqjkYk463PUNrAGlBo8/baXEN7SsicQVRi4jK6IPqM2bHcmk90gknyEdwvItgP67fC2Oxhlcvk4ReWBi8KXJl+ImIvkSrYCI6bjPYNowai1UZ2G8meKy5zeIK51zoX56UB7vUOlYfAAAAAElFTkSuQmCC",
+ videoUrl:
+ "https://www.youtube.com/embed/i05FamHTn_I?si=gRnWs5Kf2n6Qyqmd&autoplay=1",
+ videoLength: "2:56",
+ bentoTitle: "Detailed insights for every click",
+ bentoDescription:
+ "Dub provides detailed analytics for every click on your links. See where your audience is coming from and what devices they are using.",
+ bentoFeatures: [
+ {
+ title: "Time-series data",
+ description:
+ "See how your links are performing over time with a beautiful time-series chart.",
+ image:
+ "https://d2vwwcvoksz7ty.cloudfront.net/features/time-series-data.png",
+ },
+ {
+ title: "Geographic data",
+ description:
+ "Understand your audience with geographic data – on both a country and city level.",
+ image: "https://d2vwwcvoksz7ty.cloudfront.net/features/geo-data.png",
+ },
+ {
+ title: "Device data",
+ description:
+ "See what devices your audience is using to click on your links",
+ },
+ {
+ title: "Referrer data",
+ description:
+ "Understand which websites are driving the most traffic to your links.",
+ },
+ {
+ title: "404 monitoring",
+ description:
+ "Monitor your links for 404 errors and notifies you when they occur.",
+ },
+ ],
+ },
+ {
+ title: "Branded Links That Stand Out",
+ shortTitle: "Branded Links",
+ accordionTitle: "Use your own domain",
+ description:
+ "Dub offers free and unlimited custom domains on all plans for you to create branded links that stand out.",
+ icon: Airplay,
+ slug: "branded-links",
+ thumbnail:
+ "https://d2vwwcvoksz7ty.cloudfront.net/features/branded-links.png",
+ thumbnailBlurhash:
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAADYElEQVR4nMWY2XLDIAxF/f9/28QGs5myCSQBXtLM9OFO09axdXwlIVjccXjn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wxlYn7fb7L/LDQmuPkz48AAAAAElFTkSuQmCC",
+ videoUrl:
+ "https://www.youtube.com/embed/LbgvQxLVqq4?si=7_sJVXFZINPxbAdM&autoplay=1",
+ videoLength: "3:23",
+ bentoTitle: "Impress your audience with branded links",
+ bentoDescription:
+ "Create custom short links that match your brand and stand out from the crowd, with free and unlimited custom domains on all plans.",
+ bentoFeatures: [
+ {
+ title: "Unlimited custom domains",
+ description:
+ "Add as many custom domains as you want to your project at no extra cost.",
+ image: "https://d2vwwcvoksz7ty.cloudfront.net/features/domains.png",
+ href: "/help/article/how-to-add-custom-domain",
+ },
+ {
+ title: "Custom Social Media Cards",
+ description:
+ "Customize the title, description, and image of your links when shared on social media.",
+ image:
+ "https://d2vwwcvoksz7ty.cloudfront.net/features/social-cards.png",
+ href: "/help/article/how-to-create-link#custom-social-media-cards",
+ },
+ {
+ title: "Free SSL certificates",
+ description:
+ "Dub automatically provisions SSL certificates for your custom domains.",
+ },
+ {
+ title: "Link cloaking",
+ description:
+ "Hide your destination URL with link cloaking to make your links look cleaner.",
+ href: "/help/article/how-to-create-link#link-cloaking",
+ },
+ {
+ title: "Custom QR codes",
+ description:
+ "With Dub Pro, you can create branded QR codes for your links.",
+ href: "/features/qr-codes",
+ },
+ ],
+ },
+ {
+ title: "Free QR Code Generator",
+ shortTitle: "QR Codes",
+ accordionTitle: "Free QR Code Generator",
+ description:
+ "QR codes and short links are like peas in a pod. Dub offers free QR codes for every short link you create.",
+ icon: QrCode,
+ slug: "qr-codes",
+ thumbnail: "https://d2vwwcvoksz7ty.cloudfront.net/features/qr-codes.png",
+ thumbnailBlurhash:
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFvklEQVR4nL2Y23qaUBCF+/7v1CZpG1uTeD4jooIgCHISMb2arhnEIzbaNrmYD90aMv9ea2Y2flqnr5SsN9dFuqH1SeRrb/1t9v1XiZRjw/GL0tdft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bIa6fdRyC0FBd1Fp2pClTpgqrAYIADFcOVym6qVPmbMiBQ0hyladgYS4H6x3JdnlICsPwKE268MQ+5amNRTE4lNUMQq6qSPVtsGTIMeS3UA1aj0WBe4Z6hVr/XxvRFmCUCmFkBcHCJ9nIYjKJ2pkpyp8i4gm+1A5DkSYI5gShtz1IkuqrSgSq2Gon5pU/mpKUDlclPgqtUu6mNAPdhQVXV0LYBgI3hD9iB7VZL3BsmOKDzZQyl4E/ZiVVR1CpgRrKPgaNIDUAdWY4A2XjMEq6Gg0DXMER3HGotsAVkCJJTN+WCQA3tBFdtxpXtNpjMoM5VEu70hgAZQqC/Br7tdBaAqgCcodAMDESB2BuJvQaL4HOTWoXg1yNF5SwajLxbjDjbVTdntIZIdKJoknoeijAAxRnNAfegznLXmePByL4Lkavzjo+6l2OxUiaR7ZRZjGFbGgs2M2RyFbOI8ZaA1T3ehjaeihA4IVmM+d3BE8VBrfqG1TkGuBboS5FVa475Wkp0yHtoot2Qb6lhIkhXiOtA5oBRfDQCwEvx5rsbSD6Sd74t9PxT/5mnxepCDWtk/KfJzRSzquDmQ48FyC0maleIrq8BrDLFwMzX2ttqDrNMPBDl8WsyV4QbAzyl8xOf5wEAO7MNQfOVgAFYihzhW48+2usZefwVyCYaPMKwOzxoXCfOsyIMB2E45hNTGH211/mvj+jBOQa7+uXR9+pMQQLYwfMyIomMgTpihOHwOBsB6DlE0CI8T/3UhihX6DZrKi05GV59sAAAAAElFTkSuQmCC",
+ videoUrl:
+ "https://www.youtube.com/embed/fcWkUZoJJ7w?si=LKNOO67aL6Q-3xN4&autoplay=1",
+ videoLength: "1:07",
+ bentoTitle: "Gorgeous QR codes for your links",
+ bentoDescription:
+ "Create beautiful flyers and posters with QR codes for your links.",
+ },
+ {
+ title: "Personalize Your Short Links",
+ shortTitle: "Personalization",
+ accordionTitle: "Personalize Your Short links",
+ description:
+ "Customize your link's behavior with device targeting, geo targeting, link cloaking, and more.",
+ icon: Link2,
+ slug: "personalization",
+ thum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+/RVj5+y2//D4IhMmYFC/ZSZFYpoEBY4csjOOAhULh80mrVjb+pzCggH/wIjz9I7Ft520HfPlc8qCqhaRMRp6E322FtPPSHIFBGYwhxvEuCmEo+cMIn+UH9T7G88x123g7k7COqXHXM8mNIPwQT5gq9soU6YHxX9QBxMYPA9k3YSyDz/bOizyw916UcVTAIYQTx4TrTolRA2Gi69//7mioUc3s9SlepnFyZQDKCL9SDd541LVDla/GbfnB3395WbgdqvKtmQAAAABJRU5ErkJggg==",
+ videoUrl:
+ "https://www.youtube.com/embed/K2UdLK8k1I4?si=79hu5XSW9pSjODOm&autoplay=1",
+ videoLength: "2:25",
+ bentoTitle: "Optimize your links for every audience",
+ bentoDescription:
+ "Get the most out of every click by delivering the right experience to the right audience.",
+ bentoFeatures: [
+ {
+ title: "Device targeting",
+ description:
+ "Redirect your audience to different destinations based on their device type (e.g. iOS/Android).",
+ image:
+ "https://d2vwwcvoksz7ty.cloudfront.net/features/device-targeting.png",
+ href: "/help/article/how-to-create-link#device-targeting-ios--android",
+ },
+ {
+ title: "Geo targeting",
+ description:
+ "Redirect your audience to different destinations based on their country of origin.",
+ image:
+ "https://d2vwwcvoksz7ty.cloudfront.net/features/geo-targeting.png",
+ href: "/help/article/how-to-create-link#geo-targeting",
+ },
+ {
+ title: "Expiration dates",
+ description:
+ "Automatically disable your links after a certain date & time.",
+ href: "/help/article/how-to-create-link#expiration-date",
+ },
+ {
+ title: "Password protection",
+ description:
+ "Protect your links with passwords to prevent unauthorized access.",
+ href: "/help/article/how-to-create-link#password-protection",
+ },
+ {
+ title: "Link cloaking",
+ description:
+ "Hide your destination URL with link cloaking to make your links look cleaner.",
+ href: "/help/article/how-to-create-link#link-cloaking",
+ },
+ ],
+ },
+ // { title: "Programmatic Link Creation", shortTitle: "API", slug: "api" },
+ {
+ title: "Collaborate With Your Team",
+ shortTitle: "Team Collaboration",
+ accordionTitle: "Collaborate With Your Team",
+ description:
+ "Invite your teammates to collaborate on your links. For enterprises, Dub offers SAML SSO for better security.",
+ icon: Users,
+ slug: "collaboration",
+ thumbnail:
+ "https://d2vwwcvoksz7ty.cloudfront.net/features/collaboration.png",
+ thumbnailBlurhash:
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAdCAYAAADoxT9SAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE0UlEQVR4nM2YC3eiWBCE5///yIlRQN6vyxu0p6ovILLZTMzDXc+pg6AJ/VnVfYFf8g2v6/Uql8tl1TRNq8ZxvNP2s+X7/HvqK69f3wGxgOyLH4bhTW2hvgvmW0D2EEvBfd+/qbdg/hOQ5aQW4opiLijqBsFiu65TtW27UTcfvwfaw3wG6CGQPYB1wkJYgEE6FMiCGxTeNI2qrqH5/QJFoC3M00DuIS4rBH/NYRhXFxRCi6+lqqhqo1qPL0DWme9x5UMg70GwiH5xAQWyWGOMFGUpRVFInlO5brlf4jg/r2agxZnFlc/2yxdAFohBWhTD+BhTKUCW5ZKmmSRJInFMxbrlPo8TjEB0aYFhxL7S+A+B3ENMa2M3TatOlKXRIpMk1cLDKJIwDCWAuI2wz+Npms4wRqPGmP04yJsQu0jRDQtRKEQUxRIEofh+IOezv4r7BKJDdIZRW1zZxut5IPOYZbNaNxCpotTiothCsHDXO4vjepArLrYe9i1MpDGjK+yXLQj//2ca/iGQ26ide2N1o0JfFPilU0BEcvZ8cRxPTkdXjkdnleO4KwxdIzh7hfFin/w8yOW6cwMgHUCaDm40cMOgqFyiMBH/HIrrnBXi9eDI4XCCjnh/UhgXgHSLrqSIIZ2sq/qu4Xm+HwHRxW8Zt4AY4Ea/xMrUUuQASXIJgxhuBOKcznJ8deXwAoiX46rjK1w5eepYGETaTytI+0yQ8QbStYM0dSumrCXPjCQxQRI5u+E9yO8F5rQBCRQ6SbLng0wzyNAzVqOC1FUnpmgkTwESAcSfQY6+HA+evL4gWr8hbBmzE+AYO8YvCtEjACkRyxrxtCCjnucG8mGOx0DGLUizBykAkgIkEvcUoGi48kIYNPzBVYec41k8N5DAx3oSpZKluQ4KDgxOwKeBTOMFINMK0gCkKlopMkytuJQoyCXw4IpDGDjz6lvBIffki+dgbTlH+B4WRUQxz0rtMfYahwdje9mDfBDmQUf2IP0MUgPESBzClXMmvmthPMCoAMDI+V6s8UuiTLKk0CFRmUann714nJ4DMg1bkHEG6aTMEK+kkiSEK36uMHSGQL4bK0BwTjR6cZihNwodEKbA1XCFq+CWV8HjT4PIPLWuGq1RQSYFaSv0SdmLyeFKSlcsTBwUChQBSOVnOJbpQEhjC1EWlbrR1J0ODvbe9FwQuAKQvpmkrQFitq4AJsKaApgEMSNQjL7hew6DFH3EwVDklY5tuqGx6v4HII0ZFMRkdGWGgTMpgaJSxUGQJcZCYDAwUuoGhkXb9BZkuEWL53t0cr0Pcv1LtGYQxkthEDE6QyBGTYVBUFJ5o6O6Klt1gpEiBGPF/hgGe2swzSCXnwJZxu+4aXYFQcMv8TKYYAqjQuFafKsiQGVaXXuaup8hrBsWZLyBLK48sLp/AOTfxi9BAMHJZex6woIJsBedMGWjcbrBdHcw7BGuI9Pqyg3myyDX90AQiQWkJkjZasElldc3FVYEMcbC2GjxKQsfVvChhX0Cc+fK5fJQvB4EmWaQ5aKx11+XvzILVYii1qm0VUlh3JZlrdPKwjR3MP0MM+5gPhqvv4D88yHcclPFSLCIum71nsSCAKKo9P6Eq/aqwoq3w7y2MqaeHw01enliH9z1O1ceezz0B49+MX0EZnFXAAAAAElFTkSuQmCC",
+ videoUrl:
+ "https://www.youtube.com/embed/_m9RM8L6TOw?si=49_XIkQ7g-61dRtV&autoplay=1",
+ videoLength: "2:13",
+ bentoTitle: "Seamless collaboration for marketing teams",
+ bentoDescription:
+ "View and manage your team's links in one place, with fine-grained permissions and SAML SSO for enterprises.",
+ bentoFeatures: [
+ {
+ title: "Unlimited teammates",
+ description:
+ "All paid plans come with unlimited teammates, so you can work with your team without worrying about extra costs.",
+ image: "https://d2vwwcvoksz7ty.cloudfront.net/features/teammates.png",
+ href: "/help/article/how-to-invite-teammates",
+ },
+ {
+ title: "SAML SSO",
+ description:
+ "Dub offers SAML SSO for enterprises to provide better security and control over their projects.",
+ image: "https://d2vwwcvoksz7ty.cloudfront.net/features/saml.png",
+ href: "/help/category/saml-sso",
+ },
+ {
+ title: "Tags & comments",
+ description:
+ "Organize your links with tags and comments to provide context for your team.",
+ href: "/help/article/how-to-use-tags",
+ },
+ {
+ title: "Fine-grained permissions",
+ description:
+ "Enterprises on Dub can set role-based access controls (RBAC) to control who can create, edit, and delete links.",
+ },
+ {
+ title: "Team analytics",
+ description:
+ "See how your team is performing with team analytics, including link clicks and top referrers.",
+ },
+ ],
+ },
+];
diff --git a/packages/ui/src/lib/constants/countries.ts b/packages/ui/src/lib/constants/countries.ts
new file mode 100644
index 0000000000..d8b7f4faa8
--- /dev/null
+++ b/packages/ui/src/lib/constants/countries.ts
@@ -0,0 +1,254 @@
+const COUNTRIES: { [key: string]: string } = {
+ AF: "Afghanistan",
+ AL: "Albania",
+ DZ: "Algeria",
+ AS: "American Samoa",
+ AD: "Andorra",
+ AO: "Angola",
+ AI: "Anguilla",
+ AQ: "Antarctica",
+ AG: "Antigua and Barbuda",
+ AR: "Argentina",
+ AM: "Armenia",
+ AW: "Aruba",
+ AU: "Australia",
+ AT: "Austria",
+ AZ: "Azerbaijan",
+ BS: "Bahamas",
+ BH: "Bahrain",
+ BD: "Bangladesh",
+ BB: "Barbados",
+ BY: "Belarus",
+ BE: "Belgium",
+ BZ: "Belize",
+ BJ: "Benin",
+ BM: "Bermuda",
+ BT: "Bhutan",
+ BO: "Bolivia",
+ BA: "Bosnia and Herzegovina",
+ BW: "Botswana",
+ BV: "Bouvet Island",
+ BR: "Brazil",
+ IO: "British Indian Ocean Territory",
+ BN: "Brunei Darussalam",
+ BG: "Bulgaria",
+ BF: "Burkina Faso",
+ BI: "Burundi",
+ KH: "Cambodia",
+ CM: "Cameroon",
+ CA: "Canada",
+ CV: "Cape Verde",
+ KY: "Cayman Islands",
+ CF: "Central African Republic",
+ TD: "Chad",
+ CL: "Chile",
+ CN: "China",
+ CX: "Christmas Island",
+ CC: "Cocos (Keeling) Islands",
+ CO: "Colombia",
+ KM: "Comoros",
+ CG: "Congo (Republic)",
+ CD: "Congo (Democratic Republic)",
+ CK: "Cook Islands",
+ CR: "Costa Rica",
+ CI: "Ivory Coast",
+ HR: "Croatia",
+ CU: "Cuba",
+ CY: "Cyprus",
+ CZ: "Czech Republic",
+ DK: "Denmark",
+ DJ: "Djibouti",
+ DM: "Dominica",
+ DO: "Dominican Republic",
+ EC: "Ecuador",
+ EG: "Egypt",
+ SV: "El Salvador",
+ GQ: "Equatorial Guinea",
+ ER: "Eritrea",
+ EE: "Estonia",
+ ET: "Ethiopia",
+ FK: "Falkland Islands",
+ FO: "Faroe Islands",
+ FJ: "Fiji",
+ FI: "Finland",
+ FR: "France",
+ GF: "French Guiana",
+ PF: "French Polynesia",
+ TF: "French Southern Territories",
+ GA: "Gabon",
+ GM: "Gambia",
+ GE: "Georgia",
+ DE: "Germany",
+ GH: "Ghana",
+ GI: "Gibraltar",
+ GR: "Greece",
+ GL: "Greenland",
+ GD: "Grenada",
+ GP: "Guadeloupe",
+ GU: "Guam",
+ GT: "Guatemala",
+ GN: "Guinea",
+ GW: "Guinea-Bissau",
+ GY: "Guyana",
+ HT: "Haiti",
+ HM: "Heard Island and McDonald Islands",
+ VA: "Vatican City",
+ HN: "Honduras",
+ HK: "Hong Kong",
+ HU: "Hungary",
+ IS: "Iceland",
+ IN: "India",
+ ID: "Indonesia",
+ IR: "Iran",
+ IQ: "Iraq",
+ IE: "Ireland",
+ IL: "Israel",
+ IT: "Italy",
+ JM: "Jamaica",
+ JP: "Japan",
+ JO: "Jordan",
+ KZ: "Kazakhstan",
+ KE: "Kenya",
+ KI: "Kiribati",
+ KP: "North Korea",
+ KR: "South Korea",
+ KW: "Kuwait",
+ KG: "Kyrgyzstan",
+ LA: "Laos",
+ LV: "Latvia",
+ LB: "Lebanon",
+ LS: "Lesotho",
+ LR: "Liberia",
+ LY: "Libya",
+ LI: "Liechtenstein",
+ LT: "Lithuania",
+ LU: "Luxembourg",
+ MO: "Macao",
+ MG: "Madagascar",
+ MW: "Malawi",
+ MY: "Malaysia",
+ MV: "Maldives",
+ ML: "Mali",
+ MT: "Malta",
+ MH: "Marshall Islands",
+ MQ: "Martinique",
+ MR: "Mauritania",
+ MU: "Mauritius",
+ YT: "Mayotte",
+ MX: "Mexico",
+ FM: "Micronesia",
+ MD: "Moldova",
+ MC: "Monaco",
+ MN: "Mongolia",
+ MS: "Montserrat",
+ MA: "Morocco",
+ MZ: "Mozambique",
+ MM: "Myanmar",
+ NA: "Namibia",
+ NR: "Nauru",
+ NP: "Nepal",
+ NL: "Netherlands",
+ NC: "New Caledonia",
+ NZ: "New Zealand",
+ NI: "Nicaragua",
+ NE: "Niger",
+ NG: "Nigeria",
+ NU: "Niue",
+ NF: "Norfolk Island",
+ MK: "Macedonia",
+ MP: "Northern Mariana Islands",
+ NO: "Norway",
+ OM: "Oman",
+ PK: "Pakistan",
+ PW: "Palau",
+ PS: "Palestine",
+ PA: "Panama",
+ PG: "Papua New Guinea",
+ PY: "Paraguay",
+ PE: "Peru",
+ PH: "Philippines",
+ PN: "Pitcairn",
+ PL: "Poland",
+ PT: "Portugal",
+ PR: "Puerto Rico",
+ QA: "Qatar",
+ RE: "Reunion",
+ RO: "Romania",
+ RU: "Russia",
+ RW: "Rwanda",
+ SH: "Saint Helena",
+ KN: "Saint Kitts and Nevis",
+ LC: "Saint Lucia",
+ PM: "Saint Pierre and Miquelon",
+ VC: "Saint Vincent and the Grenadines",
+ WS: "Samoa",
+ SM: "San Marino",
+ ST: "Sao Tome and Principe",
+ SA: "Saudi Arabia",
+ SN: "Senegal",
+ SC: "Seychelles",
+ SL: "Sierra Leone",
+ SG: "Singapore",
+ SK: "Slovakia",
+ SI: "Slovenia",
+ SB: "Solomon Islands",
+ SO: "Somalia",
+ ZA: "South Africa",
+ GS: "South Georgia and the South Sandwich Islands",
+ ES: "Spain",
+ LK: "Sri Lanka",
+ SD: "Sudan",
+ SR: "Suriname",
+ SJ: "Svalbard and Jan Mayen",
+ SZ: "Eswatini",
+ SE: "Sweden",
+ CH: "Switzerland",
+ SY: "Syrian Arab Republic",
+ TW: "Taiwan",
+ TJ: "Tajikistan",
+ TZ: "Tanzania",
+ TH: "Thailand",
+ TL: "Timor-Leste",
+ TG: "Togo",
+ TK: "Tokelau",
+ TO: "Tonga",
+ TT: "Trinidad and Tobago",
+ TN: "Tunisia",
+ TR: "Türkiye",
+ TM: "Turkmenistan",
+ TC: "Turks and Caicos Islands",
+ TV: "Tuvalu",
+ UG: "Uganda",
+ UA: "Ukraine",
+ AE: "United Arab Emirates",
+ GB: "United Kingdom",
+ US: "United States",
+ UM: "United States Minor Outlying Islands",
+ UY: "Uruguay",
+ UZ: "Uzbekistan",
+ VU: "Vanuatu",
+ VE: "Venezuela",
+ VN: "Vietnam",
+ VG: "Virgin Islands, British",
+ VI: "Virgin Islands, U.S.",
+ WF: "Wallis and Futuna",
+ EH: "Western Sahara",
+ YE: "Yemen",
+ ZM: "Zambia",
+ ZW: "Zimbabwe",
+ AX: "Åland Islands",
+ BQ: "Bonaire, Sint Eustatius and Saba",
+ CW: "Curaçao",
+ GG: "Guernsey",
+ IM: "Isle of Man",
+ JE: "Jersey",
+ ME: "Montenegro",
+ BL: "Saint Barthélemy",
+ MF: "Saint Martin (French part)",
+ RS: "Serbia",
+ SX: "Sint Maarten (Dutch part)",
+ SS: "South Sudan",
+ XK: "Kosovo",
+};
+
+export default COUNTRIES;
diff --git a/packages/ui/src/lib/constants/index.ts b/packages/ui/src/lib/constants/index.ts
new file mode 100644
index 0000000000..c7de2a33ff
--- /dev/null
+++ b/packages/ui/src/lib/constants/index.ts
@@ -0,0 +1,145 @@
+export const LOCALHOST_GEO_DATA = {
+ city: "San Francisco",
+ region: "CA",
+ country: "US",
+ latitude: "37.7695",
+ longitude: "-122.385",
+};
+export const LOCALHOST_IP = "63.141.57.109";
+
+export const FRAMER_MOTION_LIST_ITEM_VARIANTS = {
+ hidden: { scale: 0.8, opacity: 0 },
+ show: { scale: 1, opacity: 1, transition: { type: "spring" } },
+};
+
+export const STAGGER_CHILD_VARIANTS = {
+ hidden: { opacity: 0, y: 20 },
+ show: { opacity: 1, y: 0, transition: { duration: 0.4, type: "spring" } },
+};
+
+export const SWIPE_REVEAL_ANIMATION_SETTINGS = {
+ initial: { height: 0 },
+ animate: { height: "auto" },
+ exit: { height: 0 },
+ transition: { duration: 0.15, ease: "easeOut" },
+};
+
+export const FADE_IN_ANIMATION_SETTINGS = {
+ initial: { opacity: 0 },
+ animate: { opacity: 1 },
+ exit: { opacity: 0 },
+ transition: { duration: 0.2 },
+};
+
+export const PAGINATION_LIMIT = 100;
+
+export const HOME_DOMAIN = "https://dub.co";
+
+export const APP_HOSTNAMES = new Set([
+ "app.dub.co",
+ "preview.dub.co",
+ "localhost:8888",
+ "localhost",
+]);
+
+export const APP_DOMAIN =
+ process.env.NEXT_PUBLIC_VERCEL_ENV === "production"
+ ? "https://app.dub.co"
+ : process.env.NEXT_PUBLIC_VERCEL_ENV === "preview"
+ ? "https://preview.dub.co"
+ : "http://localhost:8888";
+
+export const APP_DOMAIN_WITH_NGROK =
+ process.env.NEXT_PUBLIC_VERCEL_ENV === "production"
+ ? "https://app.dub.co"
+ : process.env.NEXT_PUBLIC_VERCEL_ENV === "preview"
+ ? "https://preview.dub.co"
+ : process.env.NGROK_URL;
+
+export const API_HOSTNAMES = new Set([
+ "api.dub.co",
+ "api.dub.sh",
+ "api.localhost:8888",
+]);
+
+export const API_DOMAIN =
+ process.env.NEXT_PUBLIC_VERCEL_ENV === "production"
+ ? "https://api.dub.co"
+ : process.env.NEXT_PUBLIC_VERCEL_ENV === "preview"
+ ? "https://api.dub.sh"
+ : "http://api.localhost:8888";
+
+export const ADMIN_HOSTNAMES = new Set([
+ "admin.dub.co",
+ "admin.localhost:8888",
+]);
+
+export const DEFAULT_REDIRECTS = {
+ home: "https://dub.co",
+ dub: "https://dub.co",
+ signin: "https://app.dub.co/login",
+ login: "https://app.dub.co/login",
+ register: "https://app.dub.co/register",
+ signup: "https://app.dub.co/register",
+ app: "https://app.dub.co",
+ dashboard: "https://app.dub.co",
+ links: "https://app.dub.co/links",
+ settings: "https://app.dub.co/settings",
+ welcome: "https://app.dub.co/welcome",
+ discord: "https://twitter.com/dubdotco", // placeholder for now
+ tags: "https://dub.co/help/how-to-use-tags",
+};
+
+export const DUB_HEADERS = {
+ headers: {
+ "x-powered-by": "Dub.co - Link management for modern marketing teams",
+ },
+};
+
+export const FAVICON_FOLDER = "/_static/favicons";
+export const GOOGLE_FAVICON_URL =
+ "https://www.google.com/s2/favicons?sz=64&domain_url=";
+
+export const DUB_LOGO = "https://d2vwwcvoksz7ty.cloudfront.net/logo.png";
+export const DUB_THUMBNAIL =
+ "https://d2vwwcvoksz7ty.cloudfront.net/thumbnail.png";
+
+export const SHOW_BACKGROUND_SEGMENTS = [
+ "tools",
+ "pricing",
+ "help",
+ "features",
+ "customers",
+ "blog",
+ "(blog-post)",
+ "login",
+ "register",
+ "auth",
+];
+
+export const allTools = ["metatags", "inspector"];
+
+export { default as COUNTRIES } from "./countries";
+export { default as ccTLDs } from "./cctlds";
+
+export const SECOND_LEVEL_DOMAINS = new Set([
+ "com",
+ "co",
+ "net",
+ "org",
+ "edu",
+ "gov",
+ "in",
+]);
+
+export const SPECIAL_APEX_DOMAINS = new Set([
+ "my.id",
+ "github.io",
+ "vercel.app",
+ "now.sh",
+ "pages.dev",
+ "webflow.io",
+ "netlify.app",
+ "fly.dev",
+ "web.app",
+]);
diff --git a/packages/ui/src/lib/hooks/use-current-anchor.ts b/packages/ui/src/lib/hooks/use-current-anchor.ts
new file mode 100644
index 0000000000..59764a3fe5
--- /dev/null
+++ b/packages/ui/src/lib/hooks/use-current-anchor.ts
@@ -0,0 +1,65 @@
+import { useEffect, useState } from "react";
+
+export default function useCurrentAnchor() {
+ const [currentAnchor, setCurrentAnchor] = useState<string | null>(null);
+
+ useEffect(() => {
+ const mdxContainer: HTMLElement | null = document.querySelector(
+ "[data-mdx-container]",
+ );
+ if (!mdxContainer) return;
+
+ const offsetTop = mdxContainer.offsetTop - 1;
+
+ const observer = new IntersectionObserver(
+ (entries) => {
+ let currentEntry = entries[0];
+ if (!currentEntry) return;
+
+ const offsetBottom =
+ (currentEntry.rootBounds?.height || 0) * 0.3 + offsetTop;
+
+ for (let i = 1; i < entries.length; i++) {
+ const entry = entries[i];
+ if (!entry) break;
+
+ if (
+ entry.boundingClientRect.top <
+ currentEntry.boundingClientRect.top ||
+ currentEntry.boundingClientRect.bottom < offsetTop
+ ) {
+ currentEntry = entry;
+ }
+ }
+
+ let target: Element | undefined = currentEntry.target;
+
+ // if the target is too high up, we need to find the next sibling
+ while (target && target.getBoundingClientRect().bottom < offsetTop) {
+ target = siblings.get(target)?.next;
+ }
+
+ // if the target is too low, we need to find the previous sibling
+ while (target && target.getBoundingClientRect().top > offsetBottom) {
+ target = siblings.get(target)?.prev;
+ }
+ if (target) setCurrentAnchor(target.getAttribute("href"));
+ },
+ {
+ threshold: 1,
+ rootMargin: `-${offsetTop}px 0px 0px 0px`,
+ },
+ );
+
+ const siblings = new Map();
+
+ const anchors = mdxContainer?.querySelectorAll("[data-mdx-heading]");
+ anchors.forEach((anchor) => observer.observe(anchor));
+
+ return () => {
+ observer.disconnect();
+ };
+ }, []);
+
+ return currentAnchor?.replace("#", "");
+}
diff --git a/packages/ui/src/lib/hooks/use-intersection-observer.ts b/packages/ui/src/lib/hooks/use-intersection-observer.ts
new file mode 100644
index 0000000000..2d198c59ab
--- /dev/null
+++ b/packages/ui/src/lib/hooks/use-intersection-observer.ts
@@ -0,0 +1,43 @@
+import { RefObject, useEffect, useState } from "react";
+
+interface Args extends IntersectionObserverInit {
+ freezeOnceVisible?: boolean;
+}
+
+function useIntersectionObserver(
+ elementRef: RefObject<Element>,
+ {
+ threshold = 0,
+ root = null,
+ rootMargin = "0%",
+ freezeOnceVisible = false,
+ }: Args,
+): IntersectionObserverEntry | undefined {
+ const [entry, setEntry] = useState<IntersectionObserverEntry>();
+
+ const frozen = entry?.isIntersecting && freezeOnceVisible;
+
+ const updateEntry = ([entry]: IntersectionObserverEntry[]): void => {
+ setEntry(entry);
+ };
+
+ useEffect(() => {
+ const node = elementRef?.current; // DOM Ref
+ const hasIOSupport = !!window.IntersectionObserver;
+
+ if (!hasIOSupport || frozen || !node) return;
+
+ const observerParams = { threshold, root, rootMargin };
+ const observer = new IntersectionObserver(updateEntry, observerParams);
+
+ observer.observe(node);
+
+ return () => observer.disconnect();
+
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [elementRef, JSON.stringify(threshold), root, rootMargin, frozen]);
+
+ return entry;
+}
+
+export default useIntersectionObserver;
diff --git a/packages/ui/src/lib/hooks/use-local-storage.ts b/packages/ui/src/lib/hooks/use-local-storage.ts
new file mode 100644
index 0000000000..aa3984b597
--- /dev/null
+++ b/packages/ui/src/lib/hooks/use-local-storage.ts
@@ -0,0 +1,26 @@
+import { useEffect, useState } from "react";
+
+const useLocalStorage = <T>(
+ key: string,
+ initialValue: T,
+): [T, (value: T) => void] => {
+ const [storedValue, setStoredValue] = useState(initialValue);
+
+ useEffect(() => {
+ // Retrieve from localStorage
+ const item = window.localStorage.getItem(key);
+ if (item) {
+ setStoredValue(JSON.parse(item));
+ }
+ }, [key]);
+
+ const setValue = (value: T) => {
+ // Save state
+ setStoredValue(value);
+ // Save to localStorage
+ window.localStorage.setItem(key, JSON.stringify(value));
+ };
+ return [storedValue, setValue];
+};
+
+export default useLocalStorage;
diff --git a/packages/ui/src/lib/hooks/use-scroll.ts b/packages/ui/src/lib/hooks/use-scroll.ts
new file mode 100644
index 0000000000..511fb9984c
--- /dev/null
+++ b/packages/ui/src/lib/hooks/use-scroll.ts
@@ -0,0 +1,21 @@
+import { useCallback, useEffect, useState } from "react";
+
+export default function useScroll(threshold: number) {
+ const [scrolled, setScrolled] = useState(false);
+
+ const onScroll = useCallback(() => {
+ setScrolled(window.scrollY > threshold);
+ }, [threshold]);
+
+ useEffect(() => {
+ window.addEventListener("scroll", onScroll);
+ return () => window.removeEventListener("scroll", onScroll);
+ }, [onScroll]);
+
+ // also check on first load
+ useEffect(() => {
+ onScroll();
+ }, [onScroll]);
+
+ return scrolled;
+}
diff --git a/apps/web/components/shared/max-width-wrapper.tsx b/packages/ui/src/max-width-wrapper.tsx
similarity index 78%
rename from apps/web/components/shared/max-width-wrapper.tsx
rename to packages/ui/src/max-width-wrapper.tsx
index 605d7d6497..9f3d9e7ab4 100644
--- a/apps/web/components/shared/max-width-wrapper.tsx
+++ b/packages/ui/src/max-width-wrapper.tsx
@@ -1,7 +1,7 @@
-import { cn } from "#/lib/utils";
+import { cn } from "./lib/utils";
import { ReactNode } from "react";
-export default function MaxWidthWrapper({
+export function MaxWidthWrapper({
className,
children,
}: {
diff --git a/apps/web/app/ui/home/nav-mobile.tsx b/packages/ui/src/nav-mobile.tsx
similarity index 70%
rename from apps/web/app/ui/home/nav-mobile.tsx
rename to packages/ui/src/nav-mobile.tsx
index fd652341c8..76e98679b6 100644
--- a/apps/web/app/ui/home/nav-mobile.tsx
+++ b/packages/ui/src/nav-mobile.tsx
@@ -1,20 +1,16 @@
"use client";
-import { APP_DOMAIN } from "#/lib/constants";
+import { APP_DOMAIN } from "./lib/constants";
import Link from "next/link";
import { useParams } from "next/navigation";
import { navItems } from "./nav";
-import { useSession } from "next-auth/react";
-import { FEATURES_LIST } from "#/lib/constants/content";
-import { cn } from "#/lib/utils";
+import { FEATURES_LIST } from "./lib/constants/content";
+import { cn } from "./lib/utils";
import { useState } from "react";
import { ChevronDown, Menu, X } from "lucide-react";
-export default function MobileNav() {
+export function NavMobile() {
const { domain = "dub.co" } = useParams() as { domain: string };
- const { data: session, status } = useSession() || {
- status: "unauthenticated", // if `useSession` is undefined, we're on a non dub.co domain
- };
const [open, setOpen] = useState(false);
const [openFeatures, setOpenFeatures] = useState(false);
@@ -89,36 +85,23 @@ export default function MobileNav() {
</li>
))}
- {session ? (
- <li className="py-3">
- <Link
- href={APP_DOMAIN}
- className="flex w-full font-semibold capitalize"
- >
- Dashboard
- </Link>
- </li>
- ) : status === "unauthenticated" ? (
- <>
- <li className="py-3">
- <Link
- href={`${APP_DOMAIN}/login`}
- className="flex w-full font-semibold capitalize"
- >
- Log in
- </Link>
- </li>
+ <li className="py-3">
+ <Link
+ href={`${APP_DOMAIN}/login`}
+ className="flex w-full font-semibold capitalize"
+ >
+ Log in
+ </Link>
+ </li>
- <li className="py-3">
- <Link
- href={`${APP_DOMAIN}/register`}
- className="flex w-full font-semibold capitalize"
- >
- Sign Up
- </Link>
- </li>
- </>
- ) : null}
+ <li className="py-3">
+ <Link
+ href={`${APP_DOMAIN}/register`}
+ className="flex w-full font-semibold capitalize"
+ >
+ Sign Up
+ </Link>
+ </li>
</ul>
</nav>
</>
diff --git a/apps/web/app/ui/home/nav.tsx b/packages/ui/src/nav.tsx
similarity index 73%
rename from apps/web/app/ui/home/nav.tsx
rename to packages/ui/src/nav.tsx
index 4d39ff6889..5977aae0fe 100644
--- a/apps/web/app/ui/home/nav.tsx
+++ b/packages/ui/src/nav.tsx
@@ -3,15 +3,14 @@
import Link from "next/link";
import { useParams, useSelectedLayoutSegment } from "next/navigation";
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
-import useScroll from "#/lib/hooks/use-scroll";
-import { cn } from "#/lib/utils";
-import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
-import { APP_DOMAIN, SHOW_BACKGROUND_SEGMENTS } from "#/lib/constants";
+import useScroll from "./lib/hooks/use-scroll";
+import { cn } from "./lib/utils";
+import { MaxWidthWrapper } from "./max-width-wrapper";
+import { APP_DOMAIN, SHOW_BACKGROUND_SEGMENTS } from "./lib/constants";
+import { FEATURES_LIST } from "./lib/constants/content";
import va from "@vercel/analytics";
import { ChevronDown } from "lucide-react";
-import { LogoType } from "ui";
-import { useSession } from "next-auth/react";
-import { FEATURES_LIST } from "#/lib/constants/content";
+import { LogoType } from "./icons";
export const navItems = [
{
@@ -32,18 +31,11 @@ export const navItems = [
},
];
-export default function Nav() {
+export function Nav() {
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.co"
- ? useSession()
- : {
- data: null,
- status: "unauthenticated", // if `useSession` is undefined, we're on a non dub.co domain
- };
return (
<div
@@ -101,7 +93,7 @@ export default function Nav() {
>
Features
</p>
- <ChevronDown className="group-data-[state=open]:rotate-180 h-4 w-4 transition-all" />
+ <ChevronDown className="h-4 w-4 transition-all group-data-[state=open]:rotate-180" />
</NavigationMenuPrimitive.Trigger>
<NavigationMenuPrimitive.Content>
@@ -130,7 +122,7 @@ export default function Nav() {
{feature.shortTitle}
</p>
</div>
- <p className="line-clamp-1 mt-1 text-sm text-gray-500">
+ <p className="mt-1 line-clamp-1 text-sm text-gray-500">
{feature.title}
</p>
</Link>
@@ -176,45 +168,34 @@ export default function Nav() {
</div>
<div className="hidden lg:block">
- {session ? (
- <Link
- href={APP_DOMAIN}
- className="animate-fade-in rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"
- >
- Dashboard
- </Link>
- ) : status === "unauthenticated" ? (
- <>
- <Link
- href={`${APP_DOMAIN}/login`}
- {...(domain !== "dub.co" && {
- onClick: () => {
- va.track("Referred from custom domain", {
- domain,
- medium: `navbar item (login)`,
- });
- },
- })}
- className="animate-fade-in rounded-full px-4 py-1.5 text-sm font-medium text-gray-500 transition-colors ease-out hover:text-black"
- >
- Log in
- </Link>
- <Link
- href={`${APP_DOMAIN}/register`}
- {...(domain !== "dub.co" && {
- onClick: () => {
- va.track("Referred from custom domain", {
- domain,
- medium: `navbar item (signup)`,
- });
- },
- })}
- className="animate-fade-in rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"
- >
- Sign Up
- </Link>
- </>
- ) : null}
+ <Link
+ href={`${APP_DOMAIN}/login`}
+ {...(domain !== "dub.co" && {
+ onClick: () => {
+ va.track("Referred from custom domain", {
+ domain,
+ medium: `navbar item (login)`,
+ });
+ },
+ })}
+ className="animate-fade-in rounded-full px-4 py-1.5 text-sm font-medium text-gray-500 transition-colors ease-out hover:text-black"
+ >
+ Log in
+ </Link>
+ <Link
+ href={`${APP_DOMAIN}/register`}
+ {...(domain !== "dub.co" && {
+ onClick: () => {
+ va.track("Referred from custom domain", {
+ domain,
+ medium: `navbar item (signup)`,
+ });
+ },
+ })}
+ className="animate-fade-in rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"
+ >
+ Sign Up
+ </Link>
</div>
</div>
</MaxWidthWrapper>
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4860775dea..982b93b04d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -368,6 +368,9 @@ importers:
packages/ui:
dependencies:
+ '@radix-ui/react-navigation-menu':
+ specifier: ^1.1.2
'@radix-ui/react-popover':
specifier: 1.0.5
@@ -377,12 +380,21 @@ importers:
'@radix-ui/react-tooltip':
specifier: ^1.0.2
+ '@vercel/analytics':
+ specifier: ^1.0.0
+ version: 1.0.0([email protected])
class-variance-authority:
specifier: ^0.7.0
version: 0.7.0
clsx:
specifier: ^1.2.1
version: 1.2.1
+ lucide-react:
+ specifier: ^0.269.0
+ version: 0.269.0([email protected])
+ next:
+ specifier: 13.5.5-canary.4
+ version: 13.5.5-canary.4(@babel/[email protected])(@opentelemetry/[email protected])([email protected])([email protected])
tailwind-merge:
specifier: ^1.13.2
version: 1.13.2