Skip to content

Commit

Permalink
fix: missing breadcrumb
Browse files Browse the repository at this point in the history
Signed-off-by: Maud Royer <[email protected]>
  • Loading branch information
jillro committed Oct 18, 2024
1 parent 749fe76 commit 0618de2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 40 deletions.
15 changes: 9 additions & 6 deletions src/app/(container)/medicament/[CIS]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,15 @@ export default async function Page({
{atcBreadcrumbs && (
<Breadcrumb
segments={[
...atcBreadcrumbs,
formatSpecName(getSpecialiteGroupName(specialite)),
].map((label) => ({
label,
linkProps: { href: `/rechercher?s=${label}` },
}))}
{ label: "Accueil", linkProps: { href: "/" } },
...[
...atcBreadcrumbs,
formatSpecName(getSpecialiteGroupName(specialite)),
].map((label) => ({
label,
linkProps: { href: `/rechercher?s=${label}` },
})),
]}
currentPageLabel={formatSpecName(specialite.SpecDenom01).replace(
formatSpecName(getSpecialiteGroupName(specialite)),
"",
Expand Down
75 changes: 41 additions & 34 deletions src/app/(container)/parcourir/pathologies/[letter]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Link from "next/link";
import { Patho } from "@/db/pdbmMySQL/types";
import { pdbmMySQL } from "@/db/pdbmMySQL";
import { notFound } from "next/navigation";
import Breadcrumb from "@codegouvfr/react-dsfr/Breadcrumb";

export async function generateStaticParams(): Promise<{ letter: string }[]> {
return pdbmMySQL
Expand Down Expand Up @@ -37,40 +38,46 @@ export default async function Page({
if (!pathos || !pathos.length) return notFound();

return (
<div className={fr.cx("fr-grid-row")}>
<div className={fr.cx("fr-col-md-8")}>
<h1 className={fr.cx("fr-h1", "fr-mb-8w")}>Liste des pathologies</h1>
<p className={fr.cx("fr-text--lg")}>
{letters.map((a) => (
<>
<Link
href={`/parcourir/pathologies/${a}`}
key={a}
className={fr.cx(
"fr-link",
"fr-link--lg",
"fr-mr-3w",
"fr-mb-3w",
)}
>
{a}
</Link>{" "}
</>
))}
</p>
<ul className={fr.cx("fr-raw-list")}>
{pathos.map((patho, i) => (
<li key={i} className={fr.cx("fr-mb-1v")}>
<Link
href={`/pathologie/${patho.codePatho}`}
className={fr.cx("fr-link")}
>
{patho.NomPatho}
</Link>
</li>
))}
</ul>
<>
<Breadcrumb
segments={[{ label: "Accueil", linkProps: { href: "/" } }]}
currentPageLabel="Liste des pathologies"
/>
<div className={fr.cx("fr-grid-row")}>
<div className={fr.cx("fr-col-md-8")}>
<h1 className={fr.cx("fr-h1", "fr-mb-8w")}>Liste des pathologies</h1>
<p className={fr.cx("fr-text--lg")}>
{letters.map((a) => (
<>
<Link
href={`/parcourir/pathologies/${a}`}
key={a}
className={fr.cx(
"fr-link",
"fr-link--lg",
"fr-mr-3w",
"fr-mb-3w",
)}
>
{a}
</Link>{" "}
</>
))}
</p>
<ul className={fr.cx("fr-raw-list")}>
{pathos.map((patho, i) => (
<li key={i} className={fr.cx("fr-mb-1v")}>
<Link
href={`/pathologie/${patho.codePatho}`}
className={fr.cx("fr-link")}
>
{patho.NomPatho}
</Link>
</li>
))}
</ul>
</div>
</div>
</div>
</>
);
}

0 comments on commit 0618de2

Please sign in to comment.