The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Optimized Mobile Design
Steven Tey2bfcf9bd0a45
diff --git a/components/app/link-card.tsx b/components/app/link-card.tsxindex a99da24c61..63d9c45971 100644--- a/components/app/link-card.tsx+++ b/components/app/link-card.tsx@@ -40,78 +40,82 @@ export default function LinkCard({ props }: { props: LinkProps }) {});return (- <li className="flex flex-col sm:flex-row justify-between items-start sm:items-center space-y-5 sm:space-y-0 border border-gray-200 bg-white p-4 rounded-md transition-all">+ <><AddEditLinkModal /><DeleteLinkModal />- <div className="relative flex items-center space-x-4">- <BlurImage- src={`https://logo.clearbit.com/${urlHostname}`}- alt={urlHostname}- className="w-10 h-10 rounded-full border border-gray-200"- width={20}- height={20}- />- <div>- <div className="flex items-center space-x-2">- <a- className="text-blue-800 font-semibold"- href={linkConstructor({ key, domain })}- target="_blank"- rel="noreferrer"- >- {linkConstructor({ key, domain, pretty: true })}- </a>- <CopyButton url={linkConstructor({ key, domain })} />- <Link href={`${router.asPath}/${encodeURI(key)}`}>- <a className="flex items-center space-x-1 rounded-md bg-gray-100 px-2 py-0.5 hover:scale-105 active:scale-95 transition-all duration-75">- <Chart className="w-4 h-4" />- <p className="text-sm text-gray-500">- {isValidating || !clicks ? (- <LoadingDots color="#71717A" />- ) : (- nFormatter(parseInt(clicks))- )}{" "}- clicks- </p>+ <li className="flex flex-col sm:flex-row justify-between items-start sm:items-center space-y-5 sm:space-y-0 border border-gray-200 bg-white p-4 rounded-md transition-all">+ <div className="relative flex items-center space-x-4">+ <BlurImage+ src={`https://logo.clearbit.com/${urlHostname}`}+ alt={urlHostname}+ className="w-10 h-10 rounded-full border border-gray-200"+ width={20}+ height={20}+ />+ <div>+ <div className="flex items-center space-x-2">+ <a+ className="text-blue-800 text-sm sm:text-base font-semibold truncate w-40 sm:w-full"+ href={linkConstructor({ key, domain })}+ target="_blank"+ rel="noreferrer"+ >+ {linkConstructor({ key, domain, pretty: true })}</a>- </Link>+ <CopyButton url={linkConstructor({ key, domain })} />+ <Link href={`${router.asPath}/${encodeURI(key)}`}>+ <a className="flex items-center space-x-1 rounded-md bg-gray-100 px-2 py-0.5 hover:scale-105 active:scale-95 transition-all duration-75">+ <Chart className="w-4 h-4" />+ <p className="text-sm text-gray-500 whitespace-nowrap">+ {isValidating || !clicks ? (+ <LoadingDots color="#71717A" />+ ) : (+ nFormatter(parseInt(clicks))+ )}{" "}+ clicks+ </p>+ </a>+ </Link>+ </div>+ <h3 className="text-sm font-medium text-gray-700 line-clamp-1">+ {title}+ </h3></div>- <h3 className="text-sm font-medium text-gray-700 line-clamp-1">- {title}- </h3></div>- </div>- <div className="flex items-center space-x-3">- <p className="text-sm text-gray-500">Added {timeAgo(timestamp)}</p>- {exceededUsage ? (- <Tooltip- content={- <TooltipContent- title="You have exceeded your usage limit. We're still collecting data on your existing links, but you need to upgrade to edit them."- cta="Upgrade"- ctaLink={`/${slug}/settings`}- />- }- >- <div className="text-gray-300 cursor-not-allowed font-medium text-sm px-5 py-2 border rounded-md border-gray-200 transition-all duration-75">+ <div className="flex items-center space-x-3 w-full sm:w-auto">+ <p className="text-sm hidden sm:block text-gray-500">+ Added {timeAgo(timestamp)}+ </p>+ {exceededUsage ? (+ <Tooltip+ content={+ <TooltipContent+ title="You have exceeded your usage limit. We're still collecting data on your existing links, but you need to upgrade to edit them."+ cta="Upgrade"+ ctaLink={`/${slug}/settings`}+ />+ }+ >+ <div className="grow text-gray-300 cursor-not-allowed font-medium text-sm px-5 py-1.5 sm:py-2 border rounded-md border-gray-200 transition-all duration-75">+ Edit+ </div>+ </Tooltip>+ ) : (+ <button+ onClick={() => setShowAddEditLinkModal(true)}+ className="grow sm:grow-0 font-medium text-sm text-gray-500 px-5 py-1.5 sm:py-2 border rounded-md border-gray-200 hover:border-black active:scale-95 transition-all duration-75"+ >Edit- </div>- </Tooltip>- ) : (+ </button>+ )}<button- onClick={() => setShowAddEditLinkModal(true)}- className="font-medium text-sm text-gray-500 px-5 py-2 border rounded-md border-gray-200 hover:border-black active:scale-95 transition-all duration-75"+ onClick={() => setShowDeleteLinkModal(true)}+ className="grow sm:grow-0 font-medium text-sm text-white bg-red-600 hover:bg-white hover:text-red-600 border-red-600 px-5 py-1.5 sm:py-2 border rounded-md active:scale-95 transition-all duration-75">- Edit+ Delete</button>- )}- <button- onClick={() => setShowDeleteLinkModal(true)}- className="font-medium text-sm text-white bg-red-600 hover:bg-white hover:text-red-600 border-red-600 px-5 py-2 border rounded-md active:scale-95 transition-all duration-75"- >- Delete- </button>- </div>- </li>+ </div>+ </li>+ </>);}diff --git a/components/app/modals/add-edit-link-modal.tsx b/components/app/modals/add-edit-link-modal.tsxindex 11a2921ba8..1b9959a046 100644--- a/components/app/modals/add-edit-link-modal.tsx+++ b/components/app/modals/add-edit-link-modal.tsx@@ -145,7 +145,7 @@ function AddEditLinkModal({showModal={showAddEditLinkModal}setShowModal={setShowAddEditLinkModal}>- <div className="inline-block w-full max-w-md overflow-hidden align-middle transition-all transform bg-white shadow-xl rounded-2xl">+ <div className="inline-block w-full sm:max-w-md overflow-hidden align-middle transition-all transform bg-white sm:border sm:border-gray-200 shadow-xl sm:rounded-2xl"><div className="flex flex-col justify-center items-center space-y-3 sm:px-16 px-4 pt-8 py-4 border-b border-gray-200"><BlurImagesrc={heroProps.avatar}@@ -205,7 +205,7 @@ function AddEditLinkModal({</button></div><div className="relative flex mt-1 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">+ <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 whitespace-nowrap">{domain || "dub.sh"}</span><inputdiff --git a/components/app/modals/add-project-modal.tsx b/components/app/modals/add-project-modal.tsxindex be54971a59..97bb99edb7 100644--- a/components/app/modals/add-project-modal.tsx+++ b/components/app/modals/add-project-modal.tsx@@ -78,7 +78,7 @@ function AddProjectModalHelper({showModal={showAddProjectModal}setShowModal={setShowAddProjectModal}>- <div className="inline-block w-full max-w-md overflow-hidden align-middle transition-all transform bg-white shadow-xl rounded-2xl">+ <div className="inline-block w-full sm:max-w-md overflow-hidden align-middle transition-all transform bg-white sm:border sm:border-gray-200 shadow-xl sm:rounded-2xl"><div className="flex flex-col justify-center items-center space-y-3 sm:px-16 px-4 pt-8 py-4 border-b border-gray-200"><BlurImagesrc={`/static/logo.png`}diff --git a/components/app/modals/delete-link-modal.tsx b/components/app/modals/delete-link-modal.tsxindex 62dcf6b2ce..5489f0a73b 100644--- a/components/app/modals/delete-link-modal.tsx+++ b/components/app/modals/delete-link-modal.tsx@@ -10,7 +10,6 @@ import {import { useRouter } from "next/router";import BlurImage from "@/components/shared/blur-image";import LoadingDots from "@/components/shared/icons/loading-dots";-import { AlertCircleFill } from "@/components/shared/icons";import { linkConstructor } from "@/lib/utils";import { mutate } from "swr";import useProject from "@/lib/swr/use-project";@@ -44,7 +43,7 @@ function DeleteLinkModal({showModal={showDeleteLinkModal}setShowModal={setShowDeleteLinkModal}>- <div className="inline-block w-full max-w-md overflow-hidden align-middle transition-all transform bg-white shadow-xl rounded-2xl">+ <div className="inline-block w-full sm:max-w-md overflow-hidden align-middle transition-all transform bg-white sm:border sm:border-gray-200 shadow-xl sm:rounded-2xl"><div className="flex flex-col justify-center items-center space-y-3 sm:px-16 px-4 pt-8 py-4 border-b border-gray-200"><BlurImagesrc={`https://logo.clearbit.com/${urlHostname}`}diff --git a/components/app/modals/delete-project-modal.tsx b/components/app/modals/delete-project-modal.tsxindex a20f202b27..5d20e61eee 100644--- a/components/app/modals/delete-project-modal.tsx+++ b/components/app/modals/delete-project-modal.tsx@@ -30,7 +30,7 @@ function DeleteProjectModal({showModal={showDeleteProjectModal}setShowModal={setShowDeleteProjectModal}>- <div className="inline-block w-full max-w-md overflow-hidden align-middle transition-all transform bg-white shadow-xl rounded-2xl">+ <div className="inline-block w-full sm:max-w-md overflow-hidden align-middle transition-all transform bg-white sm:border sm:border-gray-200 shadow-xl sm:rounded-2xl"><div className="flex flex-col justify-center items-center space-y-3 sm:px-16 px-4 pt-8 py-4 border-b border-gray-200"><BlurImagesrc={`https://logo.clearbit.com/${domain}`}diff --git a/components/app/modals/edit-domain-modal.tsx b/components/app/modals/edit-domain-modal.tsxindex 5aa63ccd7d..48b56262e7 100644--- a/components/app/modals/edit-domain-modal.tsx+++ b/components/app/modals/edit-domain-modal.tsx@@ -49,7 +49,7 @@ function EditDomainModal({showModal={showEditDomainModal}setShowModal={setShowEditDomainModal}>- <div className="inline-block w-full max-w-md overflow-hidden align-middle transition-all transform bg-white shadow-xl rounded-2xl">+ <div className="inline-block w-full sm:max-w-md overflow-hidden align-middle transition-all transform bg-white sm:border sm:border-gray-200 shadow-xl sm:rounded-2xl"><div className="flex flex-col justify-center items-center space-y-3 sm:px-16 px-4 pt-8 py-4 border-b border-gray-200"><BlurImagesrc={`https://logo.clearbit.com/${domain}`}diff --git a/components/stats/stats-modal.tsx b/components/app/modals/stats-modal.tsxsimilarity index 76%rename from components/stats/stats-modal.tsxrename to components/app/modals/stats-modal.tsxindex 05d94b496f..31bb9d7c11 100644--- a/components/stats/stats-modal.tsx+++ b/components/app/modals/stats-modal.tsx@@ -6,7 +6,7 @@ import {Dispatch,SetStateAction,} from "react";-import Stats from ".";+import Stats from "@/components/stats";import { UIEvent } from "react";import { useRouter } from "next/router";import { X } from "@/components/shared/icons";@@ -30,14 +30,18 @@ function StatsModalHelper({};return (- <Modal showModal={showStatsModal} setShowModal={setShowStatsModal}>+ <Modal+ showModal={showStatsModal}+ setShowModal={setShowStatsModal}+ bgColor="bg-gray-50"+ ><divonScroll={handleScroll}- className="inline-block w-full max-w-screen-xl max-h-[calc(100vh-100px)] overflow-scroll scrollbar-hide bg-gray-50- align-middle transform border border-gray-200 shadow-xl rounded-2xl"+ className="inline-block w-full max-w-screen-xl max-h-[calc(100vh-150px)] overflow-scroll scrollbar-hide bg-gray-50+ align-middle transform sm:border sm:border-gray-200 shadow-xl sm:rounded-2xl"><button- className="sticky top-4 z-20 p-3 m-4 rounded-full float-right group hover:bg-gray-100 focus:outline-none active:scale-75 transition-all duration-75"+ className="hidden sm:block sticky top-4 z-30 p-3 m-4 rounded-full float-right group hover:bg-gray-100 focus:outline-none active:scale-75 transition-all duration-75"autoFocus={false}onClick={() => {router.push("/", undefined, { scroll: false });diff --git a/components/home/link-card.tsx b/components/home/link-card.tsxindex 077d89a6b9..1afca29a0d 100644--- a/components/home/link-card.tsx+++ b/components/home/link-card.tsx@@ -61,7 +61,6 @@ export default function LinkCard({? -parentWidth / 2 - childWidth / 2: parentWidth / 2 + childWidth / 2;};- console.log("velocity", velocity, "direction", direction);if (direction && Math.abs(velocity) > min) {console.log("flying away");setConstrained(false);diff --git a/components/layout/app/index.tsx b/components/layout/app/index.tsxindex ceb347ad35..ce0182eef9 100644--- a/components/layout/app/index.tsx+++ b/components/layout/app/index.tsx@@ -37,7 +37,7 @@ export default function AppLayout({ children }: { children: ReactNode }) {<div className="min-h-screen w-full bg-gray-50"><div className="sticky top-0 left-0 right-0 border-b bg-white border-gray-200 z-20"><div className="max-w-screen-xl mx-auto px-2.5 sm:px-20">- <div className="h-10 flex justify-between items-center my-3">+ <div className="h-16 flex justify-between items-center"><div className="flex items-center"><Link href="/"><a>diff --git a/components/layout/app/list-box.tsx b/components/layout/app/list-box.tsxindex 0d2db23d6c..3afd595f81 100644--- a/components/layout/app/list-box.tsx+++ b/components/layout/app/list-box.tsx@@ -61,7 +61,7 @@ export default function ListBox() {width={48}height={48}/>- <span className="block truncate font-medium">+ <span className="block truncate font-medium text-sm">{selected.name}</span></div>@@ -98,7 +98,7 @@ export default function ListBox() {height={48}/><span- className={`block truncate ${+ className={`block truncate text-sm ${selected.slug === slug ? "font-medium" : "font-normal"}`}>diff --git a/components/shared/badge-select.tsx b/components/shared/badge-select.tsxindex 93083464ac..378ee310c8 100644--- a/components/shared/badge-select.tsx+++ b/components/shared/badge-select.tsx@@ -16,7 +16,7 @@ export default function BadgeSelect({option === selected? "bg-gray-200 text-gray-800": "bg-gray-50 hover:bg-gray-100 text-gray-600"- } px-3 py-1 rounded-md text-sm font-medium capitalize active:scale-90 transition-all duration-75`}+ } px-2 sm:px-3 py-1 rounded-md text-sm font-medium capitalize active:scale-90 transition-all duration-75`}onClick={() => selectAction(option)}>{option}diff --git a/components/shared/modal.tsx b/components/shared/modal.tsxindex b9e6b0fcbc..41ecf7df3b 100644--- a/components/shared/modal.tsx+++ b/components/shared/modal.tsx@@ -1,18 +1,27 @@-import { Dialog, Transition } from "@headlessui/react";-import { Fragment, Dispatch, SetStateAction, useCallback } from "react";+import {+ Dispatch,+ SetStateAction,+ useCallback,+ useEffect,+ useRef,+} from "react";import { useRouter } from "next/router";+import { motion, AnimatePresence, useAnimation } from "framer-motion";export default function Modal({children,showModal,setShowModal,+ bgColor = "bg-white",}: {children: React.ReactNode;showModal: boolean;setShowModal: Dispatch<SetStateAction<boolean>>;+ bgColor?: string;}) {const router = useRouter();const { key } = router.query;+ const mobileModalRef = useRef(null);const closeModal = useCallback(() => {if (key) {@@ -22,45 +31,84 @@ export default function Modal({}}, [key, router, setShowModal]);- return (- <Transition appear show={showModal} as={Fragment}>- <Dialog- as="div"- className="fixed inset-0 z-40 overflow-y-auto"- onClose={closeModal}- >- <div className="min-h-screen px-4 text-center">- <Transition.Child- as={Fragment}- enter="ease-out duration-300"- enterFrom="opacity-0"- enterTo="opacity-100"- leave="ease-in duration-200"- leaveFrom="opacity-100"- leaveTo="opacity-0"- >- <Dialog.Overlay className="fixed inset-0 bg-gray-100 bg-opacity-10 backdrop-blur" />- </Transition.Child>+ const onKeyDown = useCallback((e: KeyboardEvent) => {+ if (e.key === "Escape") {+ setShowModal(false);+ }+ }, []);++ useEffect(() => {+ document.addEventListener("keydown", onKeyDown);+ return () => document.removeEventListener("keydown", onKeyDown);+ }, [onKeyDown]);++ const controls = useAnimation();+ const transitionProps = { type: "spring", stiffness: 500, damping: 30 };+ useEffect(() => {+ controls.start({+ y: 0,+ transition: transitionProps,+ });+ }, []);- <span- className="inline-block h-screen align-middle"- aria-hidden="true"+ async function handleDragEnd(_, info) {+ const offset = info.offset.y;+ const velocity = info.velocity.y;+ const height = mobileModalRef.current.getBoundingClientRect().height;+ if (offset > height / 2 || velocity > 800) {+ await controls.start({ y: "100%", transition: transitionProps });+ closeModal();+ } else {+ controls.start({ y: 0, transition: transitionProps });+ }+ }++ return (+ <AnimatePresence>+ {showModal && (+ <>+ <motion.div+ ref={mobileModalRef}+ key="mobile-modal"+ className="group fixed bottom-0 inset-x-0 z-40 w-screen sm:hidden cursor-grab active:cursor-grabbing"+ initial={{ y: "100%" }}+ animate={controls}+ exit={{ y: "100%" }}+ transition={transitionProps}+ drag="y"+ dragDirectionLock+ onDragEnd={handleDragEnd}+ dragElastic={{ top: 0, bottom: 1 }}+ dragConstraints={{ top: 0, bottom: 0 }}>- ​- </span>- <Transition.Child- as={Fragment}- enter="ease-out duration-300"- enterFrom="opacity-0 scale-95"- enterTo="opacity-100 scale-100"- leave="ease-in duration-200"- leaveFrom="opacity-100 scale-100"- leaveTo="opacity-0 scale-95"+ <div+ className={`h-7 ${bgColor} w-full flex items-center justify-center rounded-t-4xl border-t border-gray-200 -mb-1`}+ >+ <div className="rounded-full h-1 w-6 -mr-1 bg-gray-300 group-active:rotate-12 transition-all" />+ <div className="rounded-full h-1 w-6 bg-gray-300 group-active:-rotate-12 transition-all" />+ </div>+ {children}+ </motion.div>+ <motion.div+ key="desktop-modal"+ className="fixed inset-0 z-40 min-h-screen px-4 hidden sm:flex items-center justify-center"+ initial={{ scale: 0.95 }}+ animate={{ scale: 1 }}+ exit={{ scale: 0.95 }}+ onClick={closeModal}>{children}- </Transition.Child>- </div>- </Dialog>- </Transition>+ </motion.div>+ <motion.div+ key="backdrop"+ className="fixed inset-0 z-30 bg-gray-100 bg-opacity-10 backdrop-blur"+ initial={{ opacity: 0 }}+ animate={{ opacity: 1 }}+ exit={{ opacity: 0 }}+ onClick={closeModal}+ />+ </>+ )}+ </AnimatePresence>);}diff --git a/components/shared/tooltip.tsx b/components/shared/tooltip.tsxindex d7cbb0028b..4b0a6a8a47 100644--- a/components/shared/tooltip.tsx+++ b/components/shared/tooltip.tsx@@ -1,5 +1,6 @@import * as TooltipPrimitive from "@radix-ui/react-tooltip";-import { ReactNode } from "react";+import { ReactNode, useEffect, useRef, useState } from "react";+import { motion, AnimatePresence, useAnimation } from "framer-motion";export default function Tooltip({children,@@ -8,27 +9,99 @@ export default function Tooltip({children: ReactNode;content: ReactNode | string;}) {+ const [openTooltip, setOpenTooltip] = useState(false);+ const mobileTooltipRef = useRef(null);++ const controls = useAnimation();+ const transitionProps = { type: "spring", stiffness: 500, damping: 30 };++ async function handleDragEnd(_, info) {+ const offset = info.offset.y;+ const velocity = info.velocity.y;+ const height = mobileTooltipRef.current.getBoundingClientRect().height;+ if (offset > height / 2 || velocity > 800) {+ await controls.start({ y: "100%", transition: transitionProps });+ setOpenTooltip(false);+ } else {+ controls.start({ y: 0, transition: transitionProps });+ }+ }+ const randomIndex = Math.floor(Math.random() * 1000000).toString();return (- <TooltipPrimitive.Provider delayDuration={100}>- <TooltipPrimitive.Root>- <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>- <TooltipPrimitive.Content- sideOffset={4}- side="top"- className="animate-slide-up-fade inline-flex items-center rounded-md px-4 py-2.5 z-20 bg-white border border-gray-200 drop-shadow-lg"- >- <TooltipPrimitive.Arrow className="fill-current text-white" />- {typeof content === "string" ? (- <span className="block text-sm text-center text-gray-700 max-w-xs">- {content}- </span>- ) : (- content- )}- <TooltipPrimitive.Arrow className="fill-current text-white" />- </TooltipPrimitive.Content>- </TooltipPrimitive.Root>- </TooltipPrimitive.Provider>+ <>+ <button className="block sm:hidden" onClick={() => setOpenTooltip(true)}>+ {children}+ </button>+ <AnimatePresence>+ {openTooltip && (+ <>+ <motion.div+ ref={mobileTooltipRef}+ key={`mobile-tooltip-${randomIndex}`}+ className="group fixed bottom-0 inset-x-0 z-40 w-screen sm:hidden cursor-grab active:cursor-grabbing"+ initial={{ y: "100%" }}+ animate={{+ y: openTooltip ? 0 : "100%",+ transition: transitionProps,+ }}+ exit={{ y: "100%" }}+ transition={transitionProps}+ drag="y"+ dragDirectionLock+ onDragEnd={handleDragEnd}+ dragElastic={{ top: 0, bottom: 1 }}+ dragConstraints={{ top: 0, bottom: 0 }}+ >+ <div+ className={`h-7 bg-white w-full flex items-center justify-center rounded-t-4xl border-t border-gray-200 -mb-1`}+ >+ <div className="rounded-full h-1 w-6 -mr-1 bg-gray-300 group-active:rotate-12 transition-all" />+ <div className="rounded-full h-1 w-6 bg-gray-300 group-active:-rotate-12 transition-all" />+ </div>+ <div className="flex items-center justify-center w-full overflow-hidden align-middle bg-white shadow-xl min-h-[150px]">+ {typeof content === "string" ? (+ <span className="block text-sm text-center text-gray-700 max-w-xs">+ {content}+ </span>+ ) : (+ content+ )}+ </div>+ </motion.div>+ <motion.div+ key={`mobile-tooltip-backdrop-${randomIndex}`}+ className="fixed inset-0 z-30 bg-gray-100 bg-opacity-10 backdrop-blur sm:hidden"+ initial={{ opacity: 0 }}+ animate={{ opacity: 1 }}+ exit={{ opacity: 0 }}+ onClick={() => setOpenTooltip(false)}+ />+ </>+ )}+ </AnimatePresence>+ <TooltipPrimitive.Provider delayDuration={100}>+ <TooltipPrimitive.Root>+ <TooltipPrimitive.Trigger className="hidden sm:flex" asChild>+ {children}+ </TooltipPrimitive.Trigger>+ <TooltipPrimitive.Content+ sideOffset={4}+ side="top"+ className="hidden sm:block animate-slide-up-fade items-center rounded-md px-4 py-2.5 z-20 bg-white border border-gray-200 drop-shadow-lg"+ >+ <TooltipPrimitive.Arrow className="fill-current text-white" />+ {typeof content === "string" ? (+ <span className="block text-sm text-center text-gray-700 max-w-xs">+ {content}+ </span>+ ) : (+ content+ )}+ <TooltipPrimitive.Arrow className="fill-current text-white" />+ </TooltipPrimitive.Content>+ </TooltipPrimitive.Root>+ </TooltipPrimitive.Provider>+ </>);}diff --git a/components/stats/bar-chart/index.tsx b/components/stats/bar-chart/index.tsxindex f141aff5fc..56a1f68bba 100644--- a/components/stats/bar-chart/index.tsx+++ b/components/stats/bar-chart/index.tsx@@ -41,10 +41,10 @@ const BarChart = ({}) => {const [CHART_WIDTH, CHART_HEIGHT] = useMemo(() => {const width = screenWidth- ? Math.min(screenWidth * 0.7, CHART_MAX_WIDTH)+ ? Math.min(screenWidth * 0.8, CHART_MAX_WIDTH): CHART_MAX_WIDTH;const height = screenWidth- ? Math.min(screenWidth * 0.4, CHART_MAX_HEIGHT)+ ? Math.min(screenWidth * 0.5, CHART_MAX_HEIGHT): CHART_MAX_HEIGHT;return [width, height];}, [screenWidth]);diff --git a/components/stats/clicks.tsx b/components/stats/clicks.tsxindex f33b9475df..a3f48915cf 100644--- a/components/stats/clicks.tsx+++ b/components/stats/clicks.tsx@@ -11,7 +11,7 @@ export default function Clicks({isValidating: boolean;}) {return (- <div className="max-w-4xl bg-white p-10 pr-20 shadow-lg rounded-lg border border-gray-100">+ <div className="max-w-4xl bg-white p-5 sm:p-10 sm:pr-20 shadow-lg sm:rounded-lg border border-gray-100"><div className="mb-5 text-left"><div className="flex space-x-1 items-end">{isValidating ? (diff --git a/components/stats/devices.tsx b/components/stats/devices.tsxindex 1a421fbd99..6568ab28c3 100644--- a/components/stats/devices.tsx+++ b/components/stats/devices.tsx@@ -32,7 +32,7 @@ export default function Devices({ data: rawData }: { data: StatsProps }) {};return (- <div className="flex flex-col justify-between bg-white pt-5 shadow-lg rounded-lg border border-gray-100 h-[420px]">+ <div className="flex flex-col justify-between bg-white pt-5 shadow-lg sm:rounded-lg border border-gray-100 h-[420px]"><divclassName="relative overflow-scroll scrollbar-hide px-7"onScroll={handleScroll}diff --git a/components/stats/index.tsx b/components/stats/index.tsxindex 71da039340..a3f774b4eb 100644--- a/components/stats/index.tsx+++ b/components/stats/index.tsx@@ -37,7 +37,7 @@ export default function Stats({);return (- <div className="bg-gray-50 py-20 mx-auto lg:px-0 px-2.5">+ <div className="bg-gray-50 py-10"><Toggle domain={domain} atModalTop={atModalTop} /><div className="max-w-4xl mx-auto grid gap-5"><Clicks data={data!} isValidating={isValidating} />diff --git a/components/stats/locations.tsx b/components/stats/locations.tsxindex f71f869878..7c25d514f3 100644--- a/components/stats/locations.tsx+++ b/components/stats/locations.tsx@@ -31,7 +31,7 @@ export default function Locations({ data: rawData }: { data: StatsProps }) {return (<div- className="relative bg-white px-7 py-5 shadow-lg rounded-lg border border-gray-100 h-[420px] overflow-scroll scrollbar-hide"+ className="relative bg-white px-7 py-5 shadow-lg sm:rounded-lg border border-gray-100 h-[420px] overflow-scroll scrollbar-hide"onScroll={handleScroll}><div className="mb-5 flex justify-between">diff --git a/components/stats/toggle.tsx b/components/stats/toggle.tsxindex 29151a6a33..851ff210cd 100644--- a/components/stats/toggle.tsx+++ b/components/stats/toggle.tsx@@ -38,13 +38,13 @@ export default function Toggle({return (<div- className={`z-10 mb-5 ${+ className={`z-20 mb-5 ${pageType === "stats" ? "top-0" : "top-24"} sticky py-5 bg-gray-50 ${atTop ? "shadow-md" : ""}`}>- <div className="max-w-4xl mx-auto flex justify-between items-center">+ <div className="max-w-4xl mx-auto flex justify-between items-center lg:px-0 px-2.5"><a- className="group flex text-xl text-gray-800 font-semibold"+ className="group flex text-lg sm:text-xl text-gray-800 font-semibold"href={linkConstructor({ key, domain })}target="_blank"rel="noreferrer"diff --git a/lib/constants.ts b/lib/constants.tsindex 228ddf73f3..0eaad06e44 100644--- a/lib/constants.ts+++ b/lib/constants.ts@@ -18,6 +18,7 @@ export const HOME_HOSTNAMES = new Set(["dub.sh","preview.dub.sh","localhost:3000",+ "6401-2600-1700-b5e4-b50-740f-60b5-5e62-a925.ngrok.io",]);export const RESERVED_KEYS = new Set([diff --git a/pages/index.tsx b/pages/index.tsxindex 782d918234..1f0d7eb94b 100644--- a/pages/index.tsx+++ b/pages/index.tsx@@ -1,7 +1,7 @@import HomeLayout from "@/components/layout/home";import { useCallback, useEffect } from "react";import { useRouter } from "next/router";-import { useStatsModal } from "@/components/stats/stats-modal";+import { useStatsModal } from "@/components/app/modals/stats-modal";import Hero from "@/components/home/hero";import Demo from "@/components/home/demo";import Globe from "@/components/home/globe";