Polish: link buttons, theme-aware dark variant, assistant drawer overlay, sticky draft bar
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
aed14cd04f
commit
c549c34f60
13 changed files with 60 additions and 66 deletions
|
|
@ -230,19 +230,15 @@ export default function ClassPage() {
|
|||
const z = item as QuizItem;
|
||||
if (z.activeAttemptId)
|
||||
return (
|
||||
<Link to={`/session/${z.activeAttemptId}`}>
|
||||
<Button size="sm" variant="marker" icon={<Play className="fill-current" />}>
|
||||
<Button to={`/session/${z.activeAttemptId}`} size="sm" variant="marker" icon={<Play className="fill-current" />}>
|
||||
Resume
|
||||
</Button>
|
||||
</Link>
|
||||
);
|
||||
if (z.questionCount > 0)
|
||||
return (
|
||||
<Link to={`/quizzes/${z.id}?start=1`}>
|
||||
<Button size="sm" icon={<Play className="fill-current" />}>
|
||||
<Button to={`/quizzes/${z.id}?start=1`} size="sm" icon={<Play className="fill-current" />}>
|
||||
Start
|
||||
</Button>
|
||||
</Link>
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
|
@ -250,17 +246,13 @@ export default function ClassPage() {
|
|||
const d = item as DeckItem;
|
||||
if (d.dueCount + Math.min(d.newCount, 20) > 0 && d.cardCount > 0)
|
||||
return (
|
||||
<Link to={`/review?deckId=${d.id}`}>
|
||||
<Button size="sm" variant={d.dueCount > 0 ? 'marker' : 'secondary'} icon={<Play className="fill-current" />}>
|
||||
<Button to={`/review?deckId=${d.id}`} size="sm" variant={d.dueCount > 0 ? 'marker' : 'secondary'} icon={<Play className="fill-current" />}>
|
||||
{d.dueCount > 0 ? `Review ${d.dueCount}` : 'Learn'}
|
||||
</Button>
|
||||
</Link>
|
||||
);
|
||||
if (d.cardCount > 0)
|
||||
return (
|
||||
<Link to={`/decks/${d.id}/cram`}>
|
||||
<Button size="sm">Browse</Button>
|
||||
</Link>
|
||||
<Button to={`/decks/${d.id}/cram`} size="sm">Browse</Button>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
|
@ -479,11 +471,9 @@ export default function ClassPage() {
|
|||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{data.due.total > 0 && (
|
||||
<Link to={`/review?classId=${cls.id}`}>
|
||||
<Button variant="marker" icon={<Play className="fill-current" />}>
|
||||
<Button to={`/review?classId=${cls.id}`} variant="marker" icon={<Play className="fill-current" />}>
|
||||
Review {data.due.total}
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
<Button icon={<Sparkles />} onClick={() => setGenerate({})}>
|
||||
Generate
|
||||
|
|
|
|||
|
|
@ -154,16 +154,12 @@ export default function DeckPage() {
|
|||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Link to={`/review?deckId=${deck.id}`} aria-disabled={!canStudy} className={cx(!canStudy && 'pointer-events-none')}>
|
||||
<Button variant={canStudy ? 'primary' : 'secondary'} size="lg" icon={<Play className="fill-current" />} disabled={!canStudy}>
|
||||
<Button to={`/review?deckId=${deck.id}`} variant={canStudy ? 'primary' : 'secondary'} size="lg" icon={<Play className="fill-current" />} disabled={!canStudy}>
|
||||
{canStudy ? `Review ${due.total}` : 'Nothing due'}
|
||||
</Button>
|
||||
</Link>
|
||||
<Link to={`/decks/${deck.id}/cram`} className={cx(cards.length === 0 && 'pointer-events-none')}>
|
||||
<Button size="lg" icon={<Layers />} disabled={cards.length === 0}>
|
||||
<Button to={`/decks/${deck.id}/cram`} size="lg" icon={<Layers />} disabled={cards.length === 0}>
|
||||
{data.session ? 'Continue browsing' : 'Browse all'}
|
||||
</Button>
|
||||
</Link>
|
||||
<Menu
|
||||
trigger={
|
||||
<IconButton label="Deck options" tooltip={false}>
|
||||
|
|
|
|||
|
|
@ -215,9 +215,7 @@ export default function DocumentPage() {
|
|||
Read with AI
|
||||
</Button>
|
||||
) : (
|
||||
<Link to="/settings/ai">
|
||||
<Button size="sm">Set up AI</Button>
|
||||
</Link>
|
||||
<Button to="/settings/ai" size="sm">Set up AI</Button>
|
||||
)
|
||||
}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ export default function DraftPage() {
|
|||
const canSave = errors.length === 0 && (mode === 'new' ? Boolean(classId) : Boolean(targetId));
|
||||
|
||||
return (
|
||||
<div className="animate-in pb-28">
|
||||
<div className="animate-in">
|
||||
<header className="mb-6">
|
||||
<div className="eyebrow mb-2 flex flex-wrap items-center gap-2">
|
||||
<span className="flex items-center gap-1.5 [&>svg]:size-3.5">
|
||||
|
|
@ -487,8 +487,8 @@ export default function DraftPage() {
|
|||
)}
|
||||
|
||||
{/* save bar */}
|
||||
<div className="safe-bottom fixed inset-x-0 bottom-14 z-30 border-t border-line bg-paper/95 backdrop-blur lg:bottom-0 lg:left-[252px]">
|
||||
<div className="mx-auto flex h-16 max-w-[1080px] items-center gap-2 px-4 sm:px-8">
|
||||
<div className="sticky bottom-14 z-20 -mx-4 mt-8 border-t border-line bg-paper/95 backdrop-blur sm:-mx-8 lg:bottom-0">
|
||||
<div className="flex h-16 items-center gap-2 px-4 sm:px-8">
|
||||
<div className="min-w-0 flex-1 text-[13px]" aria-live="polite">
|
||||
{errors.length > 0 ? (
|
||||
<span className="flex items-center gap-1.5 font-medium text-bad">
|
||||
|
|
|
|||
|
|
@ -152,11 +152,9 @@ export default function Home() {
|
|||
</div>
|
||||
<div className="mt-5 flex flex-wrap gap-2">
|
||||
{due > 0 ? (
|
||||
<Link to="/review">
|
||||
<Button variant="primary" size="lg" icon={<Play className="fill-current" />}>
|
||||
<Button to="/review" variant="primary" size="lg" icon={<Play className="fill-current" />}>
|
||||
Start review
|
||||
</Button>
|
||||
</Link>
|
||||
) : null}
|
||||
{o.missedCount > 0 && (
|
||||
<Button size="lg" icon={<RotateCcw />} loading={starting} onClick={() => start({ source: { type: 'missed' }, count: Math.min(20, o.missedCount) })}>
|
||||
|
|
|
|||
|
|
@ -409,11 +409,9 @@ export default function QuizPage() {
|
|||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{data.activeAttempt ? (
|
||||
<Link to={`/session/${data.activeAttempt.id}`}>
|
||||
<Button variant="marker" size="lg" icon={<Play className="fill-current" />}>
|
||||
<Button to={`/session/${data.activeAttempt.id}`} variant="marker" size="lg" icon={<Play className="fill-current" />}>
|
||||
Resume ({data.activeAttempt.answeredCount}/{data.activeAttempt.questionCount})
|
||||
</Button>
|
||||
</Link>
|
||||
) : null}
|
||||
<Button variant={data.activeAttempt ? 'secondary' : 'primary'} size="lg" icon={<Play className="fill-current" />} disabled={questions.length === 0} onClick={() => setStartOpen(true)}>
|
||||
{data.activeAttempt ? 'Start new' : 'Start'}
|
||||
|
|
|
|||
|
|
@ -319,11 +319,9 @@ function SharedDocument({ doc, token }: { doc: PublicDocument; token: string })
|
|||
{doc.filename} · {formatBytes(doc.size)}
|
||||
{doc.pageCount ? ` · ${plural(doc.pageCount, 'page')}` : ''}
|
||||
</p>
|
||||
<a href={url} download={inline ? undefined : doc.filename} target={inline ? '_blank' : undefined} rel="noreferrer" className="mt-5 inline-block">
|
||||
<Button variant="primary" size="lg" icon={<Download />}>
|
||||
{inline ? 'Open file' : 'Download'}
|
||||
</Button>
|
||||
</a>
|
||||
<Button href={url} download={inline ? undefined : doc.filename} target={inline ? '_blank' : undefined} variant="primary" size="lg" icon={<Download />} className="mt-5">
|
||||
{inline ? 'Open file' : 'Download'}
|
||||
</Button>
|
||||
{doc.docKind === 'image' && <img src={url} alt={doc.title} className="card mt-6 max-w-full p-2" />}
|
||||
{doc.docKind === 'pdf' && <iframe src={url} title={doc.title} className="card mt-6 hidden h-[78vh] w-full sm:block" />}
|
||||
</Frame>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue