Skip to content

Commit

Permalink
Merge route into pageInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
verekia committed Jul 8, 2019
1 parent 5b329d2 commit 8e7980c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/shared/src/get-page-info.js
@@ -1,10 +1,14 @@
// @flow

const getPageInfo = (route: Object, state: Object, match: Object) => {
const pageInfo = {}
const pageInfo = { ...route }
if (route.title !== undefined) {
pageInfo.title = typeof route.title === 'function' ? route.title(state, match) : route.title
}
if (route.mobileTitle !== undefined) {
pageInfo.mobileTitle =
typeof route.mobileTitle === 'function' ? route.mobileTitle(state, match) : route.mobileTitle
}
if (route.backNav !== undefined) {
pageInfo.backNav =
typeof route.backNav === 'function' ? route.backNav(state, match) : route.backNav
Expand Down

0 comments on commit 8e7980c

Please sign in to comment.