Skip to content

Commit

Permalink
fix(contributions): affichage du nom de la CC dans le H1 des contribs…
Browse files Browse the repository at this point in the history
… personnalisées
  • Loading branch information
carolineBda committed Jan 9, 2025
1 parent 441a008 commit d2f1e30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
} from "../../../src/modules/contributions";

export async function generateMetadata({ params }) {
const { title, description } = await getContribution(params.slug);
const { metas } = await getContribution(params.slug);

return generateDefaultMetadata({
title: title,
description: description,
title: metas.title,
description: metas.description,
path: `/contribution/${params.slug}`,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ export function ContributionLayout({ relatedItems, contribution }: Props) {
linkProps: { href: breadcrumb.slug },
}))}
/>
<h1 className={fr.cx("fr-mb-6w")}>{title}</h1>
<h1 className={fr.cx("fr-mb-6w")}>
{title}{" "}
{!isGeneric && (
<span className={`${fr.cx("fr-h2")} ${h1}`}>
{contribution.ccnShortTitle}
</span>
)}
</h1>
<p className={fr.cx("fr-mt-6w")}>Mis à jour le&nbsp;: {date}</p>
<div className={`${fr.cx("fr-p-3w", "fr-mt-6w")} ${block}`}>
{isGeneric ? (
Expand Down Expand Up @@ -233,11 +240,7 @@ export function ContributionLayout({ relatedItems, contribution }: Props) {
Que dit le code du travail&nbsp;?
</p>
<ContributionContent
contribution={
contribution as
| ElasticSearchContributionGeneric
| ElasticSearchContributionConventionnelle
}
contribution={contribution as ElasticSearchContributionGeneric}
titleLevel={2}
/>
{contribution.references.length && (
Expand Down Expand Up @@ -294,9 +297,7 @@ export function ContributionLayout({ relatedItems, contribution }: Props) {
>
<ContributionContent
contribution={
contribution as
| ElasticSearchContributionGeneric
| ElasticSearchContributionConventionnelle
contribution as ElasticSearchContributionConventionnelle
}
titleLevel={3}
></ContributionContent>
Expand Down Expand Up @@ -335,6 +336,10 @@ export function ContributionLayout({ relatedItems, contribution }: Props) {
);
}

const h1 = css({
display: "block",
});

const block = css({
background: "var(--background-alt-blue-cumulus) !important",
});

0 comments on commit d2f1e30

Please sign in to comment.