Skip to content

Commit f84d10d

Browse files
committed
Remove right padding from Stats header on mobile
Removes pr-12 and md:pr-0 padding classes to allow the Share button to sit flush right under the settings gear on mobile devices.
1 parent 5f03735 commit f84d10d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎app/sharebtn.png‎

35 KB
Loading

‎app/src/Stats.jsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,18 @@ export default function Stats({ summary, activity, books }) {
219219
return (
220220
<div className="px-4 pt-6 pb-4 md:px-8 md:pt-6 lg:px-12">
221221
<Eyebrow className="md:hidden">Reading stats</Eyebrow>
222-
<div className="flex items-center justify-between gap-4 pr-12 md:pr-0">
222+
{/* Share sits flush right, under the settings gear on phones. */}
223+
<div className="flex items-end justify-between gap-4 md:items-center">
223224
<h1 className="mt-1 font-display text-3xl font-semibold tracking-tight text-stone-900 md:mt-0 md:flex md:h-11 md:items-center md:text-4xl">How you read</h1>
224225
{activity && (
225226
<button
226227
onClick={() => setSharing(true)}
227-
className="flex h-10 shrink-0 items-center gap-1.5 rounded-full bg-white px-4 text-sm font-semibold text-brand-700 ring-1 ring-stone-950/10 active:bg-stone-100"
228+
aria-label="Share stats"
229+
className="-mr-1 grid size-11 shrink-0 translate-y-3 place-items-center rounded-full text-brand-600 active:bg-stone-200/70 md:mr-0 md:flex md:h-10 md:w-auto md:translate-y-0 md:gap-1.5 md:bg-white md:px-4 md:text-sm md:font-semibold md:text-brand-700 md:ring-1 md:ring-stone-950/10"
228230
>
229-
<Share2 className="size-4" /> Share
231+
{/* Phones: an icon stacked under the settings gear. Wider screens: a labelled pill. */}
232+
<Share2 className="size-6 md:size-4" strokeWidth={1.75} />
233+
<span className="hidden md:inline">Share</span>
230234
</button>
231235
)}
232236
</div>

0 commit comments

Comments
 (0)