Advertisement
xapu

Untitled

Nov 15th, 2017
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. --some code --
  2. let Navbar = props => {
  3. return (
  4. <div className='menu'>
  5. <Link to='/'>Home</Link>
  6. <a href='#'>Discover</a>
  7. <Link to='/me'>Me</Link>
  8. <a onClick={()=>{props.logoutFunc(props.store._kmd.authtoken)}}>Logout</a>
  9. </div>
  10. )
  11. }
  12. -- some more code
  13.  
  14. ----!!Switch starts here!!--
  15. let ElementBlender = props => {
  16. if (Object.keys(props.store.auth).length===0) {
  17. return (
  18. <Switch>
  19. <Route path='/' component={Auth} />
  20. </Switch>
  21. )
  22. }
  23. return (
  24. <Switch>
  25. <Route path="/me" component={Me} />
  26. <Route exact path="/" component={Home} />
  27. </Switch>
  28. )
  29. }
  30.  
  31. --- more code goes here ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement