clipwright/dashboard/src/components/TrialGate.jsx
juancarlos.cavero 3709d64085 feat(dashboard): make the app usable on a phone
The dashboard was a desktop layout that merely survived a narrow viewport.
The changes below are interface only; no backend behaviour, request shape or
data changes.

Navigation. Below md the 80px icon rail is gone. It cost a fifth of a 360px
screen to show seven unlabelled glyphs. In its place: a bottom tab bar with
the four everyday destinations plus "more", and a drawer behind the header's
menu button carrying the full list. All three surfaces read one `navItems`
array, so they cannot drift. The tab bar is a flex sibling of the scrolling
pane rather than a fixed overlay, so no pane needs compensating padding and
nothing hides behind it. The header gains the section name the rail used to
carry, so a phone still knows where it is.

Shell. h-dvh where supported (100vh hides its own bottom bar behind mobile
browser chrome), body overflow-x hidden, and safe-area padding for the iOS
home indicator via viewport-fit=cover.

Touch and legibility. Inputs render at 16px below sm so iOS stops zooming on
focus and never zooming back; the shared button pills get a 44px floor on
coarse pointers; the 10.5px mono labels come up to 11.5px on phones.

Density. The clip-generator hero no longer fills the fold on its own. The log
terminal starts collapsed on phones. Result cards cap the 9:16 preview so the
title, captions and actions stay on the same screen as the clip. Modals become
bottom sheets below sm — a centred dialog with 4px side margins was wasting the
only width there was. Banners, the results toolbar and the social nudge stack
instead of crushing.

Also fixes three <div>-inside-<p> blocks in Settings that the browser was
silently tearing apart.
2026-08-24 02:25:24 +02:00

26 lines
1.3 KiB
JavaScript

import React from 'react';
import { Sparkles, ArrowRight } from 'lucide-react';
// Slim, non-blocking banner shown above a tool when a hosted user has no
// entitlement. Google-authed users get the free plan automatically, so this
// only fires for signed-out or magic-link-only accounts.
export default function TrialGate({ toolName = 'this' }) {
return (
<div className="card mx-3 sm:mx-6 mt-3 px-3.5 sm:px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-3 sm:gap-4 shrink-0 animate-fade">
<div className="flex items-start sm:items-center gap-2.5 sm:gap-3 text-sm min-w-0">
<Sparkles size={16} className="shrink-0 text-brass mt-0.5 sm:mt-0" />
<div className="text-ink2 lowercase leading-relaxed min-w-0">
<span className="font-medium text-ink">Preview mode.</span>{' '}
Sign in with <span className="font-medium text-ink">Google</span> to use {toolName} free —
20 min/month, no credit card. <span className="text-muted">Or run it free by self-hosting.</span>
</div>
</div>
<button
onClick={() => { window.location.hash = '#/pricing'; }}
className="btn-primary shrink-0 text-xs px-4 py-2 w-full sm:w-auto"
>
Start free <ArrowRight size={14} />
</button>
</div>
);
}