reintroduce bonder fees informational bottom sheet

This commit is contained in:
Brian Sztamfater 2024-11-25 18:38:46 -03:00
parent 01517645f3
commit 77b9c04ca6
No known key found for this signature in database
GPG Key ID: 59EB921E0706B48F
3 changed files with 39 additions and 15 deletions

View File

@ -6,10 +6,43 @@
[status-im.common.not-implemented :as not-implemented]
[status-im.contexts.wallet.send.input-amount.style :as style]
[status-im.feature-flags :as ff]
[utils.i18n :as i18n]))
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(defn- bonder-fee-info-sheet
[]
[:<>
[quo/drawer-top
{:title (i18n/label :t/understanding-bonder-fees-title)}]
[rn/view {:style {:padding-horizontal 20}}
[quo/text
{:weight :regular
:size :paragraph-2}
(i18n/label :t/understanding-bonder-fees-description)]]])
(defn- show-bonder-fee-info
[]
(rf/dispatch
[:show-bottom-sheet {:content bonder-fee-info-sheet}]))
(defn- received-amount
[{:keys [loading-routes?]}]
(let [amount (rf/sub [:wallet/send-total-amount-formatted])
tx-type (rf/sub [:wallet/wallet-send-tx-type])
{:keys [full-name]} (rf/sub [:wallet/bridge-to-network-details])]
(when (= tx-type :tx/bridge)
[quo/data-item
{:container-style style/amount-data-item
:status (if loading-routes? :loading :default)
:size :small
:title-icon :i/info
:title (i18n/label :t/bridged-to
{:network full-name})
:subtitle amount
:on-press show-bonder-fee-info}])))
(defn view
[{:keys [loading-routes? bridge-tx? bridge-to-network bridge-to-value fees]}]
[{:keys [loading-routes? fees]}]
[rn/view {:style style/estimated-fees-container}
(when (ff/enabled? ::ff/wallet.advanced-sending)
[rn/view {:style style/estimated-fees-content-container}
@ -28,10 +61,4 @@
:size :small
:title (i18n/label :t/max-fees)
:subtitle fees}]
(when bridge-tx?
[quo/data-item
{:container-style style/bridged-to-data-item
:status (if loading-routes? :loading :default)
:size :small
:title (i18n/label :t/bridged-to {:network bridge-to-network})
:subtitle bridge-to-value}])])
[received-amount {:loading-routes? loading-routes?}]])

View File

@ -29,7 +29,7 @@
:height 40
:background-color :transparent})
(def bridged-to-data-item
(def amount-data-item
{:flex 1
:height 40
:background-color :transparent})

View File

@ -281,10 +281,7 @@
not-enough-asset?)
[estimated-fees/view
{:loading-routes? loading-routes?
:fees fee-formatted
:bridge-tx? (= tx-type :tx/bridge)
:bridge-to-network (:full-name bridge-to-network-details)
:bridge-to-value (str bridge-to-value " " token-symbol)}])
:fees fee-formatted}])
(when show-no-routes?
[no-routes-found])
[quo/bottom-actions