From fb8bc6b1a964c3ef673276e9ed4c1a6ee34f103d Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 14 Feb 2022 18:10:33 +0100 Subject: chore: add a banner for users with JS disabled --- src/components/Layouts/Layout.module.scss | 20 ++++++++++++++++++++ src/components/Layouts/Layout.tsx | 13 +++++++++++++ src/i18n/en.json | 4 ++++ src/i18n/fr.json | 4 ++++ src/styles/pages/Page.module.scss | 6 ++++++ 5 files changed, 47 insertions(+) create mode 100644 src/components/Layouts/Layout.module.scss diff --git a/src/components/Layouts/Layout.module.scss b/src/components/Layouts/Layout.module.scss new file mode 100644 index 0000000..33339d4 --- /dev/null +++ b/src/components/Layouts/Layout.module.scss @@ -0,0 +1,20 @@ +@use "@styles/abstracts/functions" as fun; + +.noscript { + width: 100%; + padding: var(--spacing-xs) var(--spacing-sm); + position: fixed; + top: 0; + z-index: 10; + background: var(--color-bg); + border-bottom: fun.convert-px(3) solid var(--color-border); + color: var(--color-primary-darker); + font-size: var(--font-size-sm); + font-weight: 600; + text-align: center; +} + +.noscript-spacing { + width: 100%; + height: fun.convert-px(80); +} diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index 420b37a..eb725d2 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -8,6 +8,7 @@ import { useRouter } from 'next/router'; import { ReactElement, ReactNode, useEffect, useRef } from 'react'; import { useIntl } from 'react-intl'; import { WebSite, WithContext } from 'schema-dts'; +import styles from './Layout.module.scss'; const Layout = ({ children, @@ -94,6 +95,9 @@ const Layout = ({ dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} > + {intl.formatMessage({ @@ -104,6 +108,15 @@ const Layout = ({
{children}