From 24504be4d7b9952d5a1161b7b54b5bcb59b68771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20Alkovi=C4=87?= <77000136+goranalkovic-infinum@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:01:31 +0200 Subject: [PATCH 1/2] add a message if service workers are not supported in the Playground --- website/src/pages/playground.js | 38 ++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/website/src/pages/playground.js b/website/src/pages/playground.js index f68786975..c2b96d09b 100644 --- a/website/src/pages/playground.js +++ b/website/src/pages/playground.js @@ -7,6 +7,8 @@ export default function Playground() { const context = useDocusaurusContext(); const { siteConfig = {} } = context; + const supportsServiceWorkers = 'serviceWorker' in navigator; + // Temporary URL - will be replaced with the real one once the repo is pushed. Needs to be a direct link to the zip file. const themeZipUrl = 'https://raw.githubusercontent.com/goranalkovic-infinum/fe-libs-theme-playground-test/main/es-wp-playground.zip'; @@ -19,11 +21,37 @@ export default function Playground() { metaImage={useBaseUrl(`img/${siteConfig.customFields.image}`)} wrapperClassName='es-single-full-screen-child es-has-t-border' > - + {!supportsServiceWorkers && ( +