-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Wallet - Account Switcher for send flow (#18100)
This commit: - adds another variant ("Select account" bottom sheet) of the account switcher for wallet - send flow - adds watch-only? key in the account to prevent repetitive account type checks across the codebase Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
- Loading branch information
1 parent
879a82c
commit b668e4d
Showing
14 changed files
with
342 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/status_im2/contexts/wallet/common/sheets/select_account/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(ns status-im2.contexts.wallet.common.sheets.select-account.style) | ||
|
||
(def list-container | ||
{:margin-horizontal 8}) |
33 changes: 33 additions & 0 deletions
33
src/status_im2/contexts/wallet/common/sheets/select_account/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(ns status-im2.contexts.wallet.common.sheets.select-account.view | ||
(:require [quo.core :as quo] | ||
quo.theme | ||
[react-native.gesture :as gesture] | ||
[status-im2.contexts.wallet.common.sheets.select-account.style :as style] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(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]))}]) | ||
|
||
(defn- view-internal | ||
[] | ||
(let [selected-account-address (rf/sub [:wallet/current-viewing-account-address]) | ||
accounts (rf/sub [:wallet/accounts-without-watched-accounts])] | ||
[:<> | ||
[quo/drawer-top {:title (i18n/label :t/select-account)}] | ||
[gesture/flat-list | ||
{:data accounts | ||
:render-fn render-account-item | ||
:render-data {:selected-account-address selected-account-address} | ||
:content-container-style style/list-container | ||
:shows-vertical-scroll-indicator false}]])) | ||
|
||
(def view (quo.theme/with-theme view-internal)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.