import React from 'react'; import { graphql, useStaticQuery } from 'gatsby'; import { connect } from 'react-redux'; import AniLink from 'gatsby-plugin-transition-link/AniLink'; import ReactCSSTransitionReplace from 'react-css-transition-replace'; import config from '../../../config'; import { toggleDarkMode } from '../state/app'; import SearchIcon from './SVGs/SearchIcon'; import GithubIcon from './SVGs/GithubIcon'; import DarkModeIcon from './SVGs/DarkModeIcon'; import LightModeIcon from './SVGs/LightModeIcon'; import ListIcon from './SVGs/ListIcon'; // =================================================== // Application-level UI component // =================================================== const Shell = ({ isDarkMode, isSearch, isList, dispatch, withIcon = true, withTitle = true, children, }) => { const data = useStaticQuery(graphql` query SiteTitleQuery { site { siteMetadata { title description } } file(relativePath: { eq: "30s-icon.png" }) { id childImageSharp { original { src } } } snippetDataJson(meta: { type: { eq: "snippetListingArray" } }) { data { title id attributes { tags } } } } `); let viewportWidth = typeof window !== 'undefined' && window.innerWidth; return (