Skip to content

Commit

Permalink
ajout de la section "pour aller plus loin" sur la page généric
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineBda committed Sep 15, 2023
1 parent 9861570 commit 8281177
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function PageContribution(props: Props): React.ReactElement {
answers={answers}
slug={slug}
content={(content && content._source) || {}}
relatedItems={relatedItems}
/>
) : (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ const ContributionCC = ({ answers, slug, relatedItems }) => {
</p>
</Alert>
</StyledSection>
<StyledSection>
<Title shift={spacings.xmedium} variant="secondary">
Pour aller plus loins
</Title>
<Grid columns={2}>
{relatedItems &&
relatedItems.map((item) => {
{relatedItems && (
<StyledSection>
<Title shift={spacings.xmedium} variant="secondary">
Pour aller plus loins
</Title>
<Grid columns={2}>
{relatedItems.map((item) => {
return (
<ListLink
item={item}
Expand All @@ -122,8 +122,9 @@ const ContributionCC = ({ answers, slug, relatedItems }) => {
/>
);
})}
</Grid>
</StyledSection>
</Grid>
</StyledSection>
)}
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
ArrowLink,
Badge,
Button,
Grid,
Heading,
icons,
IconStripe,
Expand All @@ -37,10 +38,11 @@ import { handleTrackEvent } from "../outils/common/Agreement/tracking";
import { MatomoBaseEvent } from "../lib";
import { getCc3239Informations } from "../outils";
import { Enterprise } from "../conventions/Search/api/enterprises.service";
import { ListLink } from "../search/SearchResults/Results";

const { DirectionRight } = icons;

const ContributionGeneric = ({ answers, content, slug }) => {
const ContributionGeneric = ({ answers, content, slug, relatedItems }) => {
const titleRef = useRef<HTMLDivElement>(null);
const onUserAction: OnUserAction = (action, extra) => {
handleTrackEvent(getTitle(), action, extra);
Expand Down Expand Up @@ -353,6 +355,25 @@ const ContributionGeneric = ({ answers, content, slug }) => {
<ReferencesJuridiques
references={filteredRefs(answers.generic.references, content.url)}
/>
{relatedItems && (
<Section>
<Title shift={spacings.xmedium} variant="secondary">
Pour aller plus loins
</Title>
<Grid columns={2}>
{relatedItems.map((item) => {
return (
<ListLink
item={item}
key={item.slug}
titleTagType="h3"
hideAction
/>
);
})}
</Grid>
</Section>
)}
</SectionHidden>
</>
);
Expand Down

0 comments on commit 8281177

Please sign in to comment.