-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
102 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,12 @@ import { Header } from "@codegouvfr/react-dsfr/Header"; | |
import { fr } from "@codegouvfr/react-dsfr"; | ||
import { routes } from "./router"; | ||
import { headerFooterDisplayItem } from "@codegouvfr/react-dsfr/Display"; | ||
import { GdprStoreProvider } from "@codegouvfr/react-dsfr/gdpr"; | ||
import { ConsentBanner } from '@codegouvfr/react-dsfr/ConsentBanner'; | ||
|
||
|
||
startReactDsfr({ | ||
"defaultColorScheme": "system" | ||
}); | ||
|
||
declare module "@codegouvfr/react-dsfr/gdpr" { | ||
interface RegisterGdprServices { | ||
matomo: never; | ||
} | ||
} | ||
|
||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
|
@@ -46,62 +39,53 @@ function Root() { | |
} | ||
}} | ||
/> | ||
<GdprStoreProvider> | ||
<ConsentBanner gdprLinkProps={{ href: "/mui" }} siteName='Next Test App' services={[ | ||
{ | ||
name: "matomo", | ||
title: "Matomo", | ||
description: "User tracking", | ||
} | ||
]} /> | ||
<div style={{ | ||
"minHeight": "100vh", | ||
"display": "flex", | ||
"flexDirection": "column", | ||
}}> | ||
<Header | ||
brandTop={<>INTITULE<br />OFFICIEL</>} | ||
serviceTitle="Nom du site / service" | ||
quickAccessItems={[ | ||
headerFooterDisplayItem, | ||
{ | ||
iconId: "ri-mail-line", | ||
linkProps: { | ||
href: `mailto:${"[email protected]"}`, | ||
}, | ||
text: "Nous contacter", | ||
} | ||
]} | ||
homeLinkProps={{ ...routes.home().link, "title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)" }} | ||
navigation={[ | ||
{ | ||
"text": "Home", | ||
"linkProps": routes.home().link, | ||
"isActive": route.name === "home" | ||
}, | ||
{ | ||
"text": "Mui playground", | ||
"linkProps": routes.mui().link, | ||
"isActive": route.name === "mui" | ||
} | ||
]} | ||
/> | ||
<div style={{ | ||
"minHeight": "100vh", | ||
"display": "flex", | ||
"flexDirection": "column", | ||
"flex": 1, | ||
"margin": "auto", | ||
"maxWidth": 1000, | ||
...fr.spacing("padding", { "topBottom": "10v" }) | ||
}}> | ||
<Header | ||
brandTop={<>INTITULE<br />OFFICIEL</>} | ||
serviceTitle="Nom du site / service" | ||
quickAccessItems={[ | ||
headerFooterDisplayItem, | ||
{ | ||
iconId: "ri-mail-line", | ||
linkProps: { | ||
href: `mailto:${"[email protected]"}`, | ||
}, | ||
text: "Nous contacter", | ||
} | ||
]} | ||
homeLinkProps={{ ...routes.home().link, "title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)" }} | ||
navigation={[ | ||
{ | ||
"text": "Home", | ||
"linkProps": routes.home().link, | ||
"isActive": route.name === "home" | ||
}, | ||
{ | ||
"text": "Mui playground", | ||
"linkProps": routes.mui().link, | ||
"isActive": route.name === "mui" | ||
} | ||
]} | ||
/> | ||
<div style={{ | ||
"flex": 1, | ||
"margin": "auto", | ||
"maxWidth": 1000, | ||
...fr.spacing("padding", { "topBottom": "10v" }) | ||
}}> | ||
{(() => { | ||
switch (route.name) { | ||
case "mui": return <Mui />; | ||
case "home": return <Home />; | ||
case false: return <h1>404</h1> | ||
} | ||
})()} | ||
</div> | ||
{(() => { | ||
switch (route.name) { | ||
case "mui": return <Mui />; | ||
case "home": return <Home />; | ||
case false: return <h1>404</h1> | ||
} | ||
})()} | ||
</div> | ||
</GdprStoreProvider> | ||
</div> | ||
</> | ||
); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
"use client"; | ||
|
||
import { createGdprApi } from "@codegouvfr/react-dsfr/gdpr"; | ||
|
||
export const { | ||
ConsentBannerAndConsentManagement, | ||
useGdpr, | ||
FooterConsentManagementItem, | ||
FooterPersonalDataPolicyItem | ||
} = createGdprApi({ | ||
"finalityDescription": ({ lang }) => ({ | ||
"advertising": { | ||
"title": "Publicité", | ||
"description": "Nous utilisons des cookies pour vous proposer des publicités adaptées à vos centres d’intérêts et mesurer leur efficacité." | ||
}, | ||
"analytics": { | ||
"title": "Analyse", | ||
"description": "Nous utilisons des cookies pour mesurer l’audience de notre site et améliorer son contenu." | ||
}, | ||
"personalization": { | ||
"title": "Personnalisation", | ||
"description": "Nous utilisons des cookies pour vous proposer des contenus adaptés à vos centres d’intérêts." | ||
}, | ||
"statistics": { | ||
"title": "Statistiques", | ||
"description": "Nous utilisons des cookies pour mesurer l’audience de notre site et améliorer son contenu.", | ||
"subFinalities": { | ||
"deviceInfo": "Informations sur votre appareil", | ||
"traffic": "Informations sur votre navigation", | ||
} | ||
} | ||
}), | ||
"personalDataPolicyLinkProps": { | ||
"to": "#", | ||
"onClick": ()=> { | ||
alert("Navigate or display your data policy"); | ||
} | ||
}, | ||
"consentCallback": async ({ finalityConsent, finalityConsent_prev })=> { | ||
console.log("callback from gdpr hook", { finalityConsent, finalityConsent_prev }); | ||
} | ||
}); | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters