fix: resolve click lag on project cards and add home link in headers
This commit is contained in:
@@ -10,8 +10,10 @@ import {
|
|||||||
FileText,
|
FileText,
|
||||||
ChevronRight,
|
ChevronRight,
|
||||||
Building2,
|
Building2,
|
||||||
|
Home,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { DynamicFavicon } from "@/components/DynamicFavicon";
|
import { DynamicFavicon } from "@/components/DynamicFavicon";
|
||||||
@@ -41,6 +43,7 @@ export default function PortalClient({
|
|||||||
organization: Organization;
|
organization: Organization;
|
||||||
folders: FolderType[];
|
folders: FolderType[];
|
||||||
}) {
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
const [searchTerm, setSearchTerm] = useState("");
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
|
|
||||||
const filteredFolders = folders.filter((folder) =>
|
const filteredFolders = folders.filter((folder) =>
|
||||||
@@ -64,7 +67,7 @@ export default function PortalClient({
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<header className="bg-white border-b border-slate-100 sticky top-0 z-10">
|
<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="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 ? (
|
{organization.logoUrl ? (
|
||||||
<img src={organization.logoUrl} alt={organization.name} className="h-8 sm:h-10 object-contain shrink-0" />
|
<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>
|
<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>
|
<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>
|
||||||
</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">
|
<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
|
<span className="hidden sm:inline">Ambiente </span>Seguro
|
||||||
</Badge>
|
</Badge>
|
||||||
@@ -135,10 +138,8 @@ export default function PortalClient({
|
|||||||
initial={{ opacity: 0, y: 10 }}
|
initial={{ opacity: 0, y: 10 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
transition={{ delay: idx * 0.05 }}
|
transition={{ delay: idx * 0.05 }}
|
||||||
>
|
onClick={() => router.push(`/visualizar/pasta/${folder.id}`)}
|
||||||
<Link
|
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"
|
||||||
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"
|
|
||||||
>
|
>
|
||||||
<div className="flex items-start gap-4 mb-4">
|
<div className="flex items-start gap-4 mb-4">
|
||||||
{folder.imageUrl ? (
|
{folder.imageUrl ? (
|
||||||
@@ -176,7 +177,6 @@ export default function PortalClient({
|
|||||||
</div>
|
</div>
|
||||||
<ChevronRight size={16} className="text-slate-300 group-hover:text-red-500 transition-colors" />
|
<ChevronRight size={16} className="text-slate-300 group-hover:text-red-500 transition-colors" />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
|
||||||
</motion.div>
|
</motion.div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default function FolderViewClient({
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<header className="bg-white border-b border-slate-100 sticky top-0 z-10">
|
<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="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 ? (
|
{organization.logoUrl ? (
|
||||||
<img src={organization.logoUrl} alt={organization.name} className="h-8 sm:h-10 object-contain shrink-0" />
|
<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>
|
<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>
|
<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>
|
||||||
</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">
|
<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
|
<span className="hidden sm:inline">Ambiente </span>Seguro
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|||||||
Reference in New Issue
Block a user