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.

removed dark mode (for now) 🥲

Steven Tey91bd0ad31068
diff --git a/components/app/add-link-modal.tsx b/components/app/add-link-modal.tsx
index 6bbab71c2b..4f3d2a994e 100644
--- a/components/app/add-link-modal.tsx
+++ b/components/app/add-link-modal.tsx
@@ -102,7 +102,7 @@ function AddLinkModal({
<BlurImage
src={`/static/logo.png`}
alt={"dub.sh"}
- className="w-10 h-10 rounded-full border border-gray-200 dark:border-gray-600"
+ className="w-10 h-10 rounded-full border border-gray-200"
width={20}
height={20}
/>
@@ -291,20 +291,20 @@ function AddLinkButton({
}) {
return !domainVerified ? (
<Tooltip content="You can only start adding links after your project domain is configured.">
- <div className="text-gray-300 cursor-not-allowed font-medium text-sm px-5 py-2 border rounded-md border-gray-200 dark:border-gray-600 transition-all duration-75">
+ <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">
Add
</div>
</Tooltip>
) : exceededUsage ? (
<Tooltip content="You have exceeded your usage limit. We're still collecting data on your existing links, but you need to upgrade to add more links.">
- <div className="text-gray-300 cursor-not-allowed font-medium text-sm px-5 py-2 border rounded-md border-gray-200 dark:border-gray-600 transition-all duration-75">
+ <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">
Add
</div>
</Tooltip>
) : (
<button
onClick={() => setShowAddLinkModal(true)}
- className="text-gray-500 hover:border-black dark:hover:border-white active:scale-95 font-medium text-sm px-5 py-2 border rounded-md border-gray-200 dark:border-gray-600 transition-all duration-75"
+ className="text-gray-500 hover:border-black active:scale-95 font-medium text-sm px-5 py-2 border rounded-md border-gray-200 transition-all duration-75"
>
Add
</button>
diff --git a/components/app/add-project-modal.tsx b/components/app/add-project-modal.tsx
index 46cb2544d2..6d5649867c 100644
--- a/components/app/add-project-modal.tsx
+++ b/components/app/add-project-modal.tsx
@@ -83,7 +83,7 @@ function AddProjectModalHelper({
<BlurImage
src={`/static/logo.png`}
alt={"dub.sh"}
- className="w-10 h-10 rounded-full border border-gray-200 dark:border-gray-600"
+ className="w-10 h-10 rounded-full border border-gray-200"
width={20}
height={20}
/>
diff --git a/components/app/custom-domain/edit-domain-modal.tsx b/components/app/custom-domain/edit-domain-modal.tsx
index 47ea5b8852..387054638d 100644
--- a/components/app/custom-domain/edit-domain-modal.tsx
+++ b/components/app/custom-domain/edit-domain-modal.tsx
@@ -54,7 +54,7 @@ function EditDomainModalHelper({
<BlurImage
src={`https://logo.clearbit.com/${domain}`}
alt={domain}
- className="w-10 h-10 rounded-full border border-gray-200 dark:border-gray-600"
+ className="w-10 h-10 rounded-full border border-gray-200"
width={20}
height={20}
/>
diff --git a/components/app/edit-link-modal.tsx b/components/app/edit-link-modal.tsx
index f66313296e..1d962e78d4 100644
--- a/components/app/edit-link-modal.tsx
+++ b/components/app/edit-link-modal.tsx
@@ -61,7 +61,7 @@ function EditLinkModalHelper({
<BlurImage
src={`https://logo.clearbit.com/${urlHostname}`}
alt={urlHostname}
- className="w-10 h-10 rounded-full border border-gray-200 dark:border-gray-600"
+ className="w-10 h-10 rounded-full border border-gray-200"
width={20}
height={20}
/>
diff --git a/components/app/link-card-placeholder.tsx b/components/app/link-card-placeholder.tsx
index d613ce89e0..a5cda8ddf9 100644
--- a/components/app/link-card-placeholder.tsx
+++ b/components/app/link-card-placeholder.tsx
@@ -5,16 +5,16 @@ export default function LinkCardPlaceholder() {
return (
<motion.li
variants={FRAMER_MOTION_LIST_ITEM_VARIANTS}
- className="flex items-center border border-gray-200 dark:border-gray-600 bg-white dark:bg-black p-4 rounded-md transition-all"
+ className="flex items-center border border-gray-200 bg-white p-4 rounded-md transition-all"
>
- <div className="w-10 h-10 rounded-full mr-2 bg-gray-200 dark:bg-gray-600 animate-pulse" />
+ <div className="w-10 h-10 rounded-full mr-2 bg-gray-200 animate-pulse" />
<div>
<div className="flex items-center space-x-2 mb-2.5">
- <div className="w-28 h-5 rounded-md bg-gray-200 dark:bg-gray-600 animate-pulse" />
- <div className="w-5 h-5 rounded-full bg-gray-200 dark:bg-gray-600 animate-pulse" />
- <div className="w-20 h-5 rounded-md bg-gray-200 dark:bg-gray-600 animate-pulse" />
+ <div className="w-28 h-5 rounded-md bg-gray-200 animate-pulse" />
+ <div className="w-5 h-5 rounded-full bg-gray-200 animate-pulse" />
+ <div className="w-20 h-5 rounded-md bg-gray-200 animate-pulse" />
</div>
- <div className="w-72 h-4 rounded-md bg-gray-200 dark:bg-gray-600 animate-pulse" />
+ <div className="w-72 h-4 rounded-md bg-gray-200 animate-pulse" />
</div>
</motion.li>
);
diff --git a/components/app/link-card.tsx b/components/app/link-card.tsx
index cb091f3cce..25f6b894b4 100644
--- a/components/app/link-card.tsx
+++ b/components/app/link-card.tsx
@@ -38,20 +38,20 @@ export default function LinkCard({
});
return (
- <div 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 dark:border-gray-600 bg-white dark:bg-black p-4 rounded-md transition-all">
+ <div 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">
<EditLinkModal />
<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 dark:border-gray-600"
+ 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 dark:text-blue-400 font-semibold"
+ className="text-blue-800 font-semibold"
href={linkConstructor({ key, domain })}
target="_blank"
rel="noreferrer"
@@ -60,8 +60,8 @@ export default function LinkCard({
</a>
<CopyButton url={linkConstructor({ key, domain })} />
<Link href={`${router.asPath}/${encodeURI(key)}`}>
- <a className="rounded-md bg-gray-100 dark:bg-gray-800 px-2 py-0.5 hover:scale-105 active:scale-95 transition-all duration-75">
- <p className="text-sm text-gray-500 dark:text-white">
+ <a className="rounded-md bg-gray-100 px-2 py-0.5 hover:scale-105 active:scale-95 transition-all duration-75">
+ <p className="text-sm text-gray-500">
{isValidating || !clicks ? (
<LoadingDots color="#71717A" />
) : (
@@ -72,25 +72,23 @@ export default function LinkCard({
</a>
</Link>
</div>
- <h3 className="text-sm font-medium text-gray-700 dark:text-gray-200 line-clamp-1">
+ <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 dark:text-gray-400">
- Added {timeAgo(timestamp)}
- </p>
+ <p className="text-sm text-gray-500">Added {timeAgo(timestamp)}</p>
{exceededUsage ? (
<Tooltip content="You have exceeded your usage limit. We're still collecting data on your existing links, but you need to upgrade to edit them.">
- <div className="text-gray-300 cursor-not-allowed font-medium text-sm px-5 py-2 border rounded-md border-gray-200 dark:border-gray-600 transition-all duration-75">
+ <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">
Edit
</div>
</Tooltip>
) : (
<button
onClick={() => setShowEditLinkModal(true)}
- className="font-medium text-sm text-gray-500 px-5 py-2 border rounded-md border-gray-200 dark:border-gray-600 hover:border-black dark:hover:border-white active:scale-95 transition-all duration-75"
+ 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"
>
Edit
</button>
diff --git a/components/app/no-projects-placeholder.tsx b/components/app/no-projects-placeholder.tsx
index 1e372fd4e7..3dcef8ec2c 100644
--- a/components/app/no-projects-placeholder.tsx
+++ b/components/app/no-projects-placeholder.tsx
@@ -19,7 +19,7 @@ export default function NoProjectsPlaceholder({
/>
<button
onClick={() => setShowAddProjectModal(true)}
- className="text-gray-500 hover:border-black dark:hover:border-white active:scale-95 font-medium text-sm px-5 py-2 border rounded-md border-gray-200 dark:border-gray-600 transition-all duration-75 z-10"
+ className="text-gray-500 hover:border-black active:scale-95 font-medium text-sm px-5 py-2 border rounded-md border-gray-200 transition-all duration-75 z-10"
>
Create a project
</button>
diff --git a/components/app/project-card-placeholder.tsx b/components/app/project-card-placeholder.tsx
index 6b4f77d7c5..cc365f3009 100644
--- a/components/app/project-card-placeholder.tsx
+++ b/components/app/project-card-placeholder.tsx
@@ -1,6 +1,6 @@
export default function ProjectCardPlaceholder() {
return (
- <div className="bg-white dark:bg-gray-800 shadow rounded-lg p-6 flex justify-between hover:shadow-md transition-all">
+ <div className="bg-white shadow rounded-lg p-6 flex justify-between hover:shadow-md transition-all">
<div className="flex items-center space-x-3">
<div className="w-12 h-12 rounded-full bg-gray-200 animate-pulse" />
<div className="flex flex-col space-y-2.5">
diff --git a/components/app/project-card.tsx b/components/app/project-card.tsx
index a12e2ae20d..95f5e39974 100644
--- a/components/app/project-card.tsx
+++ b/components/app/project-card.tsx
@@ -26,7 +26,7 @@ export default function ProjectCard({
return (
<Link key={slug} href={`/${slug}`}>
<a>
- <div className="bg-white dark:bg-gray-800 shadow rounded-lg p-6 flex justify-between hover:shadow-md transition-all">
+ <div className="bg-white shadow rounded-lg p-6 flex justify-between hover:shadow-md transition-all">
<div className="flex items-center space-x-3">
<BlurImage
src={`https://avatar.tobi.sh/${slug}`}
@@ -38,7 +38,7 @@ export default function ProjectCard({
<div>
<h2 className="text-lg font-medium text-gray-700">{name}</h2>
<div className="flex items-center">
- <p className="text-gray-500 dark:text-gray-400">{domain}</p>
+ <p className="text-gray-500">{domain}</p>
{domainVerified ? (
<Tooltip content="Verified domain">
<div className="w-8 flex justify-center">
@@ -56,7 +56,7 @@ export default function ProjectCard({
</div>
</div>
<div className="flex items-center space-x-2">
- <LinkIcon className="text-gray-600 dark:text-gray-400 w-5 h-5" />
+ <LinkIcon className="text-gray-600 w-5 h-5" />
{isValidating ? (
<div className="w-4 h-5 rounded-md bg-gray-200 animate-pulse" />
) : (
diff --git a/components/home/link-card.tsx b/components/home/link-card.tsx
index 4c8c300654..cdbfdc6fbf 100644
--- a/components/home/link-card.tsx
+++ b/components/home/link-card.tsx
@@ -50,20 +50,20 @@ export default function LinkCard({
return (
<motion.li
variants={FRAMER_MOTION_LIST_ITEM_VARIANTS}
- className="flex items-center border border-gray-200 dark:border-gray-600 hover:border-black dark:hover:border-white bg-white dark:bg-black p-3 max-w-md rounded-md transition-all"
+ className="flex items-center border border-gray-200 hover:border-black bg-white p-3 max-w-md rounded-md transition-all"
>
<StatsModal />
<BlurImage
src={`https://logo.clearbit.com/${urlHostname}`}
alt={urlHostname}
- className="w-10 h-10 rounded-full mr-2 border border-gray-200 dark:border-gray-600"
+ className="w-10 h-10 rounded-full mr-2 border border-gray-200"
width={20}
height={20}
/>
<div>
<div className="flex items-center space-x-2 mb-1">
<a
- className="text-blue-800 dark:text-blue-400 font-semibold"
+ className="text-blue-800 font-semibold"
href={linkConstructor({ key })}
target="_blank"
rel="noreferrer"
@@ -77,8 +77,8 @@ export default function LinkCard({
shallow
scroll={false}
>
- <a className="rounded-md bg-gray-100 dark:bg-gray-800 px-2 py-0.5 hover:scale-105 active:scale-95 transition-all duration-75">
- <p className="text-sm text-gray-500 dark:text-white">
+ <a className="rounded-md bg-gray-100 px-2 py-0.5 hover:scale-105 active:scale-95 transition-all duration-75">
+ <p className="text-sm text-gray-500">
{isValidating || !clicks ? (
<LoadingDots color="#71717A" />
) : (
@@ -89,9 +89,7 @@ export default function LinkCard({
</a>
</Link>
</div>
- <p className="text-sm text-gray-500 dark:text-gray-400 truncate w-72">
- {url}
- </p>
+ <p className="text-sm text-gray-500 truncate w-72">{url}</p>
</div>
</motion.li>
);
diff --git a/components/home/placeholder-card.tsx b/components/home/placeholder-card.tsx
index 90e8e3d0d9..8c0c0192af 100644
--- a/components/home/placeholder-card.tsx
+++ b/components/home/placeholder-card.tsx
@@ -5,16 +5,16 @@ export default function PlaceholderCard() {
return (
<motion.li
variants={FRAMER_MOTION_LIST_ITEM_VARIANTS}
- className="flex items-center border border-gray-200 dark:border-gray-600 hover:border-black dark:hover:border-white bg-white dark:bg-black p-3 max-w-md rounded-md transition-all"
+ className="flex items-center border border-gray-200 hover:border-black bg-white p-3 max-w-md rounded-md transition-all"
>
- <div className="w-10 h-10 rounded-full mr-2 bg-gray-200 dark:bg-gray-600 animate-pulse" />
+ <div className="w-10 h-10 rounded-full mr-2 bg-gray-200 animate-pulse" />
<div>
<div className="flex items-center space-x-2 mb-2.5">
- <div className="w-28 h-6 rounded-md bg-gray-200 dark:bg-gray-600 animate-pulse" />
- <div className="w-6 h-6 rounded-full bg-gray-200 dark:bg-gray-600 animate-pulse" />
- <div className="w-20 h-6 rounded-md bg-gray-200 dark:bg-gray-600 animate-pulse" />
+ <div className="w-28 h-6 rounded-md bg-gray-200 animate-pulse" />
+ <div className="w-6 h-6 rounded-full bg-gray-200 animate-pulse" />
+ <div className="w-20 h-6 rounded-md bg-gray-200 animate-pulse" />
</div>
- <div className="w-72 h-4 rounded-md bg-gray-200 dark:bg-gray-600 animate-pulse" />
+ <div className="w-72 h-4 rounded-md bg-gray-200 animate-pulse" />
</div>
</motion.li>
);
diff --git a/components/layout/home/index.tsx b/components/layout/home/index.tsx
index 8c9318934a..bed11db84c 100644
--- a/components/layout/home/index.tsx
+++ b/components/layout/home/index.tsx
@@ -9,7 +9,7 @@ export default function HomeLayout({ children }: { children: ReactNode }) {
<Meta />
<div className="bg-white z-20">
<div className="max-w-screen-xl mx-auto px-5 sm:px-20">
- <div className="h-16 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/shared/badge-select.tsx b/components/shared/badge-select.tsx
index 16d1a4de87..93083464ac 100644
--- a/components/shared/badge-select.tsx
+++ b/components/shared/badge-select.tsx
@@ -14,8 +14,8 @@ export default function BadgeSelect({
key={option}
className={`${
option === selected
- ? "bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200"
- : "bg-gray-50 dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400"
+ ? "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`}
onClick={() => selectAction(option)}
>
diff --git a/components/shared/copy-button.tsx b/components/shared/copy-button.tsx
index ec80aae17b..5bd9417764 100644
--- a/components/shared/copy-button.tsx
+++ b/components/shared/copy-button.tsx
@@ -10,12 +10,12 @@ export default function CopyButton({ url }: { url: string }) {
navigator.clipboard.writeText(url);
setTimeout(() => setCopied(false), 3000);
}}
- className="group p-1.5 rounded-full bg-gray-100 dark:bg-gray-800 hover:bg-blue-100 dark:hover:bg-blue-700 hover:scale-105 active:scale-95 transition-all duration-75"
+ className="group p-1.5 rounded-full bg-gray-100 hover:bg-blue-100 hover:scale-105 active:scale-95 transition-all duration-75"
>
{copied ? (
- <Tick className="text-gray-500 dark:text-white group-hover:text-blue-800 dark:group-hover:text-white transition-all" />
+ <Tick className="text-gray-500 group-hover:text-blue-800 transition-all" />
) : (
- <Copy className="text-gray-500 dark:text-white group-hover:text-blue-800 dark:group-hover:text-white transition-all" />
+ <Copy className="text-gray-500 group-hover:text-blue-800 transition-all" />
)}
</button>
);
diff --git a/components/shared/icons/loading-circle.tsx b/components/shared/icons/loading-circle.tsx
index 7b13da2dc1..2d07a276b2 100644
--- a/components/shared/icons/loading-circle.tsx
+++ b/components/shared/icons/loading-circle.tsx
@@ -4,7 +4,7 @@ export default function LoadingCircle({ dimensions }: { dimensions?: string }) {
aria-hidden="true"
className={`${
dimensions || "w-4 h-4"
- } text-gray-200 animate-spin dark:text-gray-600 fill-gray-600`}
+ } text-gray-200 animate-spin fill-gray-600`}
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
diff --git a/components/shared/modal.tsx b/components/shared/modal.tsx
index e112fee904..b9e6b0fcbc 100644
--- a/components/shared/modal.tsx
+++ b/components/shared/modal.tsx
@@ -39,7 +39,7 @@ export default function Modal({
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
- <Dialog.Overlay className="fixed inset-0 bg-gray-100 dark:bg-black bg-opacity-10 backdrop-blur dark:backdrop-blur-none" />
+ <Dialog.Overlay className="fixed inset-0 bg-gray-100 bg-opacity-10 backdrop-blur" />
</Transition.Child>
<span
diff --git a/components/stats/bar-chart/index.tsx b/components/stats/bar-chart/index.tsx
index a040d09063..30d3b536e6 100644
--- a/components/stats/bar-chart/index.tsx
+++ b/components/stats/bar-chart/index.tsx
@@ -183,13 +183,13 @@ const BarChart = ({
className={styles.tooltip}
>
<div className="text-center">
- <h3 className="text-black dark:text-white my-1">
+ <h3 className="text-black my-1">
<span className="text-2xl font-semibold">
{nFormatter(tooltipData.count)}
</span>{" "}
clicks
</h3>
- <p className="text-xs text-gray-600 dark:text-gray-400">
+ <p className="text-xs text-gray-600">
{intervalData[interval].format(tooltipData.start)} -{" "}
{intervalData[interval].format(tooltipData.end)}
</p>
diff --git a/components/stats/clicks.tsx b/components/stats/clicks.tsx
index 646a2da293..f33b9475df 100644
--- a/components/stats/clicks.tsx
+++ b/components/stats/clicks.tsx
@@ -11,19 +11,19 @@ export default function Clicks({
isValidating: boolean;
}) {
return (
- <div className="max-w-4xl bg-white dark:bg-black p-10 pr-20 shadow-lg dark:shadow-none rounded-lg border border-gray-100 dark:border-gray-600">
+ <div className="max-w-4xl bg-white p-10 pr-20 shadow-lg rounded-lg border border-gray-100">
<div className="mb-5 text-left">
<div className="flex space-x-1 items-end">
{isValidating ? (
- <div className="h-10 w-12 rounded-md bg-gray-200 dark:bg-gray-700 animate-pulse" />
+ <div className="h-10 w-12 rounded-md bg-gray-200 animate-pulse" />
) : (
- <h1 className="text-3xl sm:text-4xl dark:text-white font-bold">
+ <h1 className="text-3xl sm:text-4xl font-bold">
{nFormatter(data.totalClicks)}
</h1>
)}
- <Chart className="text-gray-600 dark:text-gray-400 w-6 h-6 mb-1" />
+ <Chart className="text-gray-600 w-6 h-6 mb-1" />
</div>
- <p className="uppercase text-gray-600 dark:text-gray-400 text-sm font-medium">
+ <p className="uppercase text-gray-600 text-sm font-medium">
Total Clicks
</p>
</div>
diff --git a/components/stats/devices.tsx b/components/stats/devices.tsx
index c4b8f4d34c..1a421fbd99 100644
--- a/components/stats/devices.tsx
+++ b/components/stats/devices.tsx
@@ -32,13 +32,13 @@ export default function Devices({ data: rawData }: { data: StatsProps }) {
};
return (
- <div className="flex flex-col justify-between bg-white dark:bg-black pt-5 shadow-lg dark:shadow-none rounded-lg border border-gray-100 dark:border-gray-600 h-[420px]">
+ <div className="flex flex-col justify-between bg-white pt-5 shadow-lg rounded-lg border border-gray-100 h-[420px]">
<div
className="relative overflow-scroll scrollbar-hide px-7"
onScroll={handleScroll}
>
<div className="mb-5 flex justify-between">
- <h1 className="text-xl dark:text-white font-semibold">Devices</h1>
+ <h1 className="text-xl font-semibold">Devices</h1>
<BadgeSelect
options={["device", "browser", "os", ...(showBots ? ["bot"] : [])]}
selected={tab}
@@ -66,7 +66,7 @@ export default function Devices({ data: rawData }: { data: StatsProps }) {
className="w-4 h-4"
/>
<p
- className={`text-gray-800 dark:text-gray-200 text-sm ${
+ className={`text-gray-800 text-sm ${
display !== "iOS" ? "capitalize" : ""
}`}
>
@@ -77,22 +77,20 @@ export default function Devices({ data: rawData }: { data: StatsProps }) {
style={{
width: `${(count / data.totalClicks) * 100}%`,
}}
- className="bg-green-100 dark:bg-green-900 absolute h-8 origin-left"
+ className="bg-green-100 absolute h-8 origin-left"
transition={{ ease: "easeOut", duration: 0.3 }}
initial={{ transform: "scaleX(0)" }}
animate={{ transform: "scaleX(1)" }}
/>
</div>
- <p className="text-gray-600 dark:text-gray-400 text-sm z-10">
+ <p className="text-gray-600 text-sm z-10">
{nFormatter(count)}
</p>
</div>
))}
</>
) : (
- <p className="text-gray-600 dark:text-gray-400 text-sm">
- No data available
- </p>
+ <p className="text-gray-600 text-sm">No data available</p>
)
) : (
<LoadingDots color="#71717A" />
@@ -108,7 +106,7 @@ export default function Devices({ data: rawData }: { data: StatsProps }) {
transition: { type: "linear", duration: 0.2 },
}}
exit={{ opacity: 0, y: 50, transition: { duration: 0 } }}
- className="absolute w-full h-8 flex justify-center items-center bottom-0 left-0 right-0 bg-gradient-to-b from-white to-gray-100 dark:from-transparent dark:to-[#060606] text-sm text-gray-500 dark:text-gray-400"
+ className="absolute w-full h-8 flex justify-center items-center bottom-0 left-0 right-0 bg-gradient-to-b from-white to-gray-100 text-sm text-gray-500"
>
Show more
</motion.div>
@@ -124,12 +122,9 @@ export default function Devices({ data: rawData }: { data: StatsProps }) {
type="checkbox"
checked={showBots}
onChange={() => setShowBots(!showBots)}
- className="h-4 w-4 rounded text-black dark:text-gray-700 focus:outline-none focus:ring-0"
+ className="h-4 w-4 rounded text-black focus:outline-none focus:ring-0"
/>
- <label
- htmlFor="showBots"
- className="text-gray-800 dark:text-gray-200 text-sm"
- >
+ <label htmlFor="showBots" className="text-gray-800 text-sm">
Include Bots
</label>
</div>
diff --git a/components/stats/index.tsx b/components/stats/index.tsx
index 1802edbd43..71da039340 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 dark:bg-black py-20 mx-auto lg:px-0 px-2.5">
+ <div className="bg-gray-50 py-20 mx-auto lg:px-0 px-2.5">
<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.tsx
index cbbc88ef2a..f71f869878 100644
--- a/components/stats/locations.tsx
+++ b/components/stats/locations.tsx
@@ -31,11 +31,11 @@ export default function Locations({ data: rawData }: { data: StatsProps }) {
return (
<div
- className="relative bg-white dark:bg-black px-7 py-5 shadow-lg dark:shadow-none rounded-lg border border-gray-100 dark:border-gray-600 h-[420px] overflow-scroll scrollbar-hide"
+ className="relative bg-white px-7 py-5 shadow-lg rounded-lg border border-gray-100 h-[420px] overflow-scroll scrollbar-hide"
onScroll={handleScroll}
>
<div className="mb-5 flex justify-between">
- <h1 className="text-xl dark:text-white font-semibold">Locations</h1>
+ <h1 className="text-xl font-semibold">Locations</h1>
<BadgeSelect
options={["country", "city"]}
selected={tab}
@@ -60,29 +60,25 @@ export default function Locations({ data: rawData }: { data: StatsProps }) {
src={`https://flag.vercel.app/m/${code}.svg`}
className="w-5 h-3"
/>
- <p className="text-gray-800 dark:text-gray-200 text-sm">
- {display}
- </p>
+ <p className="text-gray-800 text-sm">{display}</p>
</span>
<motion.div
style={{
width: `${(count / data.totalClicks) * 100}%`,
}}
- className="bg-orange-100 dark:bg-orange-900 absolute h-8 origin-left"
+ className="bg-orange-100 absolute h-8 origin-left"
transition={{ ease: "easeOut", duration: 0.3 }}
initial={{ transform: "scaleX(0)" }}
animate={{ transform: "scaleX(1)" }}
/>
</div>
- <p className="text-gray-600 dark:text-gray-400 text-sm z-10">
+ <p className="text-gray-600 text-sm z-10">
{nFormatter(count)}
</p>
</div>
))
) : (
- <p className="text-gray-600 dark:text-gray-400 text-sm">
- No data available
- </p>
+ <p className="text-gray-600 text-sm">No data available</p>
)
) : (
<LoadingDots color="#71717A" />
@@ -98,7 +94,7 @@ export default function Locations({ data: rawData }: { data: StatsProps }) {
transition: { type: "linear", duration: 0.2 },
}}
exit={{ opacity: 0, y: 50, transition: { duration: 0 } }}
- className="absolute w-full h-8 flex justify-center items-center bottom-0 left-0 right-0 bg-gradient-to-b from-white to-gray-100 dark:from-transparent dark:to-[#060606] text-sm text-gray-500 dark:text-gray-400"
+ className="absolute w-full h-8 flex justify-center items-center bottom-0 left-0 right-0 bg-gradient-to-b from-white to-gray-100 text-sm text-gray-500"
>
Show more
</motion.div>
diff --git a/components/stats/stats-modal.tsx b/components/stats/stats-modal.tsx
index bdd43f4294..367029201a 100644
--- a/components/stats/stats-modal.tsx
+++ b/components/stats/stats-modal.tsx
@@ -33,11 +33,11 @@ function StatsModalHelper({
<Modal showModal={showStatsModal} setShowModal={setShowStatsModal}>
<div
onScroll={handleScroll}
- className="inline-block w-full max-w-screen-xl max-h-[calc(100vh-100px)] overflow-scroll scrollbar-hide bg-gray-50 dark:bg-black
- align-middle transform border border-gray-200 dark:border-gray-600 shadow-xl dark:shadow-none rounded-2xl"
+ 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"
>
<button
- className="sticky top-4 z-20 p-3 m-4 rounded-full float-right group hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none active:scale-75 transition-all duration-75"
+ 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"
autoFocus={false}
onClick={() => {
setShowStatsModal(false);
diff --git a/components/stats/toggle.tsx b/components/stats/toggle.tsx
index 74e13c9585..5d88efd1dc 100644
--- a/components/stats/toggle.tsx
+++ b/components/stats/toggle.tsx
@@ -40,12 +40,12 @@ export default function Toggle({
<div
className={`z-10 mb-5 ${
pageType === "stats" ? "top-0" : "top-24"
- } sticky py-5 bg-gray-50 dark:bg-black ${atTop ? "shadow-md" : ""}`}
+ } sticky py-5 bg-gray-50 ${atTop ? "shadow-md" : ""}`}
>
<div className="max-w-4xl mx-auto flex justify-between items-center">
<div className="group flex">
<a
- className="text-xl text-gray-800 dark:text-gray-200 font-semibold"
+ className="text-xl text-gray-800 font-semibold"
href={linkConstructor({ key, domain })}
target="_blank"
rel="noreferrer"
@@ -54,7 +54,7 @@ export default function Toggle({
</a>
<ExpandingArrow className="w-5 h-5" />
</div>
- <div className="px-3 py-1 rounded-md shadow-md dark:shadow-none border bg-white dark:bg-black border-gray-100 dark:border-gray-600">
+ <div className="px-3 py-1 rounded-md shadow-md border bg-white border-gray-100">
<BadgeSelect
options={INTERVALS}
selected={currentInterval}
diff --git a/pages/_document.tsx b/pages/_document.tsx
index 3ada0990a5..4c94398e1c 100644
--- a/pages/_document.tsx
+++ b/pages/_document.tsx
@@ -2,7 +2,7 @@ import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (
- <Html className="min-h-screen bg-white dark:bg-black">
+ <Html className="min-h-screen bg-white">
<Head />
<body>
<Main />
diff --git a/pages/app/index.tsx b/pages/app/index.tsx
index 0af919b092..4da97f2beb 100644
--- a/pages/app/index.tsx
+++ b/pages/app/index.tsx
@@ -21,7 +21,7 @@ export default function App() {
<h1 className="text-2xl text-gray-600">My Projects</h1>
<button
onClick={() => setShowAddProjectModal(true)}
- className="text-gray-500 hover:border-black dark:hover:border-white active:scale-95 font-medium text-sm px-5 py-2 border rounded-md border-gray-200 dark:border-gray-600 transition-all duration-75"
+ className="text-gray-500 hover:border-black active:scale-95 font-medium text-sm px-5 py-2 border rounded-md border-gray-200 transition-all duration-75"
>
Add
</button>
diff --git a/pages/index.tsx b/pages/index.tsx
index 0ec545b2fd..e5596f9a28 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -4,91 +4,23 @@ import Link from "next/link";
import useLocalStorage from "@/lib/hooks/use-local-storage";
import LinkCard from "@/components/home/link-card";
import PlaceholderCard from "@/components/home/placeholder-card";
-import { Github, LoadingDots, Twitter } from "@/components/shared/icons";
+import {
+ Github,
+ LoadingDots,
+ Twitter,
+ CheckCircleFill,
+} from "@/components/shared/icons";
import { motion } from "framer-motion";
import { LinkProps } from "@/lib/types";
+import MaxWidthWrapper from "@/components/shared/max-width-wrapper";
export default function Home() {
- const [saving, setSaving] = useState(false);
- const [url, setUrl] = useState("");
- const [hashes, setHashes] = useLocalStorage<LinkProps[]>("hashes", []);
-
return (
<HomeLayout>
<main className="my-20">
<Hero />
-
- <div className="max-w-md mx-auto sm:px-0 px-2.5">
- <form
- onSubmit={async (e) => {
- e.preventDefault();
- setSaving(true);
- fetch(`/api/edge/links?url=${url}&hostname=dub.sh`, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- }).then(async (response) => {
- setSaving(false);
- if (response.ok) {
- const json = await response.json();
- setHashes([...hashes, json]);
- setUrl("");
- }
- });
- }}
- >
- <div className="relative flex items-center">
- <input
- type="url"
- placeholder="Shorten your link"
- value={url}
- onInput={(e) => {
- setUrl((e.target as HTMLInputElement).value);
- }}
- required
- className="peer shadow-sm focus:outline-none focus:ring-0 dark:text-white bg-white dark:bg-black border focus:border-black dark:focus:border-white block w-full p-2 text-sm border-gray-200 dark:border-gray-600 rounded-md pl-3 pr-12"
- />
- <button
- type="submit"
- disabled={saving}
- className={`${
- saving ? "cursor-not-allowed" : ""
- } absolute inset-y-0 right-0 w-10 flex justify-center items-center my-1.5 mr-1.5 border border-gray-200 dark:border-gray-600 hover:border-gray-700 dark:hover:border-white peer-focus:border-gray-700 dark:peer-focus:border-white rounded text-sm font-sans font-medium text-gray-400 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white peer-focus:text-gray-700 dark:peer-focus:text-white`}
- >
- {saving ? <LoadingDots color="#e5e7eb" /> : <p>↵</p>}
- </button>
- </div>
- </form>
-
- <motion.ul
- key={hashes.length + 1} // workaround for https://github.com/framer/motion/issues/776, add 1 to account for the demo GH link
- initial="hidden"
- animate="show"
- variants={{
- hidden: {},
- show: {
- transition: {
- staggerChildren: 0.1,
- },
- },
- }}
- className="grid gap-2 mt-3"
- >
- <LinkCard
- key="github"
- _key="github"
- url={"https://github.com/steven-tey/dub"}
- />
- {hashes.length > 0
- ? hashes.map(({ key, url }) => (
- <LinkCard key={key} _key={key} url={url} />
- ))
- : Array.from({ length: 3 }).map((_, i) => (
- <PlaceholderCard key={i} />
- ))}
- </motion.ul>
- </div>
+ <Demo />
+ <Features />
</main>
</HomeLayout>
);
@@ -109,14 +41,14 @@ const Hero = () => {
</p>
</a>
- <h1 className="text-5xl sm:text-6xl leading-tight sm:leading-tight font-display font-extrabold text-black dark:text-white mt-5">
+ <h1 className="text-5xl sm:text-6xl leading-tight sm:leading-tight font-display font-extrabold text-black mt-5">
Open Source
<br />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-amber-500 via-orange-600 to-yellow-500">
Bitly Alternative
</span>
</h1>
- <p className="text-gray-600 dark:text-white text-xl sm:text-2xl mt-5">
+ <p className="text-gray-600 text-xl sm:text-2xl mt-5">
An open-source link shortener with built-in analytics and free custom
domains.
</p>
@@ -140,3 +72,112 @@ const Hero = () => {
</div>
);
};
+
+const Demo = () => {
+ const [saving, setSaving] = useState(false);
+ const [url, setUrl] = useState("");
+ const [hashes, setHashes] = useLocalStorage<LinkProps[]>("hashes", []);
+ return (
+ <div className="max-w-md mx-auto sm:px-0 px-2.5">
+ <form
+ onSubmit={async (e) => {
+ e.preventDefault();
+ setSaving(true);
+ fetch(`/api/edge/links?url=${url}&hostname=dub.sh`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ }).then(async (response) => {
+ setSaving(false);
+ if (response.ok) {
+ const json = await response.json();
+ setHashes([...hashes, json]);
+ setUrl("");
+ }
+ });
+ }}
+ >
+ <div className="relative flex items-center">
+ <input
+ type="url"
+ placeholder="Shorten your link"
+ value={url}
+ onInput={(e) => {
+ setUrl((e.target as HTMLInputElement).value);
+ }}
+ required
+ className="peer shadow-sm focus:outline-none focus:ring-0 bg-white border focus:border-black block w-full p-2 text-sm border-gray-200 rounded-md pl-3 pr-12"
+ />
+ <button
+ type="submit"
+ disabled={saving}
+ className={`${
+ saving ? "cursor-not-allowed" : ""
+ } absolute inset-y-0 right-0 w-10 flex justify-center items-center my-1.5 mr-1.5 border border-gray-200 hover:border-gray-700 peer-focus:border-gray-700 rounded text-sm font-sans font-medium text-gray-400 hover:text-gray-700 peer-focus:text-gray-700`}
+ >
+ {saving ? <LoadingDots color="#e5e7eb" /> : <p>↵</p>}
+ </button>
+ </div>
+ </form>
+
+ <motion.ul
+ key={hashes.length + 1} // workaround for https://github.com/framer/motion/issues/776, add 1 to account for the demo GH link
+ initial="hidden"
+ animate="show"
+ variants={{
+ hidden: {},
+ show: {
+ transition: {
+ staggerChildren: 0.1,
+ },
+ },
+ }}
+ className="grid gap-2 mt-3"
+ >
+ <LinkCard
+ key="github"
+ _key="github"
+ url={"https://github.com/steven-tey/dub"}
+ />
+ {hashes.length > 0
+ ? hashes.map(({ key, url }) => (
+ <LinkCard key={key} _key={key} url={url} />
+ ))
+ : Array.from({ length: 3 }).map((_, i) => (
+ <PlaceholderCard key={i} />
+ ))}
+ </motion.ul>
+ </div>
+ );
+};
+
+const Features = () => {
+ return (
+ <div className="max-w-md mx-auto sm:px-0 px-2.5">
+ <h2 className="text-3xl font-display font-semibold text-black mt-10">
+ Features
+ </h2>
+ <ul className="mt-5 space-y-5">
+ <li className="flex space-x-5">
+ <div className="flex-shrink-0">
+ <CheckCircleFill className="w-6 h-6 text-green-500" />
+ </div>
+ <p className="text-gray-600 text-lg">Free custom domains</p>
+ </li>
+ <li className="flex space-x-5">
+ <div className="flex-shrink-0">
+ <CheckCircleFill className="w-6 h-6 text-green-500" />
+ </div>
+ <p className="text-gray-600 text-lg">Built-in analytics</p>
+ </li>
+ <li className="flex space-x-5">
+ <div className="flex-shrink-0">
+ <CheckCircleFill className="w-6 h-6 text-green-500" />
+ </div>
+ <p className="text-gray-600 text-lg">Open-source</p>
+ </li>
+ </ul>
+ </div>
+ );
+};
diff --git a/public/static/logotype.svg b/public/static/logotype.svg
index c9aec60dc2..c157e33e3a 100644
--- a/public/static/logotype.svg
+++ b/public/static/logotype.svg
@@ -1,5 +1,4 @@
<svg width="834" height="236" viewBox="0 0 834 236" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect width="834" height="236" fill="white"/>
<path d="M266 119.5C266 181.632 215.632 232 153.5 232C91.368 232 41 181.632 41 119.5C41 57.368 91.368 7 153.5 7C215.632 7 266 57.368 266 119.5Z" fill="black"/>
<mask id="mask0_46_2" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="41" y="7" width="225" height="225">
<path d="M266 119.5C266 181.632 215.632 232 153.5 232C91.368 232 41 181.632 41 119.5C41 57.368 91.368 7 153.5 7C215.632 7 266 57.368 266 119.5Z" fill="black"/>