Loading div for manage payouts view
This commit is contained in:
parent
5f3c4a7a3c
commit
cd71e9172d
|
@ -182,7 +182,7 @@
|
||||||
(reg-event-fx
|
(reg-event-fx
|
||||||
:load-owner-bounties
|
:load-owner-bounties
|
||||||
(fn [{:keys [db]} [_]]
|
(fn [{:keys [db]} [_]]
|
||||||
{:db db
|
{:db (assoc db :owner-bounties-loading? true)
|
||||||
:http {:method GET
|
:http {:method GET
|
||||||
:url "/api/user/bounties"
|
:url "/api/user/bounties"
|
||||||
:on-success #(dispatch [:set-owner-bounties %])}}))
|
:on-success #(dispatch [:set-owner-bounties %])}}))
|
||||||
|
@ -190,7 +190,9 @@
|
||||||
(reg-event-db
|
(reg-event-db
|
||||||
:set-owner-bounties
|
:set-owner-bounties
|
||||||
(fn [db [_ issues]]
|
(fn [db [_ issues]]
|
||||||
(assoc db :owner-bounties issues)))
|
(assoc db
|
||||||
|
:owner-bounties issues
|
||||||
|
:owner-bounties-loading? false)))
|
||||||
|
|
||||||
(defn get-ls-token [db token]
|
(defn get-ls-token [db token]
|
||||||
(let [login (get-in db [:user :login])]
|
(let [login (get-in db [:user :login])]
|
||||||
|
|
|
@ -59,8 +59,13 @@
|
||||||
|
|
||||||
|
|
||||||
(defn manage-payouts-page []
|
(defn manage-payouts-page []
|
||||||
(let [owner-bounties (rf/subscribe [:owner-bounties])]
|
(let [owner-bounties (rf/subscribe [:owner-bounties])
|
||||||
|
owner-bounties-loading? (rf/subscribe [:get-in [:owner-bounties-loading?]])]
|
||||||
(fn []
|
(fn []
|
||||||
|
(if @owner-bounties-loading?
|
||||||
|
[:container
|
||||||
|
[:div.ui.active.inverted.dimmer
|
||||||
|
[: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 %))
|
unpaid? #(empty? (:payout_hash %))
|
||||||
|
@ -75,4 +80,4 @@
|
||||||
[:h3 "New claims"]
|
[:h3 "New claims"]
|
||||||
[claim-list unpaid-bounties]
|
[claim-list unpaid-bounties]
|
||||||
[:h3 "Old claims"]
|
[:h3 "Old claims"]
|
||||||
[claim-list paid-bounties]]))))
|
[claim-list paid-bounties]])))))
|
||||||
|
|
Loading…
Reference in New Issue