From f9d154c59596dc0c893dfe18a5272e432a3cdc31 Mon Sep 17 00:00:00 2001 From: BaskarMitrah Date: Tue, 18 Jun 2024 18:58:26 +0530 Subject: [PATCH] --Fixed the hamburger issue on the theme --- .../gatsby-theme-aio/src/components/GlobalHeader/index.js | 3 +++ packages/gatsby-theme-aio/src/components/Layout/index.js | 6 +++--- packages/gatsby-theme-aio/src/components/SideNav/index.js | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/gatsby-theme-aio/src/components/GlobalHeader/index.js b/packages/gatsby-theme-aio/src/components/GlobalHeader/index.js index e38a5a45e6..b92733f1dd 100644 --- a/packages/gatsby-theme-aio/src/components/GlobalHeader/index.js +++ b/packages/gatsby-theme-aio/src/components/GlobalHeader/index.js @@ -311,6 +311,9 @@ const GlobalHeader = ({ grid-area: title; padding-left: ${!hasSideNav ? 'var(--spectrum-global-dimension-size-200)' : '0'}; } + @media screen and (width: 768px ){ + margin-left: 40px; + } `}>
{ }, [setShowSearch]); useEffect( () => { - if (window.innerWidth >= parseInt(MOBILE_SCREEN_WIDTH)) { + if (window.innerWidth >= 1280) { setShowSideNav(false); setHasSideNav(false); } @@ -420,11 +420,11 @@ export default ({ children, pageContext, location }) => { console.error(`AIO: Failed fetching search index.\n${err}`); }); } - if (window.innerWidth <= parseInt(MOBILE_SCREEN_WIDTH)) { + if (window.innerWidth <= 1280) { setHasSideNav(true); } window.addEventListener('resize', () => { - if (window.innerWidth <= parseInt(MOBILE_SCREEN_WIDTH)) { + if (window.innerWidth <= 1280) { setHasSideNav(true); } }); diff --git a/packages/gatsby-theme-aio/src/components/SideNav/index.js b/packages/gatsby-theme-aio/src/components/SideNav/index.js index 61c3cfe8a7..ae63734b04 100644 --- a/packages/gatsby-theme-aio/src/components/SideNav/index.js +++ b/packages/gatsby-theme-aio/src/components/SideNav/index.js @@ -83,13 +83,14 @@ const SideNav = ({versions, mainNavPages, selectedPages, selectedSubPages, setSh }, [location.pathname]) useEffect(() => { - if (window.innerWidth <= parseInt(MOBILE_SCREEN_WIDTH)) { + + if (window.innerWidth <= 1280) { setMobileView(true); } else { setMobileView(false); } window.addEventListener('resize', () => { - if (window.innerWidth <= parseInt(MOBILE_SCREEN_WIDTH)) { + if (window.innerWidth <= 1280) { setMobileView(true); } else { setMobileView(false);