-
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
- Loading branch information
1 parent
6c2b437
commit f69c5aa
Showing
11 changed files
with
119 additions
and
22 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
17 changes: 17 additions & 0 deletions
17
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,17 @@ | ||
(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}) |
62 changes: 62 additions & 0 deletions
62
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,62 @@ | ||
(ns status-im2.contexts.wallet.add-watch-only-account.views | ||
(:require | ||
[reagent.core :as reagent] | ||
[react-native.safe-area :as safe-area] | ||
[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 %) | ||
safe-bottom (safe-area/get-bottom)] | ||
(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} | ||
[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")}]] | ||
[quo/button | ||
{:customization-color @account-color | ||
:disabled? (clojure.string/blank? @account-name) | ||
:on-press #(re-frame/dispatch [:navigate-to | ||
:wallet-account]) | ||
:container-style (style/button-container safe-bottom)} (i18n/label :t/create-account)]]))) | ||
|
||
(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
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