remove material, assume revoke dispatch just passes up issue-id

and is not responsible for dispatching anything but a banner on success
This commit is contained in:
Rob Culliton 2018-05-03 13:25:26 -04:00
parent 9c57a61471
commit 8dc9836be2
No known key found for this signature in database
GPG Key ID: 6FDEF60B3DC84D94
3 changed files with 19 additions and 26 deletions

View File

@ -66,9 +66,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></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://unpkg.com/tachyons@4.9.1/css/tachyons.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<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>

View File

@ -416,6 +416,10 @@
:revoke-bounty-success
interceptors
(fn [{:keys [db]} [_ {:keys [issue-id owner-address contract-address confirm-hash]}]]
;; replace with dispatch of pending banner
;; confirm-payout dispatch will be called by a component
;; that subscribes to owner-bounties
;; which will get an updated confirm_hash from the scheduler
{:dispatch [:confirm-payout {:issue_id issue-id
:owner_address owner-address
:contract_address contract-address
@ -434,13 +438,12 @@
(reg-event-fx
:revoke-bounty
interceptors
(fn [{:keys [db]} [_ fields]]
(let [issue-id (:issue_id fields)]
{:http {:method POST
:url "/api/user/revoke"
:on-success #(dispatch [:revoke-bounty-success (merge fields %)])
:on-error #(dispatch [:revoke-bounty-error issue-id %])
:params fields}})))
(fn [{:keys [db]} [_ {:keys [issue-id]}]]
{:http {:method POST
:url "/api/user/revoke"
:on-success #(dispatch [:revoke-bounty-success %])
:on-error #(dispatch [:revoke-bounty-error %])
:params {:issue-id issue-id}}}))
(reg-event-fx
:confirm-payout

View File

@ -64,14 +64,7 @@
"Signed off"
"Confirm Payment")])))
(defn revoke-button [{issue-id :issue-id
contract-address :contract_address
owner-address :owner_address}]
[:button.ui.button
{:on-click #(rf/dispatch [:revoke-bounty {:contract-address contract-address
:issue-id issue-id
:owner-address owner-address}])}
"Revoke"])
(defn confirm-row [bounty claim]
(let [payout-address-available? (:payout_address bounty)]
@ -252,19 +245,19 @@
[:div
[ui-balances/usd-value-label (:value-usd bounty)]]])
;; [revoke-button bounty]
(defn three-dots-button [{value-usd :value-usd :as bounty}]
(when (pos? value-usd)
[:div.fl.w-20
[:button#menu-lower-right.mdl-button.mdl-js-button.mdl-button--icon
[:i.material-icons "more_horiz"]]]))
(defn revoke-button [bounty]
(let [{:keys [issue-id value-usd]} bounty]
(when (pos? value-usd)
[:div.fl.w-20
[:button.ui.button
{:on-click #(rf/dispatch [:revoke-bounty {:issue-id issue-id}])}
"Revoke"]])))
(defn unclaimed-bounty [bounty]
[:div.w-third-l.fl-l.pa2
[square-card
[bounty-title-link bounty {:show-date? true :max-length 60}]
[:div [small-card-balances bounty] [three-dots-button bounty]]]])
[:div [small-card-balances bounty] [revoke-button bounty]]]])
(defn paid-bounty [bounty]
[:div.w-third-l.fl-l.pa2