Skip to content

Commit a612e55

Browse files
committed
fix(web): prevent horizontal overflow on mobile
Grid/flex items default to min-width:auto, so the code blocks forced the hero and dashboard/profile grids wider than the viewport, clipping content. Add min-w-0 to the grid items and CodeBlock, plus overflow-x-hidden as a safety net.
1 parent e57c34f commit a612e55

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

apps/web/src/components/CodeBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function CodeBlock({ code, children, label }: CodeBlockProps) {
2323
};
2424

2525
return (
26-
<div className="group relative overflow-hidden rounded-2xl border border-ink-700 bg-ink-950/80">
26+
<div className="group relative min-w-0 max-w-full overflow-hidden rounded-2xl border border-ink-700 bg-ink-950/80">
2727
<div className="flex items-center justify-between border-b border-ink-700/70 px-4 py-2.5">
2828
<div className="flex items-center gap-1.5">
2929
<span className="h-2.5 w-2.5 rounded-full bg-rose-400/70" />

apps/web/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313

1414
body {
15-
@apply bg-ink-950 text-slate-200 font-sans antialiased;
15+
@apply overflow-x-hidden bg-ink-950 text-slate-200 font-sans antialiased;
1616
background-image:
1717
radial-gradient(60rem 60rem at 80% -10%, rgba(45, 212, 191, 0.08), transparent 60%),
1818
radial-gradient(50rem 50rem at -10% 20%, rgba(52, 211, 153, 0.06), transparent 55%);

apps/web/src/pages/Dashboard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function Dashboard() {
4141
</header>
4242

4343
<section className="mt-8 grid gap-6 lg:grid-cols-[1fr_360px]">
44-
<div className="space-y-6">
44+
<div className="min-w-0 space-y-6">
4545
<GenerateKey onAdded={(k) => setKeys((prev) => [...prev, k])} />
4646
<AddKeyForm onAdded={(k) => setKeys((prev) => [...prev, k])} />
4747

@@ -79,7 +79,7 @@ export function Dashboard() {
7979
</div>
8080
</div>
8181

82-
<aside className="space-y-4">
82+
<aside className="min-w-0 space-y-4">
8383
<div className="card p-6">
8484
<h2 className="font-semibold text-white">Your public URL</h2>
8585
<p className="mt-1.5 text-sm text-slate-400">Anyone can resolve your keys from here.</p>

apps/web/src/pages/Landing.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function Hero() {
3636
return (
3737
<section className="relative overflow-hidden">
3838
<div className="container-page grid items-center gap-12 pt-16 pb-12 lg:grid-cols-2 lg:pt-24">
39-
<div className="animate-fade-up">
39+
<div className="min-w-0 animate-fade-up">
4040
<span className="inline-flex items-center gap-2 rounded-full border border-ink-700 bg-ink-900/70 px-3 py-1 text-xs font-medium text-accent-400">
4141
<span className="relative flex h-2 w-2">
4242
<span className="absolute inline-flex h-full w-full animate-pulse-ring rounded-full bg-accent-400" />
@@ -76,7 +76,7 @@ function Hero() {
7676
</p>
7777
</div>
7878

79-
<div className="animate-fade-up [animation-delay:120ms]">
79+
<div className="min-w-0 animate-fade-up [animation-delay:120ms]">
8080
<CodeBlock
8181
label="your terminal"
8282
code={`curl ${PUBLIC_HOST}/${SAMPLE_HANDLE} >> ~/.ssh/authorized_keys`}

apps/web/src/pages/Profile.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function Profile() {
8080
</header>
8181

8282
<div className="mt-8 grid gap-6 lg:grid-cols-[1fr_380px]">
83-
<div className="card">
83+
<div className="card min-w-0">
8484
<div className="flex items-center justify-between border-b border-ink-700/70 px-6 py-4">
8585
<h2 className="font-semibold text-white">Public keys</h2>
8686
<span className="rounded-full bg-ink-800 px-2.5 py-0.5 text-xs text-slate-400">
@@ -113,7 +113,7 @@ export function Profile() {
113113
)}
114114
</div>
115115

116-
<aside className="space-y-4">
116+
<aside className="min-w-0 space-y-4">
117117
<CodeBlock label="add to a server" code={`curl -fsSL ${PUBLIC_HOST}/${profile.handle} >> ~/.ssh/authorized_keys`}>
118118
<span className="text-accent-400">curl</span> -fsSL {PUBLIC_HOST}/{profile.handle}{' '}
119119
<span className="text-slate-300">&gt;&gt;</span> ~/.ssh/authorized_keys

0 commit comments

Comments
 (0)