ainsi que leur articulation. diff --git a/packages/code-du-travail-frontend/__tests__/__snapshots__/fiche-ministere-travail.test.tsx.snap b/packages/code-du-travail-frontend/__tests__/__snapshots__/fiche-ministere-travail.test.tsx.snap index 4a64c69a15..ec2a3868ac 100644 --- a/packages/code-du-travail-frontend/__tests__/__snapshots__/fiche-ministere-travail.test.tsx.snap +++ b/packages/code-du-travail-frontend/__tests__/__snapshots__/fiche-ministere-travail.test.tsx.snap @@ -3,10 +3,10 @@ exports[`
Depuis le 1er janvier 2017, la
diff --git a/packages/code-du-travail-frontend/__tests__/__snapshots__/glossaire-[slug].test.tsx.snap b/packages/code-du-travail-frontend/__tests__/__snapshots__/glossaire-[slug].test.tsx.snap
index 5254d1e437..1ddcde7938 100644
--- a/packages/code-du-travail-frontend/__tests__/__snapshots__/glossaire-[slug].test.tsx.snap
+++ b/packages/code-du-travail-frontend/__tests__/__snapshots__/glossaire-[slug].test.tsx.snap
@@ -3,10 +3,10 @@
exports[`
- should render 1`] = `
- B
- C
- D
- E
- F
- G
- H
- I
- J
- K
- L
- M
- N
- O
- P
- Q
- R
- S
- T
- U
- V
- W
- X
- Y
-
Z
diff --git a/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers-[slug].test.tsx.snap b/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers-[slug].test.tsx.snap
index 25480eaf46..4314db9db2 100644
--- a/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers-[slug].test.tsx.snap
+++ b/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers-[slug].test.tsx.snap
@@ -3,10 +3,10 @@
exports[`
should render 1`] = ` should render 1`] = ` ++ + + Votre avis compte ! Aidez-nous à nous améliorer. + + Répondre + + + ++should render 1`] = ` class="sc-iGgWBj biWgIW" >theme
should render 1`] = ` Mis à jour le : @@ -280,10 +349,10 @@ exports[`
should render 1`] = ` should render 1`] = ` class="sc-gEvEer hpVpdb" >youhou @@ -364,7 +433,7 @@ exports[`
should render 1`] = ` Type: Modèle de document - Format: pdf @@ -375,12 +444,12 @@ exports[`
should render 1`] = ` Attention, chaque modèle de lettre proposé est à personnaliser selon votre situation et est susceptible d’évoluer suite à des changements de réglementation. Assurez-vous d’avoir la dernière version mise à jour avant toute utilisation.
should render 1`] = ` Partager ce contenu :should render 1`] = ` should render 1`] = `should render 1`] = ` class="sc-hCPjZK dlWASs" > should render 1`] = ` should render 1`] = ` class="sc-iGgWBj cRLRjd" >should render 1`] = ` Avez-vous trouvé la réponse à votre question ?
Non Oui diff --git a/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers.test.tsx.snap b/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers.test.tsx.snap index fc027dd999..8e60581923 100644 --- a/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers.test.tsx.snap +++ b/packages/code-du-travail-frontend/__tests__/__snapshots__/modeles-de-courriers.test.tsx.snap @@ -3,10 +3,10 @@ exports[`should render 1`] = ` should render 1`] = ` ++ + + Votre avis compte ! Aidez-nous à nous améliorer. + + Répondre + + +++ + +@@ -196,7 +265,7 @@ exports[` should render 1`] = ` should render 1`] = `- should render 1`] = `
Embauche et contrat de travail
Départ de l'entreprise
- should render 1`] = `
should render 1`] = ` ++ + + Votre avis compte ! Aidez-nous à nous améliorer. + + Répondre + + +++ + +@@ -108,7 +177,7 @@ exports[` should render 1`] = ` should render 1`] = ` class="sc-aXZVg gZgZQL" >should render 1`] = ` Vous n’avez pas trouvé ce que vous cherchiez ? Essayez …should render 1`] = ` should render 1`] = ` ++ + + Votre avis compte ! Aidez-nous à nous améliorer. + + Répondre + + +++ + +@@ -251,34 +320,34 @@ exports[` should render 1`] = ` CDI CDD Intérim Contrat d'apprentissage Contrat de professionnalisation diff --git a/packages/code-du-travail-frontend/package.json b/packages/code-du-travail-frontend/package.json index eedd7c84cc..178737bd35 100644 --- a/packages/code-du-travail-frontend/package.json +++ b/packages/code-du-travail-frontend/package.json @@ -1,6 +1,6 @@ { "name": "@cdt/frontend", - "version": "4.151.1", + "version": "4.152.0", "description": "Code du travail frontend", "private": true, "homepage": "https://code-du-travail.beta.gouv.fr/", diff --git a/packages/code-du-travail-frontend/src/layout/Feedback/index.tsx b/packages/code-du-travail-frontend/src/layout/Feedback/index.tsx new file mode 100644 index 0000000000..f1933a934b --- /dev/null +++ b/packages/code-du-travail-frontend/src/layout/Feedback/index.tsx @@ -0,0 +1,98 @@ +import styled from "styled-components"; +import { Button, icons, theme } from "@socialgouv/cdtn-ui"; +import React, { useState } from "react"; +import { AlertCircle } from "react-feather"; +import Link from "next/link"; + +export const Feedback = (): React.ReactNode => { + const key = "questionnaire_dsfr"; + + const onClose = () => { + try { + if (window) { + window.localStorage?.setItem(key, "true"); + } + } catch (e) { + console.error("Failed to save state to local storage"); + } finally { + setClosed(true); + } + }; + + const getLocalStorageClose = () => { + try { + return window.localStorage?.getItem(key) === "true"; + } catch (e) { + return false; + } + }; + + const [closed, setClosed] = useState(getLocalStorageClose()); + const closeButton = ( ++ + ); + return !closed ? ( +onClose} + title="Fermer le bandeau" + /> + ++ ) : ( + <>> + ); +}; + +const { colors, box, fonts, spacings } = theme; + +const Div = styled.div` + max-width: 1200px; + margin: auto; +`; + +const AlertIcon = styled(AlertCircle)` + width: 24px; +`; + +const Content = styled.span` + display: flex; + align-items: center; + flex-grow: 1; + gap: ${spacings.medium}; + justify-content: center; +`; + +const IntroContainer = styled.div` + border: 1px solid ${colors.secondary}; + border-radius: ${box.borderRadius}; + background-color: ${theme.colors.white}; + padding: ${spacings.small}; + display: flex; + align-items: center; + justify-content: space-between; + font-size: ${fonts.sizes.small}; +`; + +const CloseButton = styled(Button)` + width: 24px; + color: ${({ theme }) => theme.secondary}; + margin-left: auto; +`; diff --git a/packages/code-du-travail-frontend/src/layout/Layout.tsx b/packages/code-du-travail-frontend/src/layout/Layout.tsx index 68653b0b4c..71c18e02a4 100644 --- a/packages/code-du-travail-frontend/src/layout/Layout.tsx +++ b/packages/code-du-travail-frontend/src/layout/Layout.tsx @@ -5,12 +5,14 @@ import styled, { css } from "styled-components"; import { ErrorBoundary } from "../common/ErrorBoundary"; import Footer from "./Footer"; import { Header, HEADER_HEIGHT, MOBILE_HEADER_HEIGHT } from "./Header"; +import { Feedback } from "./Feedback"; const Layout = ({ children, currentPage = "" }) => { return (+ ++ + {closeButton} ++ Votre avis compte ! Aidez-nous à nous améliorer. + + Répondre + + + {children} diff --git a/packages/code-du-travail-modeles/CHANGELOG.md b/packages/code-du-travail-modeles/CHANGELOG.md index caa6539e2b..bd0bba3be4 100644 --- a/packages/code-du-travail-modeles/CHANGELOG.md +++ b/packages/code-du-travail-modeles/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.152.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.151.1...v4.152.0) (2024-09-04) + +**Note:** Version bump only for package @socialgouv/modeles-social + ## [4.151.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.151.0...v4.151.1) (2024-08-30) **Note:** Version bump only for package @socialgouv/modeles-social diff --git a/packages/code-du-travail-modeles/package.json b/packages/code-du-travail-modeles/package.json index 8dca4f04c9..cd724d6a64 100644 --- a/packages/code-du-travail-modeles/package.json +++ b/packages/code-du-travail-modeles/package.json @@ -4,7 +4,7 @@ "access": "public", "registry": "https://registry.npmjs.org/" }, - "version": "4.151.1", + "version": "4.152.0", "description": "Les règles publicodes des simulateurs de code du travail numérique", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/packages/code-du-travail-utils/CHANGELOG.md b/packages/code-du-travail-utils/CHANGELOG.md index d1a2de4452..d2ad20bdf1 100644 --- a/packages/code-du-travail-utils/CHANGELOG.md +++ b/packages/code-du-travail-utils/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.152.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.151.1...v4.152.0) (2024-09-04) + +**Note:** Version bump only for package @socialgouv/cdtn-utils + ## [4.151.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.151.0...v4.151.1) (2024-08-30) **Note:** Version bump only for package @socialgouv/cdtn-utils diff --git a/packages/code-du-travail-utils/package.json b/packages/code-du-travail-utils/package.json index 9add696ab6..21809a2b85 100644 --- a/packages/code-du-travail-utils/package.json +++ b/packages/code-du-travail-utils/package.json @@ -4,7 +4,7 @@ "access": "public", "registry": "https://registry.npmjs.org/" }, - "version": "4.151.1", + "version": "4.152.0", "main": "build/index.js", "module": "build/index.js", "types": "build/index.d.ts", diff --git a/packages/react-ui/CHANGELOG.md b/packages/react-ui/CHANGELOG.md index d42afbaf36..70ef3db60f 100644 --- a/packages/react-ui/CHANGELOG.md +++ b/packages/react-ui/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.152.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.151.1...v4.152.0) (2024-09-04) + +**Note:** Version bump only for package @socialgouv/cdtn-ui + ## [4.151.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.151.0...v4.151.1) (2024-08-30) **Note:** Version bump only for package @socialgouv/cdtn-ui diff --git a/packages/react-ui/package.json b/packages/react-ui/package.json index b2636fa9ae..a13d750cc8 100644 --- a/packages/react-ui/package.json +++ b/packages/react-ui/package.json @@ -4,7 +4,7 @@ "access": "public", "registry": "https://registry.npmjs.org/" }, - "version": "4.151.1", + "version": "4.152.0", "description": "Composants ReactJS", "main": "lib/index.js", "files": [