Skip to content

Commit

Permalink
Bottom sheet where send amount locked got initial value
Browse files Browse the repository at this point in the history
  • Loading branch information
vkjr committed Jun 20, 2024
1 parent acd6605 commit 8d0a220
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/status_im/contexts/wallet/send/routes/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
chain-ids]))}]))}]))

(defn- edit-amount
[{:keys [chain-id token-symbol send-amount-in-crypto]}]
[{:keys [chain-id token-symbol send-amount-in-crypto init-amount]}]
(rf/dispatch
[:show-bottom-sheet
{:content
Expand All @@ -106,6 +106,9 @@
locked-amount (get send-from-locked-amounts chain-id)
network-name-str (string/capitalize (name network-name))
[input-state set-input-state] (rn/use-state (cond-> controlled-input/init-state
init-amount
(controlled-input/set-input-value
(money/to-string init-amount))
locked-amount
(controlled-input/set-input-value
locked-amount)))
Expand Down Expand Up @@ -266,7 +269,7 @@
(cond
(= type :add)
(open-preferences)
on-long-press (on-long-press chain-id)))}]]))
on-long-press (on-long-press chain-id total-amount)))}]]))
network-values)])

(defn render-network-links
Expand Down Expand Up @@ -379,12 +382,12 @@
chain-id-to-disable
disabled-from-chain-ids
token-available-networks-for-suggested-routes))

:on-long-press (fn [chain-id]
:on-long-press (fn [chain-id amount-calculated-for-chain]
(edit-amount
{:chain-id chain-id
:token-symbol token-symbol
:send-amount-in-crypto send-amount-in-crypto}))
{:chain-id chain-id
:token-symbol token-symbol
:send-amount-in-crypto send-amount-in-crypto
:init-amount amount-calculated-for-chain}))
:receiver? false
:theme theme
:loading-routes? loading-routes?
Expand Down

0 comments on commit 8d0a220

Please sign in to comment.