单词列表改紧凑网格(一行2-3个),不再一行一个占空间
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
566d80311a
commit
b63ccdfa9e
+18
-13
@@ -136,34 +136,39 @@ export function WordDayClient({
|
||||
<span className="text-xs text-muted-foreground">已学 {learnedSet.size}/{items.length}</span>
|
||||
</header>
|
||||
|
||||
<div className="space-y-2">
|
||||
<div className="grid grid-cols-2 gap-2 sm:grid-cols-3">
|
||||
{items.map((it) => {
|
||||
const done = learnedSet.has(it.word);
|
||||
return (
|
||||
<div key={it.word} className="rounded-xl border border-slate-100 bg-white p-3 shadow-soft">
|
||||
<div className="flex items-center gap-2">
|
||||
<button type="button" onClick={() => speak(it.word)} className="text-indigo-600" title="发音">
|
||||
<Volume2 className="size-5" />
|
||||
<div key={it.word} className="rounded-xl border border-slate-100 bg-white p-2.5 shadow-soft">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<button type="button" onClick={() => speak(it.word)} className="shrink-0 text-indigo-600" title="发音">
|
||||
<Volume2 className="size-4" />
|
||||
</button>
|
||||
<button type="button" onClick={() => openDetail(it.word)} className="text-left">
|
||||
<span className="text-base font-bold text-slate-900">{it.word}</span>
|
||||
<button type="button" onClick={() => openDetail(it.word)} className="min-w-0 flex-1 truncate text-left text-sm font-bold text-slate-900">
|
||||
{it.word}
|
||||
</button>
|
||||
<span className="ml-1 flex-1 truncate text-sm text-muted-foreground">{it.meaning}</span>
|
||||
<RecordBtn day={day} word={it.word} />
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => toggleLearn(it.word)}
|
||||
className={cn(
|
||||
"flex size-8 shrink-0 items-center justify-center rounded-full border-2",
|
||||
"flex size-6 shrink-0 items-center justify-center rounded-full border-2",
|
||||
done ? "border-transparent bg-gradient-to-br from-emerald-400 to-emerald-600 text-white" : "border-slate-300",
|
||||
)}
|
||||
title="学会"
|
||||
>
|
||||
{done && <Check className="size-4" strokeWidth={3} />}
|
||||
{done && <Check className="size-3.5" strokeWidth={3} />}
|
||||
</button>
|
||||
</div>
|
||||
<p className="mt-1 truncate text-xs text-muted-foreground">{it.meaning}</p>
|
||||
<div className="mt-1.5 flex items-center justify-between">
|
||||
<RecordBtn day={day} word={it.word} />
|
||||
<button type="button" onClick={() => openDetail(it.word)} className="text-xs text-indigo-600">
|
||||
详情
|
||||
</button>
|
||||
</div>
|
||||
{open === it.word && (
|
||||
<div className="mt-2 space-y-1 rounded-lg bg-slate-50 p-2 text-sm">
|
||||
<div className="mt-2 space-y-1 rounded-lg bg-slate-50 p-2 text-xs">
|
||||
<p className="text-slate-800">
|
||||
<span className="font-medium text-indigo-600">释义:</span>
|
||||
{it.meaning || "见例句"}
|
||||
@@ -174,7 +179,7 @@ export function WordDayClient({
|
||||
</p>
|
||||
<p className="text-slate-700">
|
||||
<span className="font-medium text-indigo-600">形近词:</span>
|
||||
{it.similar.map((s) => `${s.word}(${s.meaning})`).join("、") || "无"}
|
||||
{it.similar.map((s) => s.word).join("、") || "无"}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user