Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export default function SearchResultsPage({
</div>
) : (
<ul className="grid list-none grid-cols-1 gap-6 p-0 md:grid-cols-2 lg:grid-cols-3">
{items.map((it) => (
{items.map((it, index) => (
<li key={it.id} className="list-none">
<HeritageCard item={it} onClickItem={onClickItem} />
<HeritageCard item={it} onClickItem={onClickItem} isPriority={index < 3} />
</li>
))}
</ul>
Expand Down
8 changes: 7 additions & 1 deletion client/src/app/features/top/cards/HeritageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { useText } from "@shared/locale/ui-text.ts";
export function HeritageCard({
item,
onClickItem,
isPriority = false,
}: {
item: WorldHeritageVm;
onClickItem?: (id: number) => void;
isPriority?: boolean;
}) {
const text = useText();

Expand All @@ -25,7 +27,11 @@ export function HeritageCard({
src={item.thumbnailUrl}
alt={title}
referrerPolicy="no-referrer"
loading="lazy"
loading={isPriority ? "eager" : "lazy"}
fetchPriority={isPriority ? "high" : "auto"}
decoding="async"
width={400}
height={320}
className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
/>
) : (
Expand Down
4 changes: 2 additions & 2 deletions client/src/app/features/top/components/HeritageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export function HeritageList({

return (
<ul className="grid list-none grid-cols-1 gap-6 p-0 md:grid-cols-2 lg:grid-cols-3">
{items.map((it) => (
{items.map((it, index) => (
<li key={it.id} className="list-none">
<HeritageCard item={it} onClickItem={onClickItem} />
<HeritageCard item={it} onClickItem={onClickItem} isPriority={index < 3} />
</li>
))}
</ul>
Expand Down
Loading