mirror of
https://github.com/status-im/open-bounty.git
synced 2025-01-12 02:24:18 +00:00
fix #301: add basic stats to manage payouts screen
This commit is contained in:
parent
9d9ebefc30
commit
3cdfa549b7
@ -65,6 +65,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|||||||
src="https://www.facebook.com/tr?id=293089407869419&ev=PageView&noscript=1"
|
src="https://www.facebook.com/tr?id=293089407869419&ev=PageView&noscript=1"
|
||||||
/></noscript>
|
/></noscript>
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css" rel="stylesheet" type="text/css" />
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="/css/style.css?v={{commiteth-version}}" rel="stylesheet" type="text/css" />
|
<link href="/css/style.css?v={{commiteth-version}}" rel="stylesheet" type="text/css" />
|
||||||
<script type="text/javascript" src="/js/app.js?v={{commiteth-version}}"></script>
|
<script type="text/javascript" src="/js/app.js?v={{commiteth-version}}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
@ -57,6 +57,19 @@
|
|||||||
(:claims bounty))]
|
(:claims bounty))]
|
||||||
[claim-card bounty claim]))))
|
[claim-card bounty claim]))))
|
||||||
|
|
||||||
|
(defn bounty-stats [{:keys [paid unpaid]}]
|
||||||
|
(let [sum-dollars (fn [bounties]
|
||||||
|
(reduce + (map #(js/parseFloat (:value_usd %)) bounties)))]
|
||||||
|
[:div.cf.pv4
|
||||||
|
[:div.fl.w-50.tc
|
||||||
|
[:div.ttu.tracked "Open"]
|
||||||
|
[:div.f2.pa2 "$" (sum-dollars unpaid)]
|
||||||
|
[:div (count unpaid) " bounties"]]
|
||||||
|
|
||||||
|
[:div.fl.w-50.tc
|
||||||
|
[:div.ttu.tracked "Paid"]
|
||||||
|
[:div.f2.pa2 "$" (sum-dollars paid)]
|
||||||
|
[:div (count paid) " bounties"]]]))
|
||||||
|
|
||||||
(defn manage-payouts-page []
|
(defn manage-payouts-page []
|
||||||
(let [owner-bounties (rf/subscribe [:owner-bounties])
|
(let [owner-bounties (rf/subscribe [:owner-bounties])
|
||||||
@ -68,15 +81,16 @@
|
|||||||
[:div.ui.text.loader "Loading"]]]
|
[:div.ui.text.loader "Loading"]]]
|
||||||
(let [web3 (.-web3 js/window)
|
(let [web3 (.-web3 js/window)
|
||||||
bounties (vals @owner-bounties)
|
bounties (vals @owner-bounties)
|
||||||
unpaid? #(empty? (:payout_hash %))
|
paid? :payout_hash
|
||||||
paid? #(not-empty (:payout_hash %))
|
unpaid-bounties (filter (complement paid?) 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)
|
(when (nil? web3)
|
||||||
[:div.ui.warning.message
|
[:div.ui.warning.message
|
||||||
[:i.warning.icon]
|
[:i.warning.icon]
|
||||||
"To sign off claims, please view Status Open Bounty in Status, Mist or Metamask"])
|
"To sign off claims, please view Status Open Bounty in Status, Mist or Metamask"])
|
||||||
|
[bounty-stats {:paid paid-bounties
|
||||||
|
:unpaid unpaid-bounties}]
|
||||||
[:h3 "New claims"]
|
[:h3 "New claims"]
|
||||||
[claim-list unpaid-bounties]
|
[claim-list unpaid-bounties]
|
||||||
[:h3 "Old claims"]
|
[:h3 "Old claims"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user