File tree 10 files changed +90
-19
lines changed
10 files changed +90
-19
lines changed Original file line number Diff line number Diff line change 624
624
(fn [accounts]
625
625
(ethereum/get-default-account accounts)))
626
626
627
+ (re-frame/reg-sub
628
+ :multiaccount/visible-accounts
629
+ :<- [:multiaccount/accounts ]
630
+ (fn [accounts]
631
+ (remove :hidden accounts)))
632
+
627
633
(re-frame/reg-sub
628
634
:sign-in-enabled?
629
635
:<- [:multiaccounts/login ]
710
716
(fn [accounts]
711
717
(filter #(not= (:type %) :watch ) accounts)))
712
718
719
+ (re-frame/reg-sub
720
+ :visible-accounts-without-watch-only
721
+ :<- [:multiaccount/accounts ]
722
+ (fn [accounts]
723
+ (remove :hidden (filter #(not= (:type %) :watch ) accounts))))
724
+
713
725
(defn filter-recipient-accounts
714
726
[search-filter {:keys [name]}]
715
727
(string/includes? (string/lower-case (str name)) search-filter))
716
728
717
729
(re-frame/reg-sub
718
730
:accounts-for-recipient
719
- :<- [:multiaccount/accounts ]
731
+ :<- [:multiaccount/visible- accounts ]
720
732
:<- [:wallet/prepare-transaction ]
721
733
:<- [:search/recipient-filter ]
722
734
(fn [[accounts {:keys [from]} search-filter]]
1551
1563
(re-frame/reg-sub
1552
1564
:balances
1553
1565
:<- [:wallet ]
1554
- (fn [wallet]
1555
- (map :balance (vals (:accounts wallet)))))
1566
+ :<- [:multiaccount/visible-accounts ]
1567
+ (fn [[wallet accounts]]
1568
+ (let [accounts (map :address accounts)]
1569
+ (map :balance (vals (select-keys (:accounts wallet) accounts))))))
1556
1570
1557
1571
(re-frame/reg-sub
1558
1572
:empty-balances?
Original file line number Diff line number Diff line change 65
65
(str desc)]]))
66
66
67
67
(views/defview navigation [{:keys [url can-go-back? can-go-forward? dapps-account empty-tab browser-id name]}]
68
- (views/letsubs [accounts [:accounts-without-watch-only ]]
68
+ (views/letsubs [accounts [:visible- accounts-without-watch-only ]]
69
69
[react/view (styles/navbar )
70
70
[react/touchable-highlight {:on-press #(if can-go-back?
71
71
(re-frame/dispatch [:browser.ui/previous-page-button-pressed ])
Original file line number Diff line number Diff line change 108
108
[status-im.ui.components.icons.icons :as icons]
109
109
[status-im.ui.screens.chat.pinned-messages :as pin-messages]
110
110
[status-im.ui.screens.communities.create-category :as create-category]
111
- [status-im.ui.screens.communities.select-category :as select-category]))
111
+ [status-im.ui.screens.communities.select-category :as select-category]
112
+ [status-im.ui.screens.wallet.accounts-manage.views :as accounts-manage]))
112
113
113
114
(def components
114
115
[{:name :chat-toolbar
376
377
:options {:topBar {:title {:text (i18n/label :t/main-currency )}}}
377
378
:component currency-settings/currency-settings}
378
379
380
+ {:name :manage-accounts
381
+ :options {:topBar {:title {:text (i18n/label :t/wallet-manage-accounts )}}}
382
+ :component accounts-manage/manage}
383
+
379
384
; ;MY STATUS
380
385
381
386
{:name :status
Original file line number Diff line number Diff line change 10
10
11
11
(defn accounts-options [mnemonic]
12
12
(fn []
13
- [react/view
13
+ [:<>
14
+ [quo/list-item
15
+ {:theme :accent
16
+ :title (i18n/label :t/wallet-manage-accounts )
17
+ :icon :main-icons/account
18
+ :accessibility-label :wallet-manage-accounts
19
+ :on-press #(hide-sheet-and-dispatch
20
+ [:navigate-to :manage-accounts ])}]
14
21
[quo/list-item
15
22
{:theme :accent
16
23
:title (i18n/label :t/wallet-manage-assets )
47
54
:on-press #(hide-sheet-and-dispatch
48
55
[:navigate-to :backup-seed ])}])]))
49
56
50
- (defn account-card-actions [account type]
57
+ (defn account-card-actions [account type wallet ]
51
58
[react/view
52
59
(when-not (= type :watch )
53
60
[quo/list-item
63
70
:icon :main-icons/share
64
71
:accessibility-label :share-account-button
65
72
:on-press #(hide-sheet-and-dispatch
66
- [:wallet/share-popover (:address account)])}]])
73
+ [:wallet/share-popover (:address account)])}]
74
+ (when-not wallet
75
+ [quo/list-item
76
+ {:theme :accent
77
+ :title (i18n/label :t/hide )
78
+ :icon :main-icons/hide
79
+ :accessibility-label :hide-account-button
80
+ :on-press #(hide-sheet-and-dispatch
81
+ [:wallet.accounts/save-account account {:hidden true }])}])])
67
82
68
83
(defn add-account []
69
84
(let [keycard? @(re-frame/subscribe [:keycard-multiaccount? ])]
Original file line number Diff line number Diff line change 17
17
[status-im.keycard.login :as keycard.login])
18
18
(:require-macros [status-im.utils.views :as views]))
19
19
20
- (views/defview account-card [{:keys [name color address type] :as account} keycard? card-width]
20
+ (views/defview account-card [{:keys [name color address type wallet ] :as account} keycard? card-width]
21
21
(views/letsubs [currency [:wallet/currency ]
22
22
portfolio-value [:account-portfolio-value address]
23
23
prices-loading? [:prices-loading? ]]
48
48
[react/touchable-highlight
49
49
{:style styles/card-icon-more
50
50
:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet
51
- {:content (fn [] [sheets/account-card-actions account type])
51
+ {:content (fn [] [sheets/account-card-actions account type wallet ])
52
52
:content-height 130 }])}
53
53
[icons/icon :main-icons/more {:color colors/white-persist}]]]]]))
54
54
107
107
[dot {:selected (= selected i)}])])
108
108
109
109
(views/defview accounts []
110
- (views/letsubs [accounts [:multiaccount/accounts ]
110
+ (views/letsubs [accounts [:multiaccount/visible- accounts ]
111
111
keycard? [:keycard-multiaccount? ]
112
112
window-width [:dimensions/window-width ]
113
113
index (reagent/atom 0 )]
Original file line number Diff line number Diff line change
1
+ (ns status-im.ui.screens.wallet.accounts-manage.views
2
+ (:require [status-im.utils.handlers :refer [>evt <sub]]
3
+ [status-im.ui.components.list.views :as list]
4
+ [reagent.core :as reagent]
5
+ [quo.core :as quo]
6
+ [status-im.utils.utils :as utils]
7
+ [status-im.ui.components.icons.icons :as icons]
8
+ [status-im.ui.components.colors :as colors]))
9
+
10
+ (defn render-account [_]
11
+ (reagent/create-class
12
+ {:should-component-update
13
+ (fn [_ [_ old-item] [_ new-item]]
14
+ (not= (:hidden old-item) (:hidden new-item)))
15
+ :reagent-render
16
+ (fn [{:keys [hidden name address wallet] :as account}]
17
+ [quo/list-item
18
+ {:accessory [icons/icon
19
+ (if hidden :main-icos/hide :main-icos/show )
20
+ (merge {:accessibility-label (if hidden :hide-icon :show-icon )}
21
+ (when wallet {:color colors/gray}))]
22
+ :animated-accessory? false
23
+ :animated false
24
+ :disabled wallet
25
+ :title name
26
+ :subtitle (utils/get-shortened-checksum-address address)
27
+ :on-press #(>evt [:wallet.accounts/save-account account {:hidden (not hidden)}])}])}))
28
+
29
+ (defn manage []
30
+ (let [accounts (<sub [:multiaccount/accounts ])]
31
+ [list/flat-list
32
+ {:key-fn :address
33
+ :data accounts
34
+ :render-fn render-account}]))
Original file line number Diff line number Diff line change 24
24
:on-press #(re-frame/dispatch [event field account])}])
25
25
26
26
(views/defview accounts-list [field event]
27
- (views/letsubs [accounts [:multiaccount/accounts ]
28
- accounts-whithout-watch [:accounts-without-watch-only ]]
27
+ (views/letsubs [accounts [:multiaccount/visible- accounts ]
28
+ accounts-whithout-watch [:visible- accounts-without-watch-only ]]
29
29
[list/flat-list {:data (if (= :to field) accounts accounts-whithout-watch)
30
30
:key-fn :address
31
31
:render-data {:field field
Original file line number Diff line number Diff line change 275
275
276
276
(fx/defn save-account
277
277
{:events [:wallet.accounts/save-account ]}
278
- [{:keys [db]} account {:keys [name color]}]
278
+ [{:keys [db]} account {:keys [name color hidden ]}]
279
279
(let [accounts (:multiaccount/accounts db)
280
280
new-account (cond-> account
281
281
name (assoc :name name)
282
- color (assoc :color color))
282
+ color (assoc :color color)
283
+ (not (nil? hidden)) (assoc :hidden hidden))
283
284
new-accounts (replace {account new-account} accounts)]
284
285
{::json-rpc/call [{:method " accounts_saveAccounts"
285
286
:params [[new-account]]
Original file line number Diff line number Diff line change 2
2
"_comment" : " DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead" ,
3
3
"owner" : " status-im" ,
4
4
"repo" : " status-go" ,
5
- "version" : " v0.83.9 " ,
6
- "commit-sha1" : " 7dfeda15110af8ae315f41d19db39476a8e28d62 " ,
7
- "src-sha256" : " 12v2k8679kl8gca6ihpn954rblpfdsi95kcaxpm39dahlg5ax2v9 "
5
+ "version" : " v0.83.11 " ,
6
+ "commit-sha1" : " fc16588cf1b37a6aea473404495782ca9e0cfff8 " ,
7
+ "src-sha256" : " 0gh0v1v3hcxq99i0szwp8y5395xfcdj920wg2p707s8j3vwrb325 "
8
8
}
Original file line number Diff line number Diff line change 1298
1298
"wallet-invalid-address-checksum" : " Error in address: \n {{data}}" ,
1299
1299
"wallet-invalid-chain-id" : " Network does not match: \n {{data}} but current chain is {{chain}}" ,
1300
1300
"wallet-manage-assets" : " Manage assets" ,
1301
+ "wallet-manage-accounts" : " Manage accounts" ,
1301
1302
"wallet-request" : " Request" ,
1302
1303
"wallet-send" : " Send" ,
1303
1304
"wallet-send-min-units" : " Min 21000 units" ,
1645
1646
"suggested-price-limit" : " Suggested price limit" ,
1646
1647
"include" : " Include" ,
1647
1648
"category" : " Category" ,
1648
- "edit-chats" : " Edit chats"
1649
+ "edit-chats" : " Edit chats" ,
1650
+ "hide" : " Hide"
1649
1651
}
You can’t perform that action at this time.
0 commit comments