From 424299e54a0b382caaa763be2f81a60ad714047a Mon Sep 17 00:00:00 2001 From: Noa Santo <72336443+virus-rpi@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:17:37 +0000 Subject: [PATCH] feat: add button to reconfigure cookie consent --- src/assets/locales/de/translations.json | 3 ++- src/assets/locales/en/translations.json | 3 ++- src/pages/data-privacy.tsx | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/assets/locales/de/translations.json b/src/assets/locales/de/translations.json index f294911c6..51885a37d 100644 --- a/src/assets/locales/de/translations.json +++ b/src/assets/locales/de/translations.json @@ -90,5 +90,6 @@ "image.attribution": "Foto von ", "iframemanager.youtube.notice": "Dieser Inhalt wird von einer externen Quelle gehostet. Durch das Laden des Inhalts akzeptieren Sie die Nutzungsbedingungen von youtube.com und stimmen einer möglichen Übertragung Ihrer Daten in Drittländer zu.", "iframemanager.youtube.load-button": "Inhalt laden", - "iframemanager.youtube.load-all-button": "Inhalt laden und nicht mehr fragen" + "iframemanager.youtube.load-all-button": "Inhalt laden und nicht mehr fragen", + "dataprivacy.reopen-cookie-consent": "Cookie-Einstellungen erneut öffnen" } diff --git a/src/assets/locales/en/translations.json b/src/assets/locales/en/translations.json index 73e667e9a..2a3b73883 100644 --- a/src/assets/locales/en/translations.json +++ b/src/assets/locales/en/translations.json @@ -90,5 +90,6 @@ "image.attribution": "Photo by ", "iframemanager.youtube.notice": "This content is hosted by a third party. By showing the external content you accept the terms and conditions of youtube.com and agree to a possible transfer of your data to third countries.", "iframemanager.youtube.load-button": "Load content", - "iframemanager.youtube.load-all-button": "Load content and don't ask again" + "iframemanager.youtube.load-all-button": "Load content and don't ask again", + "dataprivacy.reopen-cookie-consent": "Reopen cookie consent preferences" } diff --git a/src/pages/data-privacy.tsx b/src/pages/data-privacy.tsx index 3d0081cbe..a70510af8 100644 --- a/src/pages/data-privacy.tsx +++ b/src/pages/data-privacy.tsx @@ -5,6 +5,9 @@ import { Layout } from '../components/layout/layout'; import { ContentBlockContainer } from '../components/layout/content-block-container'; import { ContentfulRichText } from '../components/content/rich-text/rich-text'; import { ContentfulPage, ContentfulRichTextType } from '../types'; +import * as CookieConsentLib from 'vanilla-cookieconsent'; +import { Button } from '../components/ui/buttons/button'; +import { useTranslation } from 'react-i18next'; interface DataPrivacyPageQueryProps { contentfulPage: ContentfulPage; @@ -14,9 +17,20 @@ interface DataPrivacyPageQueryProps { const DataPrivacyPage = ({ data, }: PageProps): JSX.Element => { + const { t } = useTranslation(); + + const reopenCookieConsent = () => { + if (CookieConsentLib && CookieConsentLib.showPreferences) { + CookieConsentLib.showPreferences(); + } + }; + return ( +