From 359669198199f92e9e8130a46fef0fc088873caf Mon Sep 17 00:00:00 2001 From: Kevin Stadler Date: Wed, 9 Oct 2024 14:56:13 +0200 Subject: [PATCH] improvement: make publication grid an unordered list of links --- app/(index)/page.tsx | 7 +---- app/publication/[id]/page.tsx | 10 +++++-- app/search/instantsearch.tsx | 6 ++++- components/instantsearch.tsx | 11 +++----- components/publication-cover.tsx | 45 ++++++++++++++++---------------- components/publication-grid.tsx | 18 +++++++++++-- 6 files changed, 56 insertions(+), 41 deletions(-) diff --git a/app/(index)/page.tsx b/app/(index)/page.tsx index 3b8545d..e1b5e2b 100644 --- a/app/(index)/page.tsx +++ b/app/(index)/page.tsx @@ -2,7 +2,6 @@ import type { Metadata, ResolvingMetadata } from "next"; import { getTranslations } from "next-intl/server"; import { MainContent } from "@/components/main-content"; -import { ClickablePublicationThumbnail } from "@/components/publication-cover"; import { PublicationGrid } from "@/components/publication-grid"; import { getPublications } from "@/lib/data"; @@ -40,11 +39,7 @@ export default async function IndexPage(_props: IndexPageProps) { return (

A random sample of Thomas Bernhard translations

- - {pubs.map((p) => { - return ; - })} - +
); } diff --git a/app/publication/[id]/page.tsx b/app/publication/[id]/page.tsx index 326b9c2..0bfbec3 100644 --- a/app/publication/[id]/page.tsx +++ b/app/publication/[id]/page.tsx @@ -68,7 +68,9 @@ export default async function PublicationPage(props: PublicationPageProps) { ).join(" / ")}
- +
+ +

@@ -137,7 +139,11 @@ export default async function PublicationPage(props: PublicationPageProps) {

{(await getSameLanguagePublications(pub)).map((p) => { - return ; + return ( +
+ +
+ ); })}
diff --git a/app/search/instantsearch.tsx b/app/search/instantsearch.tsx index 6eb42db..2b040ed 100644 --- a/app/search/instantsearch.tsx +++ b/app/search/instantsearch.tsx @@ -161,7 +161,11 @@ export function InstantSearch() { list: "m-2 grid grid-cols-1 md:grid-cols-4", }} hitComponent={({ hit }) => { - return ; + return ( +
  • + +
  • + ); }} />
    diff --git a/components/instantsearch.tsx b/components/instantsearch.tsx index 2521ff9..6cbe642 100644 --- a/components/instantsearch.tsx +++ b/components/instantsearch.tsx @@ -1,13 +1,12 @@ "use client"; import type { UiState } from "instantsearch.js"; -import { type MessageKeys, useTranslations } from "next-intl"; +import { useTranslations } from "next-intl"; import { type ReactNode, useEffect, useRef } from "react"; import { Configure, SearchBox, SortBy, useInfiniteHits } from "react-instantsearch"; import { InstantSearchNext } from "react-instantsearch-nextjs"; import TypesenseInstantSearchAdapter, { type SearchClient } from "typesense-instantsearch-adapter"; -import { ClickablePublicationThumbnail } from "@/components/publication-cover"; import { collectionName } from "@/lib/data"; import type { Publication } from "@/lib/model"; @@ -73,12 +72,10 @@ function InfiniteScroll(): ReactNode { }, [isLastPage, showMore]); return ( - - {items.map((pub) => { - return ; - })} + <> +