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.

Mobile drawer usability improvements (#3268)

Marcus Farrell381530aa2312
diff --git a/apps/web/ui/layout/sidebar/partner-program-dropdown.tsx b/apps/web/ui/layout/sidebar/partner-program-dropdown.tsx
index 65bddea6d3..8c5b9656ae 100644
--- a/apps/web/ui/layout/sidebar/partner-program-dropdown.tsx
+++ b/apps/web/ui/layout/sidebar/partner-program-dropdown.tsx
@@ -81,12 +81,12 @@ export function PartnerProgramDropdown() {
<Link
href="/programs"
className={cn(
- "flex items-center gap-x-2.5 rounded-md px-2.5 py-2 text-sm transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80",
+ "flex items-center gap-x-2.5 rounded-md px-2.5 py-2 text-base transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80 sm:text-sm",
"outline-none focus-visible:ring-2 focus-visible:ring-black/50",
)}
onClick={() => setOpenPopover(false)}
>
- <GridIcon className="size-4 text-neutral-500" />
+ <GridIcon className="size-5 text-neutral-500 sm:size-4" />
<span className="text-content-default block truncate">
All programs
</span>
@@ -95,12 +95,12 @@ export function PartnerProgramDropdown() {
<Link
href="/programs/marketplace"
className={cn(
- "flex items-center gap-x-2.5 rounded-md px-2.5 py-2 text-sm transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80",
+ "flex items-center gap-x-2.5 rounded-md px-2.5 py-2 text-base transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80 sm:text-sm",
"outline-none focus-visible:ring-2 focus-visible:ring-black/50",
)}
onClick={() => setOpenPopover(false)}
>
- <Shop className="size-4 text-neutral-500" />
+ <Shop className="size-5 text-neutral-500 sm:size-4" />
<span className="text-content-default block truncate">
Marketplace
</span>
@@ -192,7 +192,7 @@ function ProgramList({
<ScrollContainer className="max-h-[min(260px,calc(100vh-300px))]">
<div className="p-2">
<div className="flex items-center justify-between py-2">
- <p className="px-1 text-xs font-medium text-neutral-500">
+ <p className="px-1 text-sm font-medium text-neutral-500 sm:text-xs">
Programs
</p>
</div>
@@ -216,7 +216,7 @@ function ProgramList({
<Link
key={slug}
className={cn(
- "relative flex w-full items-center gap-x-2.5 rounded-md px-2 py-2.5 transition-all duration-75",
+ "relative flex w-full items-center gap-x-2.5 rounded-md py-2.5 pl-2 pr-3 transition-all duration-75",
"active:bg-neutral-200/80 data-[selected=true]:bg-neutral-200/50",
"outline-none focus-visible:ring-2 focus-visible:ring-black/50",
)}
@@ -232,7 +232,7 @@ function ProgramList({
alt={name}
className="size-5 shrink-0 overflow-hidden rounded-full border border-black/10"
/>
- <span className="block min-w-0 grow truncate text-sm leading-5 text-neutral-800">
+ <span className="block min-w-0 grow truncate text-base leading-5 text-neutral-800 sm:text-sm">
{name}
</span>
{selectedProgram?.slug === slug ? (
@@ -244,7 +244,7 @@ function ProgramList({
</Link>
</Command.Item>
))}
- <Command.Empty className="p-1 text-xs text-neutral-400">
+ <Command.Empty className="p-1 text-sm text-neutral-400">
No programs found
</Command.Empty>
</Command.List>
diff --git a/apps/web/ui/layout/sidebar/user-dropdown.tsx b/apps/web/ui/layout/sidebar/user-dropdown.tsx
index ffc84490ef..d09997e587 100644
--- a/apps/web/ui/layout/sidebar/user-dropdown.tsx
+++ b/apps/web/ui/layout/sidebar/user-dropdown.tsx
@@ -88,11 +88,11 @@ export function UserDropdown() {
content={
<div className="flex w-full flex-col space-y-px rounded-md bg-white p-2 sm:min-w-56">
{session?.user ? (
- <div className="p-2">
- <p className="truncate text-sm font-medium text-neutral-900">
+ <div className="px-2 pb-4 sm:pb-2">
+ <p className="truncate text-base font-medium text-neutral-900 sm:text-sm">
{session.user.name || session.user.email?.split("@")[0]}
</p>
- <p className="truncate text-sm text-neutral-500">
+ <p className="truncate text-base text-neutral-500 sm:text-sm">
{session.user.email}
</p>
</div>
@@ -154,10 +154,10 @@ function UserOption<T extends ElementType = "button">({
return (
<Component
- className="flex items-center gap-x-4 rounded-md px-2.5 py-1.5 text-sm transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80"
+ className="flex items-center gap-x-4 rounded-md px-2.5 py-1.5 text-base transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80 sm:text-sm"
{...rest}
>
- <Icon className="size-4 text-neutral-500" />
+ <Icon className="size-5 text-neutral-500 sm:size-4" />
<span className="block truncate text-neutral-600">{label}</span>
{children}
</Component>
diff --git a/apps/web/ui/layout/sidebar/workspace-dropdown.tsx b/apps/web/ui/layout/sidebar/workspace-dropdown.tsx
index 9b4543f4ae..cbe8d588ec 100644
--- a/apps/web/ui/layout/sidebar/workspace-dropdown.tsx
+++ b/apps/web/ui/layout/sidebar/workspace-dropdown.tsx
@@ -174,24 +174,24 @@ function WorkspaceList({
className="w-xs max-h-84 relative w-full overflow-auto rounded-xl bg-white text-base sm:w-72 sm:text-sm"
>
{/* Current workspace section */}
- <div className="flex flex-col gap-2.5 border-b border-neutral-200 p-3">
+ <div className="flex flex-col gap-2.5 border-b border-neutral-200 px-3 pb-3 sm:p-3">
<div className="flex items-center gap-x-2.5">
<BlurImage
src={selected.image}
width={28}
height={28}
alt={selected.name}
- className="size-8 shrink-0 overflow-hidden rounded-full"
+ className="size-9 shrink-0 overflow-hidden rounded-full sm:size-8"
draggable={false}
/>
<div className="min-w-0">
- <div className="truncate text-sm font-medium leading-5 text-neutral-900">
+ <div className="truncate text-base font-medium leading-5 text-neutral-900 sm:text-sm">
{selected.name}
</div>
{selected.slug && (
<div
className={cn(
- "truncate text-xs capitalize leading-tight",
+ "truncate text-sm capitalize leading-tight sm:text-xs",
getPlanColor(selected.plan),
)}
>
@@ -254,7 +254,7 @@ function WorkspaceList({
className="size-5 shrink-0 overflow-hidden rounded-full"
draggable={false}
/>
- <span className="block truncate text-sm leading-5 text-neutral-900 sm:max-w-[140px]">
+ <span className="block truncate text-base leading-5 text-neutral-900 sm:max-w-[140px] sm:text-sm">
{name}
</span>
{selected.slug === slug ? (
diff --git a/packages/ui/src/popover.tsx b/packages/ui/src/popover.tsx
index 94b644cc88..c066f926d5 100644
--- a/packages/ui/src/popover.tsx
+++ b/packages/ui/src/popover.tsx
@@ -64,7 +64,7 @@ export function Popover({
<div className="sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit">
<div className="bg-border-default my-3 h-1 w-12 rounded-full" />
</div>
- <div className="bg-bg-default flex min-h-[150px] w-full items-center justify-center overflow-hidden pb-8 align-middle shadow-xl">
+ <div className="bg-bg-default flex w-full items-center justify-center overflow-hidden pb-4 align-middle shadow-xl">
{content}
</div>
</Drawer.Content>