Compare commits

...
Author SHA1 Message Date
Ajay Sivan 5ad4fb23ee Temp back button 2024-07-26 14:56:35 +05:30
Ajay Sivan 5ca02206b5 Selected state 2024-07-26 14:56:35 +05:30
Ajay Sivan 542836bc2a Select account title 2024-07-26 14:56:35 +05:30
Ajay Sivan 7885bd4076 Temp 2024-07-26 14:56:34 +05:30
Ajay Sivan d87c724e7c Swap select account drawer 2024-07-26 14:56:34 +05:30
3 changed files with 27 additions and 10 deletions
@@ -76,7 +76,7 @@
[quo/data-item
{:status :default
:size :default
:description :default
:subtitle-type :default
:blur? blur?
:card? true
:title (i18n/label :t/address)
@@ -8,19 +8,25 @@
(defn- render-account-item
[{:keys [color address] :as account} _ _ {:keys [selected-account-address]}]
[quo/account-item
{:type :default
:account-props (assoc account :customization-color color)
:customization-color color
:state (if (= address selected-account-address) :selected :default)
:on-press (fn []
(rf/dispatch [:wallet/switch-current-viewing-account address])
(rf/dispatch [:hide-bottom-sheet]))}])
(let [state (if (= address selected-account-address) :selected :default)]
[quo/account-item
{:type (if (= state :selected) :default :tag)
:token-props {:symbol "SNT"
:value "1,000"}
:account-props (assoc account :customization-color color)
:customization-color color
:state state
:on-press
(fn []
(rf/dispatch [:wallet/switch-current-viewing-account address])
(rf/dispatch [:hide-bottom-sheet]))}]))
(defn view
[]
[{:keys [show-token-balance? token-symbol]}]
(let [selected-account-address (rf/sub [:wallet/current-viewing-account-address])
accounts (rf/sub [:wallet/operable-accounts])]
(tap> show-token-balance?)
(tap> token-symbol)
[:<>
[quo/drawer-top {:title (i18n/label :t/select-account)}]
[gesture/flat-list
@@ -1,6 +1,7 @@
(ns status-im.contexts.wallet.swap.swap-proposal.view
(:require [quo.core :as quo]
[react-native.core :as rn]
[status-im.contexts.wallet.sheets.select-account.view :as select-account]
[status-im.contexts.wallet.sheets.slippage-settings.view :as slippage-settings]
[status-im.contexts.wallet.swap.swap-proposal.style :as style]
[utils.re-frame :as rf]))
@@ -9,6 +10,16 @@
[]
(let [max-slippage (rf/sub [:wallet/swap-max-slippage])]
[rn/view {:style style/container}
[quo/button
{:on-press #(rf/dispatch [:navigate-back])}
"Back"]
[quo/button
{:on-press #(rf/dispatch [:show-bottom-sheet
{:content (fn [] [select-account/view
{:show-token-balance? true
:token-symbol :snt}])}])}
"Switch Account"]
[quo/button
{:on-press #(rf/dispatch [:show-bottom-sheet
{:content slippage-settings/view}])}