Skip to content

Commit

Permalink
Use conventional approach to extract account name
Browse files Browse the repository at this point in the history
  • Loading branch information
tumanov-alex committed Oct 31, 2023
1 parent f0695f4 commit 9728eb3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
7 changes: 4 additions & 3 deletions src/quo/components/drawers/bottom_actions/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
[quo.foundations.colors :as colors]))

(def buttons-container
{:flex-direction :row
:justify-content :space-around
:padding-vertical 12})
{:flex-direction :row
:justify-content :space-around
:padding-vertical 12
:padding-horizontal 20})

(def button-container
{:flex 1})
Expand Down
22 changes: 12 additions & 10 deletions src/status_im/ui/screens/wallet/address_add_edit/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@

(defn- view-internal
[]
(let [{:keys [accounts-count address]} (rf/sub [:get-screen-params])
{:keys [customization-color]} (rf/sub [:profile/multiaccount])
account-name (reagent/atom (str "Account " accounts-count))
address-title (i18n/label :t/watch-address)
account-color (reagent/atom customization-color)
account-emoji (reagent/atom (emoji-picker.utils/random-emoji))
on-change-name #(reset! account-name %)
on-change-color #(reset! account-color %)
on-change-emoji #(reset! account-emoji %)
safe-bottom (safe-area/get-bottom)]
(let [{:keys [address]} (rf/sub [:get-screen-params])
{:keys [customization-color]} (rf/sub [:profile/multiaccount])
number-of-accounts (count (rf/sub [:profile/wallet-accounts]))
account-name (reagent/atom (i18n/label :t/default-account-name
{:number (inc number-of-accounts)}))
address-title (i18n/label :t/watch-address)
account-color (reagent/atom customization-color)
account-emoji (reagent/atom (emoji-picker.utils/random-emoji))
on-change-name #(reset! account-name %)
on-change-color #(reset! account-color %)
on-change-emoji #(reset! account-emoji %)
safe-bottom (safe-area/get-bottom)]
(fn []
[rn/view {:style style/container}
[create-or-edit-account/view
Expand Down
4 changes: 1 addition & 3 deletions src/status_im2/contexts/wallet/address_watch/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
(let [top (safe-area/get-top)
bottom (safe-area/get-bottom)
input-value (reagent/atom "")
{:keys [accounts-count]} (rf/sub [:get-screen-params])
{:keys [customization-color]} (rf/sub [:profile/multiaccount])]
(fn []
[rn/view
Expand Down Expand Up @@ -50,8 +49,7 @@
:disabled? (clojure.string/blank? @input-value)
:on-press #(re-frame/dispatch [:navigate-to
:address-to-watch-edit
{:accounts-count accounts-count
:address @input-value}])
{:address @input-value}])
:container-style (style/button-container bottom)} (i18n/label :t/continue)]])))

(def view (quo.theme/with-theme view-internal))
6 changes: 1 addition & 5 deletions src/status_im2/contexts/wallet/home/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(declare account-cards)

(defn new-account
[]
[quo/action-drawer
Expand All @@ -27,9 +25,7 @@
:accessibility-label :add-a-contact
:label (i18n/label :t/add-address)
:sub-label (i18n/label :t/add-address-description)
:on-press #(rf/dispatch [:navigate-to :wallet-address-watch
{:accounts-count (count
account-cards)}])
:on-press #(rf/dispatch [:navigate-to :wallet-address-watch])
:add-divider? true}]]])

(def account-cards
Expand Down

0 comments on commit 9728eb3

Please sign in to comment.