Merge pull request #57 from HeinrichFilter/fix-root-path-in-layout
Fixes #56 Make layout `pathPrefix` aware
This commit is contained in:
commit
b17dafaccc
1 changed files with 7 additions and 1 deletions
|
|
@ -8,7 +8,13 @@ class Template extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const { location, children } = this.props
|
const { location, children } = this.props
|
||||||
let header
|
let header
|
||||||
if (location.pathname === '/') {
|
|
||||||
|
let rootPath = `/`
|
||||||
|
if (typeof __PREFIX_PATHS__ !== `undefined` && __PREFIX_PATHS__) {
|
||||||
|
rootPath = __PATH_PREFIX__ + `/`
|
||||||
|
}
|
||||||
|
|
||||||
|
if (location.pathname === rootPath) {
|
||||||
header = (
|
header = (
|
||||||
<h1
|
<h1
|
||||||
style={{
|
style={{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue