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.

small UI fixes

Steven Tey33262450c6d8
diff --git a/app/(marketing)/@modal/(...)stats/[key]/page.tsx b/app/(marketing)/@modal/(...)stats/[key]/page.tsx
index 97372458c8..58a54d3f3d 100644
--- a/app/(marketing)/@modal/(...)stats/[key]/page.tsx
+++ b/app/(marketing)/@modal/(...)stats/[key]/page.tsx
@@ -6,7 +6,7 @@ export default function StatsModal({ params }: { params: { key: string } }) {
<Modal bgColor="bg-gray-50">
<div
className="inline-block max-h-[calc(100vh-150px)] w-full max-w-screen-xl transform overflow-scroll bg-gray-50
- align-middle shadow-xl scrollbar-hide sm:rounded-2xl sm:border sm:border-gray-200"
+ align-middle shadow-xl scrollbar-hide md:rounded-2xl md:border md:border-gray-200"
>
<Stats staticDomain="dub.sh" staticKey={params.key} />
</div>
diff --git a/app/ui/button.tsx b/app/ui/button.tsx
index cd7eed8f93..5a66740ee6 100644
--- a/app/ui/button.tsx
+++ b/app/ui/button.tsx
@@ -22,7 +22,7 @@ export default function Button({
}) {
if (disabledTooltip) {
return (
- <Tooltip content={disabledTooltip}>
+ <Tooltip content={disabledTooltip} fullWidth>
<div className="flex h-10 w-full cursor-not-allowed items-center justify-center rounded-md border border-gray-200 bg-gray-100 text-sm text-gray-400 transition-all focus:outline-none">
<p>{text}</p>
</div>
diff --git a/app/ui/home/hero.tsx b/app/ui/home/hero.tsx
index a2892b12dd..cbc6b0226f 100644
--- a/app/ui/home/hero.tsx
+++ b/app/ui/home/hero.tsx
@@ -3,7 +3,7 @@ import { Github, Twitter } from "@/components/shared/icons";
const Hero = () => {
return (
- <div className="mx-auto mt-20 mb-10 max-w-md px-2.5 text-center sm:max-w-lg sm:px-0">
+ <div className="mx-auto mb-10 mt-20 max-w-md px-2.5 text-center sm:max-w-lg sm:px-0">
<Link
href="https://dub.sh/launch"
target="_blank"
@@ -16,14 +16,14 @@ const Hero = () => {
</p>
</Link>
- <h1 className="mt-5 font-display text-5xl font-extrabold leading-[1.15] text-black sm:text-6xl sm:leading-[1.15]">
+ <h1 className="mt-5 font-display text-4xl font-extrabold leading-[1.15] text-black sm:text-6xl sm:leading-[1.15]">
Short Links With
<br />
<span className="bg-gradient-to-r from-amber-500 via-orange-600 to-yellow-500 bg-clip-text text-transparent">
Superpowers
</span>
</h1>
- <h2 className="mt-5 text-lg text-gray-600 sm:text-xl">
+ <h2 className="mt-5 text-gray-600 sm:text-xl">
Dub is an open-source link management tool for modern marketing teams to
create, share, and track short links.
</h2>
@@ -31,12 +31,12 @@ const Hero = () => {
<div className="mx-auto mt-10 flex max-w-fit space-x-4">
<Link
href="https://app.dub.sh/register"
- className="rounded-full border border-black bg-black py-2 px-5 text-sm text-white shadow-lg transition-all hover:bg-white hover:text-black"
+ className="rounded-full border border-black bg-black px-5 py-2 text-sm text-white shadow-lg transition-all hover:bg-white hover:text-black"
>
Start For Free
</Link>
<Link
- className="flex items-center justify-center space-x-2 rounded-full border border-gray-300 bg-white py-2 px-5 shadow-lg transition-all hover:border-gray-800"
+ className="flex items-center justify-center space-x-2 rounded-full border border-gray-300 bg-white px-5 py-2 shadow-lg transition-all hover:border-gray-800"
href="https://dub.sh/github"
target="_blank"
rel="noreferrer"
diff --git a/app/ui/home/link-card.tsx b/app/ui/home/link-card.tsx
index 02ab201042..61e4b6ca86 100644
--- a/app/ui/home/link-card.tsx
+++ b/app/ui/home/link-card.tsx
@@ -87,7 +87,7 @@ export default function LinkCard({
const parentNode = cardElem.current.parentNode;
const deleted = isDelete(childNode, parentNode);
if (deleted) {
- toast.success("Link deleted.");
+ toast.success("Link deleted!");
if (setShowDefaultLink) {
setShowDefaultLink(false);
}
diff --git a/app/ui/modal.tsx b/app/ui/modal.tsx
index a4cd846934..ffd48e58c0 100644
--- a/app/ui/modal.tsx
+++ b/app/ui/modal.tsx
@@ -5,7 +5,6 @@ import {
SetStateAction,
useCallback,
useEffect,
- useMemo,
useRef,
} from "react";
import { useRouter } from "next/navigation";
@@ -86,7 +85,7 @@ export default function Modal({
<motion.div
ref={mobileModalRef}
key="mobile-modal"
- className="group fixed inset-x-0 bottom-0 z-40 w-screen cursor-grab active:cursor-grabbing sm:hidden"
+ className="group fixed inset-x-0 bottom-0 z-40 max-h-[80vh] w-screen cursor-grab active:cursor-grabbing md:hidden"
initial={{ y: "100%" }}
animate={controls}
exit={{ y: "100%" }}
@@ -109,7 +108,7 @@ export default function Modal({
<motion.div
ref={desktopModalRef}
key="desktop-modal"
- className="fixed inset-0 z-40 hidden min-h-screen items-center justify-center sm:flex"
+ className="fixed inset-0 z-40 hidden min-h-screen items-center justify-center md:flex"
initial={{ scale: 0.95 }}
animate={{ scale: 1 }}
exit={{ scale: 0.95 }}
diff --git a/app/ui/modals/add-edit-link-modal/index.tsx b/app/ui/modals/add-edit-link-modal/index.tsx
index 1b9f1a5503..f8d64f81b0 100644
--- a/app/ui/modals/add-edit-link-modal/index.tsx
+++ b/app/ui/modals/add-edit-link-modal/index.tsx
@@ -261,21 +261,21 @@ function AddEditLinkModal({
setShowModal={setShowAddEditLinkModal}
closeWithX={homepageDemo ? false : true}
>
- <div className="relative grid max-h-[min(906px,_90vh)] w-full divide-x divide-gray-100 overflow-scroll bg-white shadow-xl transition-all scrollbar-hide sm:max-w-screen-lg sm:grid-cols-2 sm:rounded-2xl sm:border sm:border-gray-200">
+ <div className="relative grid max-h-[80vh] w-full divide-x divide-gray-100 overflow-scroll bg-white shadow-xl transition-all scrollbar-hide md:max-h-[min(906px,_90vh)] md:max-w-screen-lg md:grid-cols-2 md:rounded-2xl md:border md:border-gray-200">
{!hideXButton && !homepageDemo && (
<button
onClick={() => setShowAddEditLinkModal(false)}
- className="group absolute right-0 top-0 z-20 m-3 hidden rounded-full p-2 text-gray-500 transition-all duration-75 hover:bg-gray-100 focus:outline-none active:bg-gray-200 sm:block"
+ className="group absolute right-0 top-0 z-20 m-3 hidden rounded-full p-2 text-gray-500 transition-all duration-75 hover:bg-gray-100 focus:outline-none active:bg-gray-200 md:block"
>
<X className="h-5 w-5" />
</button>
)}
<div
- className="rounded-l-2xl sm:max-h-[min(906px,_90vh)] sm:overflow-scroll"
+ className="rounded-l-2xl md:max-h-[min(906px,_90vh)] md:overflow-scroll"
onScroll={handleScroll}
>
- <div className="z-10 flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 pb-8 pt-8 transition-all sm:sticky sm:top-0 sm:px-16">
+ <div className="z-10 flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 pb-8 pt-8 transition-all md:sticky md:top-0 md:px-16">
<BlurImage
src={logo}
alt="Logo"
@@ -363,7 +363,7 @@ function AddEditLinkModal({
}}
className="grid gap-6 bg-gray-50 pt-8"
>
- <div className="grid gap-6 px-4 sm:px-16">
+ <div className="grid gap-6 px-4 md:px-16">
<div>
<div className="flex items-center justify-between">
<label
@@ -507,7 +507,7 @@ function AddEditLinkModal({
{/* Divider */}
<div className="relative py-5">
<div
- className="absolute inset-0 flex items-center px-4 sm:px-16"
+ className="absolute inset-0 flex items-center px-4 md:px-16"
aria-hidden="true"
>
<div className="w-full border-t border-gray-300" />
@@ -519,7 +519,7 @@ function AddEditLinkModal({
</div>
</div>
- <div className="grid gap-5 px-4 sm:px-16">
+ <div className="grid gap-5 px-4 md:px-16">
<OGSection
{...{ props, data, setData }}
generatingMetatags={generatingMetatags}
@@ -533,8 +533,8 @@ function AddEditLinkModal({
<div
className={`${
- atBottom ? "" : "sm:shadow-[0_-20px_30px_-10px_rgba(0,0,0,0.1)]"
- } z-10 bg-gray-50 px-4 py-8 transition-all sm:sticky sm:bottom-0 sm:px-16`}
+ atBottom ? "" : "md:shadow-[0_-20px_30px_-10px_rgba(0,0,0,0.1)]"
+ } z-10 bg-gray-50 px-4 py-8 transition-all md:sticky md:bottom-0 md:px-16`}
>
{homepageDemo ? (
<Button
@@ -551,7 +551,7 @@ function AddEditLinkModal({
</div>
</form>
</div>
- <div className="rounded-r-2xl sm:max-h-[min(906px,_90vh)] sm:overflow-scroll">
+ <div className="rounded-r-2xl md:max-h-[min(906px,_90vh)] md:overflow-scroll">
<Preview data={data} generatingMetatags={generatingMetatags} />
</div>
</div>
@@ -605,7 +605,7 @@ function AddEditLinkButton({
>
<div className="flex cursor-not-allowed items-center space-x-3 rounded-md border border-gray-200 px-3 py-2 text-sm font-medium text-gray-300">
<p>Create link</p>
- <kbd className="hidden rounded bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-300 sm:inline-block">
+ <kbd className="hidden rounded bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-300 md:inline-block">
C
</kbd>
</div>
@@ -616,7 +616,7 @@ function AddEditLinkButton({
className="group flex items-center space-x-3 rounded-md border border-black bg-black px-3 py-2 text-sm font-medium text-white transition-all duration-75 hover:bg-white hover:text-black active:scale-95"
>
<p>Create link</p>
- <kbd className="hidden rounded bg-zinc-700 px-2 py-0.5 text-xs font-light text-gray-400 transition-all duration-75 group-hover:bg-gray-100 group-hover:text-gray-500 sm:inline-block">
+ <kbd className="hidden rounded bg-zinc-700 px-2 py-0.5 text-xs font-light text-gray-400 transition-all duration-75 group-hover:bg-gray-100 group-hover:text-gray-500 md:inline-block">
C
</kbd>
</button>
diff --git a/app/ui/stats/index.tsx b/app/ui/stats/index.tsx
index 7e235f3b47..a66eacc0ba 100644
--- a/app/ui/stats/index.tsx
+++ b/app/ui/stats/index.tsx
@@ -106,7 +106,7 @@ export default function Stats({
<Toggle />
<div className="mx-auto grid max-w-4xl gap-5">
<Clicks />
- <div className="grid grid-cols-1 gap-5 sm:grid-cols-2">
+ <div className="grid grid-cols-1 gap-5 md:grid-cols-2">
<Locations />
<Devices />
<Referer />
diff --git a/app/ui/stats/toggle.tsx b/app/ui/stats/toggle.tsx
index 76f08521f1..7ed3acd4f5 100644
--- a/app/ui/stats/toggle.tsx
+++ b/app/ui/stats/toggle.tsx
@@ -33,12 +33,12 @@ export default function Toggle() {
return (
<div
className={`z-20 mb-5 ${
- basePath.startsWith("/stats") ? "top-16" : "top-[6.95rem]"
- } sticky bg-gray-50 py-3 sm:py-5 ${scrolled ? "shadow-md" : ""}`}
+ basePath.startsWith("/stats") ? "top-0 md:top-16" : "top-[6.95rem]"
+ } sticky bg-gray-50 py-3 md:py-5 ${scrolled ? "shadow-md" : ""}`}
>
- <div className="mx-auto flex max-w-4xl flex-col items-center justify-between space-y-3 px-2.5 sm:flex-row sm:space-y-0 lg:px-0">
+ <div className="mx-auto flex max-w-4xl flex-col items-center justify-between space-y-3 px-2.5 md:flex-row md:space-y-0 lg:px-0">
<a
- className="group flex text-lg font-semibold text-gray-800 sm:text-xl"
+ className="group flex text-lg font-semibold text-gray-800 md:text-xl"
href={linkConstructor({ key, domain })}
target="_blank"
rel="noreferrer"
@@ -72,7 +72,7 @@ export default function Toggle() {
>
<button
onClick={() => setOpenDatePopover(!openDatePopover)}
- className="flex w-full items-center justify-between space-x-2 rounded-md bg-white px-3 py-2.5 shadow transition-all duration-75 hover:shadow-md active:scale-95 sm:w-48"
+ className="flex w-full items-center justify-between space-x-2 rounded-md bg-white px-3 py-2.5 shadow transition-all duration-75 hover:shadow-md active:scale-95 md:w-48"
>
<IconMenu
text={selectedInterval.display}
@@ -136,7 +136,7 @@ const SharePopover = () => {
return (
<Popover
content={
- <div className="w-full divide-y divide-gray-200 text-sm sm:w-60">
+ <div className="w-full divide-y divide-gray-200 text-sm md:w-60">
<div className="p-4">
<p className="text-gray-500">Share stats for</p>
<p className="truncate font-semibold text-gray-800">
diff --git a/components/shared/copy-button.tsx b/components/shared/copy-button.tsx
index f7caa06481..a324c8e15a 100644
--- a/components/shared/copy-button.tsx
+++ b/components/shared/copy-button.tsx
@@ -10,7 +10,7 @@ export default function CopyButton({ url }: { url: string }) {
e.stopPropagation();
setCopied(true);
navigator.clipboard.writeText(url).then(() => {
- toast.success("Copied shortlink to clipboard");
+ toast.success("Copied shortlink to clipboard!");
});
setTimeout(() => setCopied(false), 3000);
}}