navigation_portal.tsx 966 B

12345678910111213141516171819202122232425
  1. import { Switch, Route } from 'react-router-dom';
  2. import AccountNavigation from 'mastodon/features/account/navigation';
  3. import Trends from 'mastodon/features/getting_started/containers/trends_container';
  4. import { showTrends } from 'mastodon/initial_state';
  5. const DefaultNavigation: React.FC = () =>
  6. showTrends ? (
  7. <>
  8. <div className='flex-spacer' />
  9. <Trends />
  10. </>
  11. ) : null;
  12. export const NavigationPortal: React.FC = () => (
  13. <Switch>
  14. <Route path='/@:acct' exact component={AccountNavigation} />
  15. <Route path='/@:acct/tagged/:tagged?' exact component={AccountNavigation} />
  16. <Route path='/@:acct/with_replies' exact component={AccountNavigation} />
  17. <Route path='/@:acct/followers' exact component={AccountNavigation} />
  18. <Route path='/@:acct/following' exact component={AccountNavigation} />
  19. <Route path='/@:acct/media' exact component={AccountNavigation} />
  20. <Route component={DefaultNavigation} />
  21. </Switch>
  22. );