fix: simplify desktop search panel
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 25s

This commit is contained in:
TerryM
2026-05-31 03:21:23 +08:00
parent 345ccb0a25
commit c71ebba807
2 changed files with 54 additions and 53 deletions

View File

@@ -361,41 +361,45 @@ export function SearchPanel({
</section>
) : null}
<section className={cleanQuery ? "mt-6" : showInput ? "mt-5" : "mt-0"}>
<div className="mb-3 flex items-center justify-between">
<h2 className="border-l-4 border-ark-gold pl-3 text-base font-bold text-neutral-100">
{t("currentTags")}
</h2>
</div>
{!cleanQuery ? (
<section className={showInput ? "mt-5" : "mt-0"}>
<div className="mb-3 flex items-center justify-between">
<h2 className="border-l-4 border-ark-gold pl-3 text-base font-bold text-neutral-100">
{t("currentTags")}
</h2>
</div>
{isTagLoading ? (
<div className="py-3 text-sm text-neutral-500">{t("loading")}</div>
) : tags.length > 0 ? (
<div className="flex flex-wrap gap-2">
{tags.map((tag) => {
const active = selectedTag === tag.name;
return (
<button
key={tag.name}
type="button"
onClick={() => showTagPosts(tag.name)}
className={`rounded-full border px-3 py-1.5 text-xs font-bold transition ${
active
? "border-ark-gold bg-ark-gold/15 text-ark-gold"
: "border-white/10 bg-[#232329] text-neutral-200 hover:border-ark-gold/60 hover:text-ark-gold"
}`}
>
#{tag.name}
</button>
);
})}
</div>
) : (
<div className="py-3 text-sm text-neutral-500">
{t("noTagsAvailable")}
</div>
)}
</section>
{isTagLoading ? (
<div className="py-3 text-sm text-neutral-500">
{t("loading")}
</div>
) : tags.length > 0 ? (
<div className="flex flex-wrap gap-2">
{tags.map((tag) => {
const active = selectedTag === tag.name;
return (
<button
key={tag.name}
type="button"
onClick={() => showTagPosts(tag.name)}
className={`rounded-full border px-3 py-1.5 text-xs font-bold transition ${
active
? "border-ark-gold bg-ark-gold/15 text-ark-gold"
: "border-white/10 bg-[#232329] text-neutral-200 hover:border-ark-gold/60 hover:text-ark-gold"
}`}
>
#{tag.name}
</button>
);
})}
</div>
) : (
<div className="py-3 text-sm text-neutral-500">
{t("noTagsAvailable")}
</div>
)}
</section>
) : null}
{selectedTag ? (
<section className="mt-6">