Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
feat(all-application): Use react-dsfr (#23)
Browse files Browse the repository at this point in the history
* Install React-DSFR

* Update packages

* Remove wrong link

* Update dockerfile
  • Loading branch information
desoindx authored Jan 4, 2022
1 parent a1f0a13 commit 5ad0d0b
Show file tree
Hide file tree
Showing 25 changed files with 1,178 additions and 1,497 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ FROM node:14-alpine as builder

COPY . .

RUN yarn --production --frozen-lockfile --prefer-offline && yarn cache clean
RUN yarn build
RUN yarn install --frozen-lockfile
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline
RUN yarn export


FROM ghcr.io/socialgouv/docker/nginx:6.64.2

ARG PRODUCTION
Expand Down
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,30 @@
"url": "git+https://github.com/SocialGouv/mon-psy-sante"
},
"dependencies": {
"@gouvfr/dsfr": "^1.2.1",
"@sentry/nextjs": "^6.12.0",
"@dataesr/react-dsfr": "^0.9.4",
"@sentry/nextjs": "^6.16.1",
"@socialgouv/bootstrap.core": "^0.2.1",
"@socialgouv/matomo-next": "^1.2.2",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@zeit/next-source-maps": "^0.0.3",
"express": "^4.17.1",
"next": "^11.0.1",
"next": "^12.0.7",
"react": "^17.0.2",
"react-bootstrap": "^1.6.4",
"react-dom": "^17.0.2",
"typescript-eslint": "^0.0.1-alpha.0"
},
"devDependencies": {
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@socialgouv/eslint-config-react": "^1.100.0",
"@socialgouv/eslint-config-recommended": "^1.100.0",
"eslint": "^7.32.0",
"eslint-config-next": "^11.1.2",
"eslint-plugin-import": "^2.25.3",
"jest": "^27.4.4",
"lint-staged": "^11.2.3",
"prettier": "^2.5.0",
"typescript": "^4.5.2"
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^16.0.0",
"@socialgouv/eslint-config-react": "^1.101.0",
"@socialgouv/eslint-config-recommended": "^1.101.0",
"@types/react": "^17.0.38",
"eslint": "^8.6.0",
"eslint-config-next": "^12.0.7",
"eslint-plugin-import": "^2.25.4",
"jest": "^27.4.5",
"lint-staged": "^12.1.5",
"prettier": "^2.5.1",
"typescript": "^4.5.4"
},
"license": "MIT",
"private": true,
Expand All @@ -44,7 +43,8 @@
"dev": "next dev",
"e2e": "yarn --cwd=./optional/e2e/runners/puppeteer",
"k8s": "yarn --silent --cwd .socialgouv",
"lint": "eslint src/*",
"lint": "eslint ./src",
"lint:fix": "eslint ./src --fix",
"precommit": "lint-staged",
"start": "NODE_ENV=production next start",
"export": "next export"
Expand Down
Binary file added public/fonts/Marianne-Bold.woff
Binary file not shown.
Binary file added public/fonts/Marianne-Bold.woff2
Binary file not shown.
Binary file added public/fonts/Marianne-Bold_Italic.woff
Binary file not shown.
Binary file added public/fonts/Marianne-Bold_Italic.woff2
Binary file not shown.
Binary file added public/fonts/Marianne-Light.woff
Binary file not shown.
Binary file added public/fonts/Marianne-Light.woff2
Binary file not shown.
Binary file added public/fonts/Marianne-Light_Italic.woff
Binary file not shown.
Binary file added public/fonts/Marianne-Light_Italic.woff2
Binary file not shown.
Binary file added public/fonts/Marianne-Regular.woff
Binary file not shown.
Binary file added public/fonts/Marianne-Regular.woff2
Binary file not shown.
Binary file added public/fonts/Marianne-Regular_Italic.woff
Binary file not shown.
Binary file added public/fonts/Marianne-Regular_Italic.woff2
Binary file not shown.
180 changes: 80 additions & 100 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,105 +1,85 @@
import {
Footer as FooterDS,
FooterBody,
FooterBodyItem,
FooterBottom,
FooterCopy,
FooterLink,
Logo,
} from "@dataesr/react-dsfr";
import React from "react";

const Footer = () => {
return (
<footer className="fr-footer fr-mt-2w" id="footer">
<div className="fr-container">
<div className="fr-footer__body">
<div className="fr-footer__brand">
<a className="fr-logo" href="/" title="République française">
<p className="fr-logo__title fr-mb-0">
Ministère
<br />
des Solidarités
<br />
et de la Santé
</p>
</a>
</div>
<div className="fr-footer__brand">
<a href="/" title="Accueil">
<img src="/images/cpam.png" alt="CNAM" width="200" height="66" />
</a>
</div>
<div className="fr-footer__content">
<p className="fr-footer__content-desc">
Le code source est ouvert et les contributions sont bienvenues.{" "}
<a
title="Voir le code source"
href="https://github.com/SocialGouv/mon-psy-sante"
target="_blank"
rel="noopener noreferrer"
>
Voir le code source
</a>
</p>
const FooterDescription = () => (
<>
Le code source est ouvert et les contributions sont bienvenues.{" "}
<a
href="https://github.com/betagouv/sante-psy"
target="_blank"
rel="noopener noreferrer"
>
Voir le code source
</a>
.
</>
);
const footerBodyLinks = [
{
link: "https://solidarites-sante.gouv.fr",
title: "solidarites-sante.gouv.fr",
},
{
link: "https://www.ameli.fr",
title: "ameli.fr",
},
{
link: "https://beta.gouv.fr/",
title: "beta.gouv.fr",
},
];

<ul className="fr-footer__content-list">
<li className="fr-footer__content-item">
<a
className="fr-footer__content-link"
href="https://solidarites-sante.gouv.fr"
target="_blank"
rel="noopener noreferrer"
>
solidarites-sante.gouv.fr
</a>
</li>
<li className="fr-footer__content-item">
<a
className="fr-footer__content-link"
href="https://www.ameli.fr"
target="_blank"
rel="noopener noreferrer"
>
ameli.fr
</a>
</li>
<li className="fr-footer__content-item">
<a
className="fr-footer__content-link"
href="https://beta.gouv.fr/"
target="_blank"
rel="noopener noreferrer"
>
beta.gouv.fr
</a>
</li>
</ul>
</div>
</div>
<div className="fr-footer__bottom">
<ul className="fr-footer__bottom-list">
<li className="fr-footer__bottom-item">
<a
className="fr-footer__bottom-link"
href="/mentions-legales#accessibilite"
>
Accessibilité: non conforme
</a>
</li>
<li className="fr-footer__bottom-item">
<a className="fr-footer__bottom-link" href="/mentions-legales">
Mentions légales
</a>
</li>
</ul>
<div className="fr-footer__bottom-copy">
<p>
Sauf mention contraire, tous les textes de ce site sont sous{" "}
<a
href="https://github.com/etalab/licence-ouverte/blob/master/LO.md"
rel="noreferrer"
target="_blank"
>
licence etalab-2.0
</a>
</p>
</div>
</div>
</div>
</footer>
);
};
const footerBottomLinks = [
{
link: "/mentions-legales#accessibilite",
title: "Accessibilité : non conforme",
},
{
link: "/mentions-legales",
title: "Mentions légales",
},
];

const Footer = () => (
<FooterDS>
<FooterBody description={<FooterDescription />}>
<Logo>Ministère des Solidarités et de la Santé</Logo>
{footerBodyLinks.map((item) => (
<FooterBodyItem key={item.title}>
<a href={item.link} target="_blank" rel="noopener noreferrer">
{item.title}
</a>
</FooterBodyItem>
))}
</FooterBody>
<FooterBottom>
{footerBottomLinks.map((item) => (
<FooterLink key={item.title} href={item.link}>
{item.title}
</FooterLink>
))}
</FooterBottom>
<FooterCopy>
<p>
Sauf mention contraire, tous les textes de ce site sont sous{" "}
<a
href="https://github.com/etalab/licence-ouverte/blob/master/LO.md"
rel="noreferrer"
target="_blank"
>
licence etalab-2.0
</a>
</p>
</FooterCopy>
</FooterDS>
);

export default Footer;
54 changes: 19 additions & 35 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,26 @@
import {
Header,
HeaderBody,
HeaderOperator,
Logo,
Service,
} from "@dataesr/react-dsfr";
import React from "react";

const Nav = () => {
return (
<>
<header role="banner" className="fr-header">
<div className="fr-header__body">
<div className="fr-container">
<div className="fr-header__body-row">
<div className="fr-header__brand fr-enlarge-link">
<div className="fr-header__brand-top">
<div className="fr-header__logo">
<p className="fr-logo">
Ministère <br /> des Solidarités <br /> et de la Santé
</p>
</div>
<div className="fr-header__logo">
<img
src="/images/cpam.png"
alt="CNAM"
width="200"
height="66"
/>
</div>
</div>
<div className="fr-header__service">
<a href="/" title="Retour à l’accueil">
<p className="fr-header__service-title">MonPsySanté</p>
</a>
<p className="fr-header__service-tagline">
En parler, c’est déjà se soigner.
</p>
</div>
</div>
</div>
</div>
</div>
</header>
</>
<Header>
<HeaderBody>
<Logo>Ministère des Solidarités et de la Santé</Logo>
<HeaderOperator>
<img src="/images/cpam.png" alt="CNAM" />
</HeaderOperator>
<Service
title="MonPsySanté"
description="En parler, c’est déjà se soigner."
/>
</HeaderBody>
</Header>
);
};

Expand Down
22 changes: 7 additions & 15 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
display: none;
}

.text-center {
text-align: center;
}

.fr-bg--light {
background-color: #f7ecdb;
background-color:var(--brown-cafe-creme-950);
}

.fr-bg--light2 {
background-color: var(--background-alt-pink-tuile);
}

.fr-bg--light input {
background-color: white;
}

.highlight {
color: #CE614A;
color: var(--pink-tuile-main-556);
}

.no-bullet {
Expand Down Expand Up @@ -65,21 +57,21 @@
content: '';
width: 25px;
height: 25px;
background-color: #f7ecdb;
background-color: var(--brown-cafe-creme-950);
border-radius: 25px;
position: absolute;
bottom: -32px;
left: 35%;
}

li.before .time-line-list-dot:after {
background-color: #CE614A;
background-color: var(--pink-tuile-main-556);
}

.time-line-list li:not(:first-child) .time-line-list-border:before {
content: "";
display: block;
border-top: 5px solid #f7ecdb;
border-top: 5px solid var(--brown-cafe-creme-950);
width: calc(50% - 10px + 10px);
position: absolute;
top: -3px;
Expand All @@ -89,7 +81,7 @@
.time-line-list li:not(:last-child) .time-line-list-border:after {
content: "";
display: block;
border-top: 5px solid #f7ecdb;
border-top: 5px solid var(--brown-cafe-creme-950);
width: calc(50% - 10px + 10px + 1px);
position: absolute;
top: -3px;
Expand All @@ -98,6 +90,6 @@

.time-line-list li.before:not(:first-child) .time-line-list-border:before,
.time-line-list li.before:not(:last-child) .time-line-list-border:after {
border-top: 5px solid #CE614A;
border-top: 5px solid var(--pink-tuile-main-556);
}
}
Loading

0 comments on commit 5ad0d0b

Please sign in to comment.