feat: title cards linked to title pages

This commit is contained in:
nihonium 2025-11-27 10:01:52 +03:00
parent 98178731b9
commit de22dbfb50
Signed by: nihonium
GPG key ID: 0251623741027CFC
4 changed files with 13 additions and 12 deletions

View file

@ -7,6 +7,7 @@ import { TitleCardSquare } from "../../components/cards/TitleCardSquare";
import { TitleCardHorizontal } from "../../components/cards/TitleCardHorizontal";
import type { CursorObj, Title, TitleSort } from "../../api";
import { LayoutSwitch } from "../../components/LayoutSwitch/LayoutSwitch";
import { Link } from "react-router-dom";
const PAGE_SIZE = 10;
@ -135,11 +136,11 @@ const handleLoadMore = async () => {
hasMore={!!cursor || nextPage.length > 1}
loadingMore={loadingMore}
onLoadMore={handleLoadMore}
renderItem={(title, layout) =>
layout === "square"
? <TitleCardSquare title={title} />
: <TitleCardHorizontal title={title} />
}
renderItem={(title, layout) => (
<Link to={`/titles/${title.id}`} key={title.id} className="block">
{layout === "square" ? <TitleCardSquare title={title} /> : <TitleCardHorizontal title={title} />}
</Link>
)}
/>
{!cursor && nextPage.length == 0 && (