From 8939d68b3b8c006fa0272670dcf993aa9b07c722 Mon Sep 17 00:00:00 2001 From: matiasbenary Date: Thu, 1 Aug 2024 14:03:32 -0300 Subject: [PATCH] fix: hide on logo when used in an iframe (#2193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: hide on logo when used in an iframe * fix: build check * fix: build check * fix: build check * fix: build check * fix: build check --------- Co-authored-by: Damián Parrino --- website/src/theme/Navbar/Logo/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/website/src/theme/Navbar/Logo/index.js b/website/src/theme/Navbar/Logo/index.js index 0ab73ab1715..d85776fb19c 100644 --- a/website/src/theme/Navbar/Logo/index.js +++ b/website/src/theme/Navbar/Logo/index.js @@ -1,13 +1,11 @@ import React from 'react'; import Logo from '@theme/Logo'; -import BrowserOnly from '@docusaurus/BrowserOnly'; +import useIsBrowser from '@docusaurus/useIsBrowser'; export default function NavbarLogo() { - + const isBrowser = useIsBrowser(); // if embedded in an iframe, do not show the logo - - {() => { if (window.location !== window.parent.location) return null; }} - + if (isBrowser && typeof window !== 'undefined' && window.self !== window.top) return null; return (