integration: new description prop to easily add content under tagline
This commit is contained in:
@@ -64,6 +64,13 @@ export type Props = {
|
|||||||
*/
|
*/
|
||||||
footerOptions?: Omit<FooterProps, "entity" | "serviceName" | "homepageUrl">
|
footerOptions?: Omit<FooterProps, "entity" | "serviceName" | "homepageUrl">
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contenu de la page d'accueil affiché dans la partie gauche de la page,
|
||||||
|
* en dessous de la tagline.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
description?: ReactNode
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contenu de la page d'accueil affiché dans la partie droite de la page.
|
* Contenu de la page d'accueil affiché dans la partie droite de la page.
|
||||||
*
|
*
|
||||||
@@ -82,12 +89,15 @@ export const Homepage = ({
|
|||||||
homepageUrl,
|
homepageUrl,
|
||||||
headerOptions,
|
headerOptions,
|
||||||
footerOptions,
|
footerOptions,
|
||||||
|
description,
|
||||||
children,
|
children,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
return (
|
return (
|
||||||
<div className="lasuite lasuite-homepage">
|
<div className="lasuite lasuite-homepage">
|
||||||
<Header {...{ entity, serviceName, logo, homepageUrl, ...headerOptions }} />
|
<Header {...{ entity, serviceName, logo, homepageUrl, ...headerOptions }} />
|
||||||
<HomepageContent {...{ serviceId, tagline, lasuiteApiUrl }}>{children}</HomepageContent>
|
<HomepageContent {...{ serviceName, serviceId, tagline, description, lasuiteApiUrl }}>
|
||||||
|
{children}
|
||||||
|
</HomepageContent>
|
||||||
<Footer {...{ entity, serviceName, homepageUrl, ...footerOptions }} />
|
<Footer {...{ entity, serviceName, homepageUrl, ...footerOptions }} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,6 +19,13 @@ export type Props = {
|
|||||||
*/
|
*/
|
||||||
children: ReactNode
|
children: ReactNode
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contenu de la page d'accueil affiché dans la partie gauche de la page,
|
||||||
|
* en dessous de la tagline.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
description?: ReactNode
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifiant du service sur l'API de la suite-integration.
|
* Identifiant du service sur l'API de la suite-integration.
|
||||||
*
|
*
|
||||||
@@ -32,7 +39,13 @@ export type Props = {
|
|||||||
lasuiteApiUrl?: string
|
lasuiteApiUrl?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const HomepageContent = ({ tagline, lasuiteApiUrl, serviceId, children }: Props) => {
|
export const HomepageContent = ({
|
||||||
|
tagline,
|
||||||
|
lasuiteApiUrl,
|
||||||
|
serviceId,
|
||||||
|
description,
|
||||||
|
children,
|
||||||
|
}: Props) => {
|
||||||
const parsedTagline =
|
const parsedTagline =
|
||||||
typeof tagline === "string" ? (
|
typeof tagline === "string" ? (
|
||||||
<>
|
<>
|
||||||
@@ -73,6 +86,9 @@ export const HomepageContent = ({ tagline, lasuiteApiUrl, serviceId, children }:
|
|||||||
<div className="lasuite-homepage__tagline-container">
|
<div className="lasuite-homepage__tagline-container">
|
||||||
<h1 className="lasuite-homepage__tagline">{parsedTagline}</h1>
|
<h1 className="lasuite-homepage__tagline">{parsedTagline}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
{!!description ? (
|
||||||
|
<div className="lasuite-homepage__desc-container">{description}</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="lasuite-homepage__secondary-col">
|
<div className="lasuite-homepage__secondary-col">
|
||||||
<div className="lasuite-homepage__form-container">
|
<div className="lasuite-homepage__form-container">
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ import { DarkTheme } from "./DarkTheme"
|
|||||||
const serviceHomepage = ({
|
const serviceHomepage = ({
|
||||||
id,
|
id,
|
||||||
content,
|
content,
|
||||||
|
description = null,
|
||||||
styles = "standalone",
|
styles = "standalone",
|
||||||
}: {
|
}: {
|
||||||
content?: ReactNode
|
content?: ReactNode
|
||||||
|
description?: ReactNode
|
||||||
id: string
|
id: string
|
||||||
styles: "standalone" | "full"
|
styles: "standalone" | "full"
|
||||||
}) => {
|
}) => {
|
||||||
@@ -46,6 +48,7 @@ const serviceHomepage = ({
|
|||||||
serviceId={id}
|
serviceId={id}
|
||||||
logo={`/logos/${id}.svg`}
|
logo={`/logos/${id}.svg`}
|
||||||
homepageUrl="/"
|
homepageUrl="/"
|
||||||
|
description={description}
|
||||||
footerOptions={{
|
footerOptions={{
|
||||||
description: "Un service de la Direction interministérielle du numérique",
|
description: "Un service de la Direction interministérielle du numérique",
|
||||||
sitemapUrl: "/sitemap",
|
sitemapUrl: "/sitemap",
|
||||||
@@ -90,6 +93,17 @@ const routes = [
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
description: (
|
||||||
|
<p className="fr-mt-1w">
|
||||||
|
<a href="#" className="fr-btn fr-btn--secondary fr-mb-1w fr-mr-1w">
|
||||||
|
Qu'est-ce que France Transfert ?
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="#" className="fr-btn fr-btn--secondary">
|
||||||
|
Comment utiliser France Transfert ?
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
),
|
||||||
styles: "standalone",
|
styles: "standalone",
|
||||||
}),
|
}),
|
||||||
serviceHomepage({
|
serviceHomepage({
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { Header } from "./components/Header"
|
|||||||
import { Gaufre } from "./components/Gaufre"
|
import { Gaufre } from "./components/Gaufre"
|
||||||
|
|
||||||
const customContent = (
|
const customContent = (
|
||||||
<div className="fr-p-4w">
|
<div>
|
||||||
<h2>~~replace~~</h2>
|
<h2>~~replace~~</h2>
|
||||||
<p>
|
<p>
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis beatae, quia eius
|
Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis beatae, quia eius
|
||||||
|
|||||||
@@ -122,7 +122,8 @@
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lasuite-homepage__tagline-container {
|
.lasuite-homepage__tagline-container,
|
||||||
|
.lasuite-homepage__desc-container {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: var(--lasuite-primary);
|
color: var(--lasuite-primary);
|
||||||
padding: 1rem 1.5rem;
|
padding: 1rem 1.5rem;
|
||||||
@@ -148,14 +149,24 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lasuite-homepage__desc-container {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lasuite-homepage__desc-container > p:only-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 36em) {
|
@media screen and (min-width: 36em) {
|
||||||
|
.lasuite-homepage__desc-container,
|
||||||
.lasuite-homepage__tagline-container {
|
.lasuite-homepage__tagline-container {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 48em) {
|
@media screen and (min-width: 48em) {
|
||||||
.lasuite-homepage__tagline-container {
|
.lasuite-homepage__tagline-container,
|
||||||
|
.lasuite-homepage__desc-container {
|
||||||
padding: 1rem 2rem;
|
padding: 1rem 2rem;
|
||||||
padding-left: 4rem;
|
padding-left: 4rem;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
@@ -171,7 +182,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 90em) {
|
@media screen and (min-width: 90em) {
|
||||||
.lasuite-homepage__tagline-container {
|
.lasuite-homepage__tagline-container,
|
||||||
|
.lasuite-homepage__desc-container {
|
||||||
padding-left: 8rem;
|
padding-left: 8rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user