fix: resolve click lag on project cards and add home link in headers

This commit is contained in:
Erik Silva
2026-01-21 01:41:41 -03:00
parent 2cd14b3d4d
commit 491bb28d6a
2 changed files with 41 additions and 41 deletions

View File

@@ -10,8 +10,10 @@ import {
FileText,
ChevronRight,
Building2,
Home,
} from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { Badge } from "@/components/ui/badge";
import { Input } from "@/components/ui/input";
import { DynamicFavicon } from "@/components/DynamicFavicon";
@@ -41,6 +43,7 @@ export default function PortalClient({
organization: Organization;
folders: FolderType[];
}) {
const router = useRouter();
const [searchTerm, setSearchTerm] = useState("");
const filteredFolders = folders.filter((folder) =>
@@ -64,7 +67,7 @@ export default function PortalClient({
{/* Header */}
<header className="bg-white border-b border-slate-100 sticky top-0 z-10">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 sm:h-20 flex items-center justify-between">
<div className="flex items-center gap-3 sm:gap-4 min-w-0">
<Link href="/portal" className="flex items-center gap-3 sm:gap-4 min-w-0 hover:opacity-80 transition-opacity">
{organization.logoUrl ? (
<img src={organization.logoUrl} alt={organization.name} className="h-8 sm:h-10 object-contain shrink-0" />
) : (
@@ -76,7 +79,7 @@ export default function PortalClient({
<h1 className="text-xs sm:text-sm font-black text-slate-900 uppercase tracking-tight truncate">{organization.name}</h1>
<p className="text-[9px] sm:text-[10px] font-bold text-slate-400 uppercase tracking-widest hidden sm:block">Portal da Transparência</p>
</div>
</div>
</Link>
<Badge variant="outline" className="border-green-200 bg-green-50 text-green-600 font-bold text-[9px] sm:text-[10px] uppercase py-1 px-2 sm:px-3 shrink-0">
<span className="hidden sm:inline">Ambiente </span>Seguro
</Badge>
@@ -135,10 +138,8 @@ export default function PortalClient({
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: idx * 0.05 }}
>
<Link
href={`/visualizar/pasta/${folder.id}`}
className="block bg-white border border-slate-100 rounded-2xl p-5 sm:p-6 hover:border-slate-200 hover:shadow-lg transition-all group"
onClick={() => router.push(`/visualizar/pasta/${folder.id}`)}
className="cursor-pointer bg-white border border-slate-100 rounded-2xl p-5 sm:p-6 hover:border-slate-200 hover:shadow-lg transition-all group"
>
<div className="flex items-start gap-4 mb-4">
{folder.imageUrl ? (
@@ -176,7 +177,6 @@ export default function PortalClient({
</div>
<ChevronRight size={16} className="text-slate-300 group-hover:text-red-500 transition-colors" />
</div>
</Link>
</motion.div>
))}

View File

@@ -105,7 +105,7 @@ export default function FolderViewClient({
{/* Header */}
<header className="bg-white border-b border-slate-100 sticky top-0 z-10">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 sm:h-20 flex items-center justify-between">
<div className="flex items-center gap-3 sm:gap-4 min-w-0">
<Link href="/portal" className="flex items-center gap-3 sm:gap-4 min-w-0 hover:opacity-80 transition-opacity">
{organization.logoUrl ? (
<img src={organization.logoUrl} alt={organization.name} className="h-8 sm:h-10 object-contain shrink-0" />
) : (
@@ -117,7 +117,7 @@ export default function FolderViewClient({
<h1 className="text-xs sm:text-sm font-black text-slate-900 uppercase tracking-tight truncate">{organization.name}</h1>
<p className="text-[9px] sm:text-[10px] font-bold text-slate-400 uppercase tracking-widest hidden sm:block">Portal da Transparência</p>
</div>
</div>
</Link>
<Badge variant="outline" className="border-green-200 bg-green-50 text-green-600 font-bold text-[9px] sm:text-[10px] uppercase py-1 px-2 sm:px-3 shrink-0">
<span className="hidden sm:inline">Ambiente </span>Seguro
</Badge>