Skip to content

Commit

Permalink
implement navbar customization
Browse files Browse the repository at this point in the history
  • Loading branch information
FreakDev committed Oct 25, 2017
1 parent c44a1a8 commit 095ac39
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/NavigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ import React from 'react'

import { Link } from 'react-router-dom';

export default ({ pages }) => {
export default ({ pages, ...props }) => {
return (
<nav>
<ul>{
pages.map((page, k) => {
return (
<li key={k}>
<Link to={ page.path }>
{ page.name }
</Link>
</li>
)
})
}</ul>
</nav>
<nav>{
props.render ?
props.render(pages) :
(
<ul>{
pages.map((page, k) => {
return (
<li key={k}>
<Link to={ page.path }>{
props.link ? props.link(page) : page.name
}</Link>
</li>
)
})
}</ul>
)
}</nav>
)
}

0 comments on commit 095ac39

Please sign in to comment.