Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil committed May 10, 2024
1 parent af2cab1 commit 4e2f6d5
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
(def commands-enabled? (enabled? (get-config :COMMANDS_ENABLED "0")))
(def keycard-test-menu-enabled? (enabled? (get-config :KEYCARD_TEST_MENU "1")))
(def qr-test-menu-enabled? (enabled? (get-config :QR_READ_TEST_MENU "0")))
(def quo-preview-enabled? (enabled? (get-config :ENABLE_QUO_PREVIEW "0")))
(def quo-preview-enabled? (enabled? (get-config :ENABLE_QUO_PREVIEW "1")))
(def database-management-enabled? (enabled? (get-config :DATABASE_MANAGEMENT_ENABLED "0")))
(def debug-webview? (enabled? (get-config :DEBUG_WEBVIEW "0")))
(def collectibles-enabled? (enabled? (get-config :COLLECTIBLES_ENABLED "1")))
Expand Down
5 changes: 0 additions & 5 deletions src/status_im/contexts/wallet/activity_indicator/style.cljs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.contexts.wallet.activity-indicator.view :as activity-indicator]
[status-im.contexts.wallet.add-account.add-address-to-save.style :as style]
[status-im.contexts.wallet.address-input.view :as address-input]
[status-im.contexts.wallet.common.address-input.view :as address-input]
[status-im.contexts.wallet.utils :as wallet.utils]
[status-im.subs.wallet.add-account.address-to-watch]
[utils.ens.core :as utils.ens]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.contexts.wallet.activity-indicator.view :as activity-indicator]
[status-im.contexts.wallet.add-account.add-address-to-watch.style :as style]
[status-im.contexts.wallet.address-input.view :as address-input]
[status-im.contexts.wallet.common.address-input.view :as address-input]
[status-im.contexts.wallet.utils :as wallet.utils]
[status-im.subs.wallet.add-account.address-to-watch]
[utils.ens.core :as utils.ens]
Expand Down
32 changes: 32 additions & 0 deletions src/status_im/contexts/wallet/add_account/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,35 @@
:on-error #(log/info "failed to get address details"
{:error %
:event :wallet/get-address-details})}]])]})))

(defn add-address-to-watch
[{:keys [db]} [{:keys [screen] :as props}]]
{:fx [[:dispatch [:navigate-to screen props]]]
:db (assoc-in db [:wallet :ui :currently-added-address] props)})

(rf/reg-event-fx :wallet/add-address-to-watch add-address-to-watch)

(defn add-address-to-save
[{:keys [db]} [{:keys [screen] :as props}]]
{:fx [[:dispatch [:open-modal screen props]]]
:db (assoc-in db [:wallet :ui :currently-added-address] props)})

(rf/reg-event-fx :wallet/add-address-to-save add-address-to-save)

(defn confirm-add-address-to-save
[{:keys [db]} [{:keys [ens? address]}]]
(let [confirm-screen (get-in db [:wallet :ui :currently-added-address :confirm-screen])]
{:fx [[:dispatch
[:open-modal confirm-screen]]]
:db (update-in db [:wallet :ui :currently-added-address] assoc :ens ens? :address address)}))

(rf/reg-event-fx :wallet/confirm-add-address-to-save confirm-add-address-to-save)

(defn confirm-add-address-to-watch
[{:keys [db]} [{:keys [ens? address]}]]
(let [confirm-screen (get-in db [:wallet :ui :currently-added-address :confirm-screen])]
{:fx [[:dispatch [:navigate-to confirm-screen]]]
:db (update-in db [:wallet :ui :currently-added-address] assoc :ens ens? :address address)}))

(rf/reg-event-fx :wallet/confirm-add-address-to-watch confirm-add-address-to-watch)

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(ns status-im.contexts.wallet.common.activity-indicator.style)

(def info-message
{:margin-top 8
:margin-left 20})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.activity-indicator.view
(ns status-im.contexts.wallet.common.activity-indicator.view
(:require [quo.core :as quo]
[status-im.contexts.wallet.activity-indicator.style :as style]
[utils.i18n :as i18n]))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.address-input.style)
(ns status-im.contexts.wallet.common.address-input.style)

(def input
{:flex 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.address-input.view
(ns status-im.contexts.wallet.common.address-input.view
(:require [clojure.string :as string]
[quo.core :as quo]
[react-native.clipboard :as clipboard]
Expand Down
31 changes: 0 additions & 31 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -510,34 +510,3 @@
activities (cske/transform-keys transforms/->kebab-case-keyword activities)
sorted-activities (sort :timestamp activities)]
{:db (assoc-in db [:wallet :activities] sorted-activities)})))

(defn add-address-to-watch
[{:keys [db]} [{:keys [screen] :as props}]]
{:fx [[:dispatch [:navigate-to screen props]]]
:db (assoc-in db [:wallet :ui :currently-added-address] props)})

(rf/reg-event-fx :wallet/add-address-to-watch add-address-to-watch)

(defn add-address-to-save
[{:keys [db]} [{:keys [screen] :as props}]]
{:fx [[:dispatch [:open-modal screen props]]]
:db (assoc-in db [:wallet :ui :currently-added-address] props)})

(rf/reg-event-fx :wallet/add-address-to-save add-address-to-save)

(defn confirm-add-address-to-save
[{:keys [db]} [{:keys [ens? address]}]]
(let [confirm-screen (get-in db [:wallet :ui :currently-added-address :confirm-screen])]
{:fx [[:dispatch
[:open-modal confirm-screen]]]
:db (update-in db [:wallet :ui :currently-added-address] assoc :ens ens? :address address)}))

(rf/reg-event-fx :wallet/confirm-add-address-to-save confirm-add-address-to-save)

(defn confirm-add-address-to-watch
[{:keys [db]} [{:keys [ens? address]}]]
(let [confirm-screen (get-in db [:wallet :ui :currently-added-address :confirm-screen])]
{:fx [[:dispatch [:navigate-to confirm-screen]]]
:db (update-in db [:wallet :ui :currently-added-address] assoc :ens ens? :address address)}))

(rf/reg-event-fx :wallet/confirm-add-address-to-watch confirm-add-address-to-watch)
4 changes: 2 additions & 2 deletions src/status_im/navigation/screens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@
:component wallet-confirm-address-to-watch/view}

{:name :screen/wallet.confirm-address-to-save
:options options/dark-screen
:options (assoc options/dark-screen :sheet? true)
:component wallet-confirm-address-to-save/view}

{:name :screen/wallet.bridge-select-asset
Expand Down Expand Up @@ -560,7 +560,7 @@
(when config/quo-preview-enabled?
status-im-preview/main-screens)

(when config/quo-preview-enabled?
(when true
[{:name :feature-flags
:options {:insets {:top? true}}
:component feature-flags/view}])))

0 comments on commit 4e2f6d5

Please sign in to comment.