-
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; (#17781)
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 Move ns to proper fileˆ Fix styles
- Loading branch information
1 parent
1224301
commit 7a7fe52
Showing
11 changed files
with
137 additions
and
33 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
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}) |
60 changes: 60 additions & 0 deletions
60
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,60 @@ | ||
(ns status-im2.contexts.wallet.add-watch-only-account.views | ||
(:require | ||
[clojure.string :as string] | ||
[quo.core :as quo] | ||
[quo.theme :as quo.theme] | ||
[re-frame.core :as re-frame] | ||
[react-native.core :as rn] | ||
[reagent.core :as reagent] | ||
[status-im2.contexts.emoji-picker.utils :as emoji-picker.utils] | ||
[status-im2.contexts.wallet.add-watch-only-account.style :as style] | ||
[status-im2.contexts.wallet.common.screen-base.create-or-edit-account.view :as | ||
create-or-edit-account] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn- view-internal | ||
[] | ||
(let [{:keys [address]} (rf/sub [:get-screen-params]) | ||
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 :blue) | ||
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 was deleted.
Oops, something went wrong.
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
18 changes: 18 additions & 0 deletions
18
src/status_im2/contexts/wallet/select_address_to_watch/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,18 @@ | ||
(ns status-im2.contexts.wallet.select-address-to-watch.style) | ||
|
||
(def header-container | ||
{:margin-horizontal 20 | ||
:margin-top 12 | ||
:margin-bottom 20}) | ||
|
||
(def input-container | ||
{:flex-direction :row | ||
:padding-horizontal 20 | ||
:align-items :flex-end}) | ||
|
||
(defn button-container | ||
[bottom] | ||
{:position :absolute | ||
:bottom (- bottom 22) | ||
:left 20 | ||
:right 20}) |
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