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.common.not-implemented :as not-implemented]
[status-im.contexts.wallet.send.input-amount.style :as style] [status-im.contexts.wallet.send.input-amount.style :as style]
[status-im.feature-flags :as ff] [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 (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} [rn/view {:style style/estimated-fees-container}
(when (ff/enabled? ::ff/wallet.advanced-sending) (when (ff/enabled? ::ff/wallet.advanced-sending)
[rn/view {:style style/estimated-fees-content-container} [rn/view {:style style/estimated-fees-content-container}
@ -28,10 +61,4 @@
:size :small :size :small
:title (i18n/label :t/max-fees) :title (i18n/label :t/max-fees)
:subtitle fees}] :subtitle fees}]
(when bridge-tx? [received-amount {:loading-routes? loading-routes?}]])
[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}])])

View File

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

View File

@ -280,11 +280,8 @@
(when (or (and (not no-routes-found?) (or loading-routes? route)) (when (or (and (not no-routes-found?) (or loading-routes? route))
not-enough-asset?) not-enough-asset?)
[estimated-fees/view [estimated-fees/view
{:loading-routes? loading-routes? {:loading-routes? loading-routes?
:fees fee-formatted :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)}])
(when show-no-routes? (when show-no-routes?
[no-routes-found]) [no-routes-found])
[quo/bottom-actions [quo/bottom-actions