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!
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

32 řádky
889B

  1. import { h, Component } from 'preact';
  2. class WBBreadcrumbs extends Component {
  3. render({ items, onItemClicked }) {
  4. return (
  5. <nav aria-label="breadcrumb">
  6. <ol class="breadcrumb">
  7. { items.map((item, idx) => (
  8. <li class={ 'breadcrumb-item' +
  9. (idx == items.length - 1 ? ' active' : '') }>
  10. {
  11. (idx < items.length - 1) ? (
  12. <a href="#" onclick={ e => { e.preventDefault();
  13. onItemClicked(item); } }>{ typeof(item) === 'string' ? item : item['name'] }</a>
  14. ) : (
  15. typeof(item) === 'string' ? item : item['name']
  16. )
  17. }
  18. </li>
  19. )) }
  20. </ol>
  21. </nav>
  22. );
  23. }
  24. }
  25. WBBreadcrumbs.defaultProps = {
  26. 'onItemClicked': () => {}
  27. }
  28. export default WBBreadcrumbs;