feat: title cards linked to title pages
This commit is contained in:
parent
98178731b9
commit
de22dbfb50
4 changed files with 13 additions and 12 deletions
|
|
@ -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 && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue