IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
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.

39 lines
1.3KB

  1. //
  2. // Copyright (C) Stanislaw Adaszewski, 2020
  3. // Contact: s.adaszewski@gmail.com
  4. // Website: https://adared.ch/wba
  5. // License: GNU Affero General Public License, Version 3
  6. //
  7. import { h, Component } from 'preact';
  8. import WBNavbar from 'wb-navbar';
  9. import WBInlineSearch from 'wb-inline-search';
  10. class WBNavbarCommon extends Component {
  11. render({ app, items, activeItem, textSearch, textSearchNavigate }) {
  12. return (
  13. <WBNavbar
  14. items={ [
  15. { 'name': 'Home', 'id': 'home' },
  16. { 'name': 'All Projects', 'id': 'all-projects' },
  17. { 'name': 'All Users', 'id': 'all-users' },
  18. { 'name': 'Shared with Me', 'id': 'shared-with-me' },
  19. { 'name': 'Current User', 'dropdown': [ { 'id': 'sign-out', 'name': 'Sign Out' } ]},
  20. { name: (<span>What's New <sup><span class="badge badge-info">Info</span></sup></span>), id: 'whatsnew' }
  21. ].concat(items) }
  22. rhs={ textSearchNavigate ? (
  23. <WBInlineSearch textSearch={ textSearch } navigate={ textSearchNavigate } />
  24. ) : null }
  25. titleUrl = { '/browse/' + app.state.currentUser.uuid }
  26. getItemUrl={ item => app.navbarItemUrl(item) }
  27. activeItem={ activeItem } />
  28. );
  29. }
  30. }
  31. WBNavbarCommon.defaultProps = {
  32. 'items': []
  33. };
  34. export default WBNavbarCommon;