-
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.
chore(wallet): add common page-nav component for account switcher (#1…
- Loading branch information
Showing
4 changed files
with
32 additions
and
38 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
22 changes: 22 additions & 0 deletions
22
src/status_im2/contexts/wallet/common/account_switcher/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,22 @@ | ||
(ns status-im2.contexts.wallet.common.account-switcher.view | ||
(:require [quo.core :as quo] | ||
[status-im2.contexts.wallet.common.sheets.account-options.view :as account-options] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn view | ||
[{:keys [on-press accessibility-label] :or {accessibility-label :top-bar}}] | ||
(let [{:keys [color emoji]} (rf/sub [:wallet/current-viewing-account]) | ||
networks (rf/sub [:wallet/network-details])] | ||
[quo/page-nav | ||
{:icon-name :i/close | ||
:on-press on-press | ||
:accessibility-label accessibility-label | ||
:networks networks | ||
:networks-on-press #(js/alert "Pressed Networks") | ||
:right-side :account-switcher | ||
:account-switcher {:customization-color color | ||
:on-press #(rf/dispatch [:show-bottom-sheet | ||
{:content account-options/view | ||
:gradient-cover? true | ||
:customization-color color}]) | ||
:emoji emoji}}])) |
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