Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- render() {
- const { customer } = this.props
- const options = customer.isLoggedIn ? [
- { key: 'p1', name: 'Private Page 1', ref: '/private-page-1' },
- { key: 'p2', name: 'Private Page 2', ref: '/private-page-2' },
- { key: 'l', name: 'Logout', ref: '/' },
- ] : [
- { key: 'l', name: 'Login', ref: '/' },
- ]
- return (
- <div className="App-menu">
- <ul>
- {
- options.map( ( opt ) => {
- return (
- <li key={ opt.key }>
- <Link to={ opt.ref }>{ opt.name }</Link>
- </li>
- )
- } )
- }
- </ul>
- </div>
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement