Skip to content

Commit

Permalink
feat: max line length on large layouts
Browse files Browse the repository at this point in the history
Signed-off-by: Maud Royer <[email protected]>
  • Loading branch information
jillro committed Aug 28, 2024
1 parent 31fa972 commit 3c10886
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 68 deletions.
72 changes: 38 additions & 34 deletions src/app/medicament/[CIS]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,40 +319,44 @@ export default async function Page({
</ul>
</section>
{leaflet ? (
<article>
<div className={fr.cx("fr-mb-4w")}>
<h1 className={fr.cx("fr-h3", "fr-mb-1w")}>Notice</h1>
<Badge severity={"info"}>{leaflet.maj}</Badge>
</div>

<Accordion label={"Généralités"} titleAs={"h2"}>
<DsfrLeafletSection data={leaflet.generalities} />
</Accordion>

<Accordion label={"A quoi sert-il"}>
<DsfrLeafletSection data={leaflet.usage} />
</Accordion>

<Accordion label={"Précautions"}>
<DsfrLeafletSection data={leaflet.warnings} />
</Accordion>

<Accordion label={"Comment le prendre ?"}>
<DsfrLeafletSection data={leaflet.howTo} />
</Accordion>

<Accordion label={"Effets indésirables"}>
<DsfrLeafletSection data={leaflet.sideEffects} />
</Accordion>

<Accordion label={"Conservation"}>
<DsfrLeafletSection data={leaflet.storage} />
</Accordion>

<Accordion label={"Composition"}>
<DsfrLeafletSection data={leaflet.composition} />
</Accordion>
</article>
<div className={fr.cx("fr-grid-row")}>
<article
className={fr.cx("fr-col-12", "fr-col-lg-9", "fr-col-md-10")}
>
<div className={fr.cx("fr-mb-4w")}>
<h1 className={fr.cx("fr-h3", "fr-mb-1w")}>Notice</h1>
<Badge severity={"info"}>{leaflet.maj}</Badge>
</div>

<Accordion label={"Généralités"} titleAs={"h2"}>
<DsfrLeafletSection data={leaflet.generalities} />
</Accordion>

<Accordion label={"A quoi sert-il"}>
<DsfrLeafletSection data={leaflet.usage} />
</Accordion>

<Accordion label={"Précautions"}>
<DsfrLeafletSection data={leaflet.warnings} />
</Accordion>

<Accordion label={"Comment le prendre ?"}>
<DsfrLeafletSection data={leaflet.howTo} />
</Accordion>

<Accordion label={"Effets indésirables"}>
<DsfrLeafletSection data={leaflet.sideEffects} />
</Accordion>

<Accordion label={"Conservation"}>
<DsfrLeafletSection data={leaflet.storage} />
</Accordion>

<Accordion label={"Composition"}>
<DsfrLeafletSection data={leaflet.composition} />
</Accordion>
</article>
</div>
) : null}
</>
);
Expand Down
46 changes: 25 additions & 21 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@ import Button from "@codegouvfr/react-dsfr/Button";

export default async function Page() {
return (
<>
<form action="/rechercher">
<h1 className={fr.cx("fr-h5")}>Quel médicament cherchez-vous&nbsp;?</h1>
<Input
label={"Quel médicament cherchez-vous&nbsp;?"}
hideLabel={true}
addon={
<Button
iconId={"fr-icon-search-line"}
title="Recherche"
type="submit"
/>
}
nativeInputProps={{
placeholder: "Rechercher",
name: "s",
type: "search",
}}
/>
</form>
</>
<div className={fr.cx("fr-grid-row")}>
<div className={fr.cx("fr-col-12", "fr-col-lg-9", "fr-col-md-10")}>
<form action="/rechercher">
<h1 className={fr.cx("fr-h5")}>
Quel médicament cherchez-vous&nbsp;?
</h1>
<Input
label={"Quel médicament cherchez-vous&nbsp;?"}
hideLabel={true}
addon={
<Button
iconId={"fr-icon-search-line"}
title="Recherche"
type="submit"
/>
}
nativeInputProps={{
placeholder: "Rechercher",
name: "s",
type: "search",
}}
/>
</form>
</div>
</div>
);
}
33 changes: 20 additions & 13 deletions src/app/rechercher/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,26 @@ export default async function Page({

return (
<>
<form action="/rechercher" className={fr.cx("fr-my-4w")}>
<Input
label={"Quel médicament cherchez-vous&nbsp;?"}
hideLabel={true}
addon={<Button iconId={"fr-icon-search-line"} title="Recherche" />}
nativeInputProps={{
name: "s",
placeholder: "Rechercher",
...(search ? { defaultValue: search } : {}),
type: "search",
}}
/>
</form>
<div className={fr.cx("fr-grid-row")}>
<div className={fr.cx("fr-col-12", "fr-col-lg-9", "fr-col-md-10")}>
{" "}
<form action="/rechercher" className={fr.cx("fr-my-4w")}>
<Input
label={"Quel médicament cherchez-vous&nbsp;?"}
hideLabel={true}
addon={
<Button iconId={"fr-icon-search-line"} title="Recherche" />
}
nativeInputProps={{
name: "s",
placeholder: "Rechercher",
...(search ? { defaultValue: search } : {}),
type: "search",
}}
/>
</form>
</div>
</div>
{results && (
<>
<p>{results.specialites.length} RÉSULTATS</p>
Expand Down

0 comments on commit 3c10886

Please sign in to comment.