mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-04-30 10:46:57 +02:00
Take navigation name from site meta
This commit is contained in:
parent
0e4e10263c
commit
c9088ade96
1 changed files with 22 additions and 13 deletions
|
@ -1,17 +1,26 @@
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import { Trans, Link } from "gatsby-plugin-react-i18next"
|
import { Trans, Link } from "gatsby-plugin-react-i18next"
|
||||||
|
import { graphql, StaticQuery } from 'gatsby'
|
||||||
|
|
||||||
export default class Navigation extends React.Component {
|
export default function Navigation({isHome, module}) {
|
||||||
render() {
|
return (
|
||||||
return (
|
<div className={"topBar" + (isHome ? " homeBar" : "")}>
|
||||||
<div className={"topBar" + (this.props.isHome ? " homeBar" : "")}>
|
<nav className="topBarInner">
|
||||||
<nav className="topBarInner">
|
<StaticQuery query={graphql`
|
||||||
<Link to="/" className={"logo" + (this.props.module == "home" ? " active" : "")}>KevinK.dev</Link>
|
query {
|
||||||
<div className="flexSpacer"></div>
|
site {
|
||||||
<Link id="navBtnProjects" to="/projects" className={(this.props.module == "projects" ? "active" : "")}><Trans>projects</Trans></Link>
|
siteMetadata {
|
||||||
<Link id="navBtnSocial" to="/social" className={(this.props.module == "social" ? "active" : "")}><Trans>social</Trans></Link>
|
title
|
||||||
</nav>
|
}
|
||||||
</div>
|
}
|
||||||
);
|
}
|
||||||
}
|
`} render={data => (
|
||||||
|
<Link to="/" className={"logo" + (module == "home" ? " active" : "")}>{data.site.siteMetadata.title}</Link>
|
||||||
|
)} />
|
||||||
|
<div className="flexSpacer"></div>
|
||||||
|
<Link id="navBtnProjects" to="/projects" className={(module == "projects" ? "active" : "")}><Trans>projects</Trans></Link>
|
||||||
|
<Link id="navBtnSocial" to="/social" className={(module == "social" ? "active" : "")}><Trans>social</Trans></Link>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue