You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

  1. import React from 'react';
  2. import { Switch, Route, withRouter } from 'react-router-dom';
  3. import { showTrends } from 'mastodon/initial_state';
  4. import Trends from 'mastodon/features/getting_started/containers/trends_container';
  5. import AccountNavigation from 'mastodon/features/account/navigation';
  6. const DefaultNavigation = () => (
  7. <>
  8. {showTrends && (
  9. <>
  10. <div className='flex-spacer' />
  11. <Trends />
  12. </>
  13. )}
  14. </>
  15. );
  16. export default @withRouter
  17. class NavigationPortal extends React.PureComponent {
  18. render () {
  19. return (
  20. <Switch>
  21. <Route path='/@:acct' exact component={AccountNavigation} />
  22. <Route path='/@:acct/tagged/:tagged?' exact component={AccountNavigation} />
  23. <Route path='/@:acct/with_replies' exact component={AccountNavigation} />
  24. <Route path='/@:acct/followers' exact component={AccountNavigation} />
  25. <Route path='/@:acct/following' exact component={AccountNavigation} />
  26. <Route path='/@:acct/media' exact component={AccountNavigation} />
  27. <Route component={DefaultNavigation} />
  28. </Switch>
  29. );
  30. }
  31. }