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!
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

40 satır
1.0KB

  1. import { h, Component } from 'preact';
  2. import { Router, route } from 'preact-router';
  3. import WBBrowse from 'wb-browse';
  4. import WBSignIn from 'wb-sign-in';
  5. import WBLandingPage from 'wb-landing-page';
  6. class WBApp extends Component {
  7. constructor(...args) {
  8. super(...args);
  9. this.state.arvHost = window.localStorage['arvHost'];
  10. this.state.arvToken = window.localStorage['arvToken'];
  11. this.appCallbacks = {
  12. 'navbarItemClicked': this.navbarItemClicked
  13. };
  14. }
  15. navbarItemClicked(item) {
  16. if (item['id'] === 'sign-out') {
  17. delete window.localStorage['arvHost'];
  18. delete window.localStorage['arvToken'];
  19. delete window.localStorage['currentUser'];
  20. route('/sign-in');
  21. }
  22. }
  23. render({}, { activePage, arvHost, arvToken }) {
  24. return (
  25. <Router>
  26. <WBLandingPage path="/" />
  27. <WBSignIn path="/sign-in" />
  28. <WBBrowse path="/browse/:ownerUuid?" appCallbacks={ this.appCallbacks } />
  29. </Router>
  30. );
  31. }
  32. }
  33. export default WBApp;