Indicate signing bounties not possible without web3

* show a warning div informing that signing off bounties is not
  possible without a connected wallet (Fixes #28)
This commit is contained in:
Teemu Patja 2017-03-08 22:35:55 +02:00
parent 8aa7c87835
commit e6e62d3adc
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
1 changed files with 6 additions and 1 deletions

View File

@ -59,12 +59,17 @@
(defn bounties-page [] (defn bounties-page []
(let [owner-bounties (rf/subscribe [:owner-bounties])] (let [owner-bounties (rf/subscribe [:owner-bounties])]
(fn [] (fn []
(let [bounties (vals @owner-bounties) (let [web3 (.-web3 js/window)
bounties (vals @owner-bounties)
unpaid? #(empty? (:payout_hash %)) unpaid? #(empty? (:payout_hash %))
paid? #(not-empty (:payout_hash %)) paid? #(not-empty (:payout_hash %))
unpaid-bounties (filter unpaid? bounties) unpaid-bounties (filter unpaid? bounties)
paid-bounties (filter paid? bounties)] paid-bounties (filter paid? bounties)]
[:div.ui.container [:div.ui.container
(when (nil? web3)
[:div.ui.warning.message
[:i.warning.icon]
"To sign off claims, please view Commiteth in Status, Mist or Metamask"])
[:h3 "New claims"] [:h3 "New claims"]
[claim-list unpaid-bounties] [claim-list unpaid-bounties]
[:h3 "Old claims"] [:h3 "Old claims"]