-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a button to address watch screen;
Add account creation screen remove icons remove extra utility and create a new one that would use conventional way of getting an emoji fix lint Use button component instead of bottom-actions Provide global customization color to buttons Use conventional approach to extract account name Move to another address Move to another namespace Refactor bottom-actions to have button props in maps Update doc with new icon location Add spaces between styles Work on pr comments Use :on-change-text instead of :on-change for input component Subscribe to :profile/customization-color directly Use bottom button from the create-or-edit-account wrapper Remove extra code Sort requires
- Loading branch information
1 parent
0eef520
commit 5435a30
Showing
10 changed files
with
120 additions
and
21 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
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
20 changes: 20 additions & 0 deletions
20
src/status_im2/contexts/wallet/add_watch_only_account/style.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,20 @@ | ||
(ns status-im2.contexts.wallet.add-watch-only-account.style) | ||
|
||
(def container | ||
{:flex 1}) | ||
|
||
(def input | ||
{:margin-right 12 | ||
:flex 1}) | ||
|
||
(def data-item | ||
{:margin-horizontal 20 | ||
:padding-vertical 8 | ||
:padding-horizontal 12}) | ||
|
||
(defn button-container | ||
[bottom] | ||
{:position :absolute | ||
:bottom (+ bottom 12) | ||
:left 20 | ||
:right 20}) |
61 changes: 61 additions & 0 deletions
61
src/status_im2/contexts/wallet/add_watch_only_account/views.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,61 @@ | ||
(ns status-im2.contexts.wallet.add-watch-only-account.views | ||
(:require | ||
[reagent.core :as reagent] | ||
[clojure.string :as string] | ||
[utils.i18n :as i18n] | ||
[re-frame.core :as re-frame] | ||
[react-native.core :as rn] | ||
[quo.core :as quo] | ||
[quo.theme :as quo.theme] | ||
[status-im2.contexts.wallet.common.screen-base.create-or-edit-account.view :as | ||
create-or-edit-account] | ||
[utils.re-frame :as rf] | ||
[status-im2.contexts.emoji-picker.utils :as emoji-picker.utils] | ||
[status-im2.contexts.wallet.add-watch-only-account.style :as style])) | ||
|
||
(defn- view-internal | ||
[] | ||
(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 %)] | ||
(fn [] | ||
[rn/view {:style style/container} | ||
[create-or-edit-account/view | ||
{:page-nav-right-side [{:icon-name :i/info | ||
:on-press | ||
#(js/alert | ||
"Get info (to be | ||
implemented)")}] | ||
:account-name @account-name | ||
:account-emoji @account-emoji | ||
:account-color @account-color | ||
:on-change-name on-change-name | ||
:on-change-color on-change-color | ||
:on-change-emoji on-change-emoji | ||
:bottom-action? true | ||
:bottom-action-label :t/create-account | ||
:bottom-action-props {:customization-color @account-color | ||
:disabled? (string/blank? @account-name) | ||
:on-press #(re-frame/dispatch [:navigate-to | ||
:wallet-account])}} | ||
[quo/data-item | ||
{:card? true | ||
:right-icon :i/advanced | ||
:icon-right? true | ||
:emoji @account-emoji | ||
:title address-title | ||
:subtitle address | ||
:status :default | ||
:size :default | ||
:container-style style/data-item | ||
:on-press #(js/alert "To be implemented")}]]]))) | ||
|
||
(def address-add-edit (quo.theme/with-theme view-internal)) |
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
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