message: refactor: gatsby plugin
diff: @@ -4,23 +4,22 @@ import {
  ColorModeProvider,
  CSSReset,
  GlobalStyle,
  + PortalManager,
  } from "@chakra-ui/core"
  import theme from "./src/theme"
  export const wrapRootElement = (
  { element },
  { isResettingCSS = true, isUsingColorMode = true },
  -) => (
  +) => {
  + const ModeProvider = isUsingColorMode ? ColorModeProvider : React.Fragment
  + return (
  <ThemeProvider theme={theme}>
  + <ModeProvider>
  <GlobalStyle />
  - {isResettingCSS && !isUsingColorMode && <CSSReset />}
  - {isUsingColorMode ? (
  - <ColorModeProvider>
  {isResettingCSS && <CSSReset />}
  - {element}
  - </ColorModeProvider>
  - ) : (
  - element
  - )}
  + <PortalManager>{element}</PortalManager>
  + </ModeProvider>
  </ThemeProvider>
  )
  +}
  