How to use the gatsby-theme-apollo-core.useResponsiveSidebar function in gatsby-theme-apollo-core

To help you get started, we’ve selected a few gatsby-theme-apollo-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wp-graphql / wp-graphql / docs / src / gatsby-theme-apollo-docs / components / page-layout.js View on Github external
const data = useStaticQuery(
    graphql`
      {
        site {
          siteMetadata {
            title
            siteName
            subtitle
          }
        }
      }
    `
  )

  const { openSidebar, closeSidebar, sidebarOpen } = useResponsiveSidebar()

  const buttonRef = useRef(null)
  const [menuOpen, setMenuOpen] = useState(false)

  function openMenu() {
    setMenuOpen(true)
  }

  function closeMenu() {
    setMenuOpen(false)
  }

  function handleWrapperClick(event) {
    if (sidebarOpen && !sidebarRef.current.contains(event.target)) {
      closeSidebar()
    }
github apollographql / gatsby-theme-apollo / packages / gatsby-theme-apollo-docs / src / components / page-layout.js View on Github external
title
            siteName
            subtitle
          }
        }
      }
    `
  );

  const {
    sidebarRef,
    openSidebar,
    sidebarOpen,
    handleWrapperClick,
    handleSidebarNavLinkClick
  } = useResponsiveSidebar();

  const buttonRef = useRef(null);
  const [menuOpen, setMenuOpen] = useState(false);
  const selectedLanguageState = useLocalStorage('docs-lang');

  function openMenu() {
    setMenuOpen(true);
  }

  function closeMenu() {
    setMenuOpen(false);
  }

  const {pathname} = props.location;
  const {siteName, title, subtitle} = data.site.siteMetadata;
  const {