diff --git a/src/layouts/PrimaryLayout.js b/src/layouts/PrimaryLayout.js index f3f5e3f..8a5df9b 100644 --- a/src/layouts/PrimaryLayout.js +++ b/src/layouts/PrimaryLayout.js @@ -59,19 +59,18 @@ class PrimaryLayout extends PureComponent { // Localized route name. - const lang = langFromPath(location.pathname); + const lang = langFromPath(location.pathname) const newRouteList = - lang !== 'en' + lang !== 'en' ? routeList.map(item => { - const { name , ...other } = item + const { name, ...other } = item return { ...other, - name: ((item[lang] || {}).name || name), + name: (item[lang] || {}).name || name, } }) : routeList - // Find a route that matches the pathname. const currentRoute = newRouteList.find( _ => _.route && pathMatchRegexp(_.route, location.pathname) @@ -148,7 +147,7 @@ class PrimaryLayout extends PureComponent { document.querySelector('#primaryLayout>div')} + target={() => document.querySelector('#primaryLayout')} />