aboutsummaryrefslogtreecommitdiff
path: root/src/components/Sidebar/Branding.js
blob: 96d17db323cc0a8bba7135743d3f83b2a2573f75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** @jsx jsx */
import { graphql, useStaticQuery } from "gatsby";
import { jsx } from "theme-ui";
import Link from "../Link";
import LogoComponent from "../Logo";
import ScreenReader from "../ScreenReader";

const Title = LogoComponent ? ScreenReader : "span";

const logo = LogoComponent && (
  <LogoComponent aria-hidden sx={{ display: "block", height: "1.5em" }} />
);

function Branding() {
  const { site } = useStaticQuery(graphql`
    query {
      site {
        siteMetadata {
          title
        }
      }
    }
  `);

  return (
    <div sx={{ variant: "layout.container", px: 0 }}>
      <h3 sx={{ fontSize: "inherit", m: 0 }}>
        <Link
          to="/"
          sx={{
            variant: "linkStyles.nav",
            ":hover": { color: "inherit", textDecoration: "none" },
            "&.active": { color: "inherit" }
          }}
        >
          {logo}
          <Title>{site.siteMetadata.title}</Title>
        </Link>
      </h3>
    </div>
  );
}

export default Branding;