Skip to content

Commit 86bc664

Browse files
author
CodeJudge
committed
feat: 标签可点击搜索
1 parent bcae7e1 commit 86bc664

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/src/components/ProblemCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ export default function ProblemCard({ problem }: { problem: Problem }) {
9494
{tags.map((tag) => (
9595
<span
9696
key={tag}
97-
className="px-2 py-0.5 rounded-md text-xs bg-dark-700/50 text-dark-400 border border-dark-600/50"
97+
onClick={(e) => { e.preventDefault(); window.location.href = `/problems?search=${encodeURIComponent(tag)}`; }}
98+
className="px-2 py-0.5 rounded-md text-xs bg-dark-700/50 text-dark-400 border border-dark-600/50 cursor-pointer hover:bg-dark-700 hover:text-dark-200 transition-colors"
9899
>
99100
{tag}
100101
</span>

0 commit comments

Comments
 (0)