-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(wallet): add recent recipients tab #19942
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,6 @@ | |
:default-active @selected-tab | ||
:data (tabs-data watch-only?) | ||
:on-change (rn/use-callback (fn [tab] | ||
(when (and (= :activity tab) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved to account page transition |
||
(ff/enabled? :FLAG_WALLET_ACTIVITY_ENABLED)) | ||
(rf/dispatch [:wallet/fetch-activities])) | ||
(reset! selected-tab tab))) | ||
:scrollable? true | ||
:scroll-on-press? true}] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
[status-im.common.resources :as status.resources] | ||
[utils.i18n :as i18n])) | ||
|
||
(def address "0x39cf6E0Ba4C4530735616e1Ee7ff5FbCB726fBd4") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unused |
||
|
||
(def buy-tokens-list | ||
[{:title "Ramp" | ||
:description :text | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,8 @@ | |
(rf/reg-event-fx :wallet/navigate-to-account | ||
(fn [{:keys [db]} [address]] | ||
{:db (assoc-in db [:wallet :current-viewing-account-address] address) | ||
:fx [[:dispatch [:navigate-to :screen/wallet.accounts address]]]})) | ||
:fx [[:dispatch [:navigate-to :screen/wallet.accounts address]] | ||
[:dispatch [:wallet/fetch-activities]]]})) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fetch activities here |
||
|
||
(rf/reg-event-fx :wallet/navigate-to-new-account | ||
(fn [{:keys [db]} [address]] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn my-accounts | ||
(defn- my-accounts | ||
[theme] | ||
(let [other-accounts (rf/sub [:wallet/accounts-without-current-viewing-account])] | ||
(if (zero? (count other-accounts)) | ||
|
@@ -27,15 +27,30 @@ | |
:stack-id :screen/wallet.select-address}])}])) | ||
other-accounts)))) | ||
|
||
(defn- recent-transactions | ||
[theme] | ||
(let [recent-recipients (rf/sub [:wallet/recent-recipients])] | ||
(if (zero? (count recent-recipients)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the suggestion, will update this. |
||
[quo/empty-state | ||
{:title (i18n/label :t/no-recent-transactions) | ||
:description (i18n/label :t/make-one-it-is-easy-we-promise) | ||
:image (resources/get-themed-image :angry-man theme) | ||
:container-style style/empty-container-style}] | ||
(into [rn/view {:style style/my-accounts-container}] | ||
(map (fn [address] | ||
[quo/address | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eventually this will use accounts and saved address etc too 👍 |
||
{:address address | ||
:on-press #(rf/dispatch [:wallet/select-send-address | ||
{:address address | ||
:recipient address | ||
:stack-id :screen/wallet.select-address}])}])) | ||
recent-recipients)))) | ||
|
||
(defn view | ||
[{:keys [selected-tab]}] | ||
(let [theme (quo.theme/use-theme)] | ||
(case selected-tab | ||
:tab/recent [quo/empty-state | ||
{:title (i18n/label :t/no-recent-transactions) | ||
:description (i18n/label :t/make-one-it-is-easy-we-promise) | ||
:image (resources/get-themed-image :angry-man theme) | ||
:container-style style/empty-container-style}] | ||
:tab/recent [recent-transactions theme] | ||
:tab/saved [quo/empty-state | ||
{:title (i18n/label :t/no-saved-addresses) | ||
:description (i18n/label :t/you-like-to-type-43-characters) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused