Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
097fbbdf02 | ||
|
|
cf4457a68e | ||
|
|
6fefd981a7 | ||
|
|
f75b645a1c | ||
|
|
c1a1b9136b | ||
|
|
7a8f6b2f27 | ||
|
|
8bf6c1b7b4 |
@@ -54,8 +54,8 @@
|
||||
(defn view
|
||||
[{:keys [header footer customization-color footer-container-padding header-container-style
|
||||
gradient-cover?]
|
||||
:or {footer-container-padding (safe-area/get-top)}} &
|
||||
children]
|
||||
:or {footer-container-padding (safe-area/get-top)}}
|
||||
& children]
|
||||
(reagent/with-let [window-height (:height (rn/get-window))
|
||||
footer-container-height (reagent/atom 0)
|
||||
header-height (reagent/atom 0)
|
||||
@@ -84,16 +84,21 @@
|
||||
:header-height @header-height
|
||||
:keyboard-shown? keyboard-shown?})]
|
||||
[:<>
|
||||
(when gradient-cover? [quo/gradient-cover {:customization-color customization-color}])
|
||||
(when gradient-cover?
|
||||
[quo/gradient-cover {:customization-color customization-color}])
|
||||
[rn/view {:style style/page-container}
|
||||
[rn/view
|
||||
{:on-layout set-header-height
|
||||
:style header-container-style}
|
||||
header]
|
||||
[rn/scroll-view
|
||||
{:on-scroll set-content-y-scroll
|
||||
:scroll-event-throttle 64
|
||||
:content-container-style {:flex-grow 1}}
|
||||
{:on-scroll set-content-y-scroll
|
||||
:scroll-event-throttle 64
|
||||
:content-container-style {:flex-grow 1
|
||||
:padding-bottom (when @keyboard-did-show?
|
||||
@footer-container-height)}
|
||||
:always-bounce-vertical false
|
||||
:shows-vertical-scroll-indicator false}
|
||||
(into [rn/view {:on-layout set-content-container-height}]
|
||||
children)]
|
||||
[rn/keyboard-avoiding-view
|
||||
|
||||
@@ -14,24 +14,19 @@
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [{:keys [address]} (rf/sub [:get-screen-params])
|
||||
number-of-accounts (count (rf/sub [:wallet/watch-only-accounts]))
|
||||
account-name (reagent/atom "")
|
||||
placeholder (i18n/label :t/default-watched-address-placeholder
|
||||
{:number (inc number-of-accounts)})
|
||||
account-color (reagent/atom (rand-nth colors/account-colors))
|
||||
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 %)]
|
||||
(let [{:keys [address]} (rf/sub [:get-screen-params])
|
||||
placeholder (i18n/label :t/default-watched-address-placeholder)
|
||||
account-name (reagent/atom "")
|
||||
account-color (reagent/atom (rand-nth colors/account-colors))
|
||||
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)")}]
|
||||
:on-press #(js/alert "Get info (to be implemented)")}]
|
||||
:placeholder placeholder
|
||||
:account-name @account-name
|
||||
:account-emoji @account-emoji
|
||||
|
||||
@@ -29,9 +29,4 @@
|
||||
{:margin-top 12
|
||||
:margin-bottom 8})
|
||||
|
||||
(defn slide-button-container
|
||||
[bottom]
|
||||
{:position :absolute
|
||||
:bottom (+ bottom 12)
|
||||
:left 20
|
||||
:right 20})
|
||||
(def slide-button-container {:z-index 1})
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
[react-native.safe-area :as safe-area]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
|
||||
[status-im.common.floating-button-page.view :as floating-button-page]
|
||||
[status-im.common.standard-authentication.core :as standard-auth]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.contexts.wallet.common.utils :as utils]
|
||||
@@ -20,7 +21,6 @@
|
||||
[utils.security.core :as security]
|
||||
[utils.string]))
|
||||
|
||||
|
||||
(defn- get-keypair-data
|
||||
[primary-name derivation-path account-color {:keys [keypair-name]}]
|
||||
[{:title (or keypair-name (i18n/label :t/keypair-title {:name primary-name}))
|
||||
@@ -51,36 +51,67 @@
|
||||
(defn- f-view
|
||||
[]
|
||||
(let [top (safe-area/get-top)
|
||||
bottom (safe-area/get-bottom)
|
||||
account-color (reagent/atom (rand-nth colors/account-colors))
|
||||
emoji (reagent/atom (emoji-picker.utils/random-emoji))
|
||||
number-of-accounts (count (rf/sub [:wallet/accounts-without-watched-accounts]))
|
||||
placeholder (i18n/label :t/default-account-placeholder)
|
||||
account-name (reagent/atom "")
|
||||
placeholder (i18n/label :t/default-account-placeholder
|
||||
{:number (inc number-of-accounts)})
|
||||
derivation-path (reagent/atom (utils/get-derivation-path number-of-accounts))
|
||||
{:keys [public-key address]} (rf/sub [:profile/profile])
|
||||
on-change-text #(reset! account-name %)
|
||||
primary-name (first (rf/sub [:contacts/contact-two-names-by-identity
|
||||
public-key]))
|
||||
show-account-origin #(rf/dispatch
|
||||
[:show-bottom-sheet {:content account-origin/view}])
|
||||
{window-width :width} (rn/get-window)]
|
||||
(fn [{:keys [theme]}]
|
||||
(let [{:keys [new-keypair]} (rf/sub [:wallet/create-account])]
|
||||
(let [{:keys [new-keypair]} (rf/sub [:wallet/create-account])
|
||||
;;
|
||||
add-keypair (fn [password]
|
||||
(rf/dispatch
|
||||
[:wallet/add-keypair-and-create-account
|
||||
{:sha3-pwd (security/safe-unmask-data password)
|
||||
:new-keypair (create-account.utils/prepare-new-keypair
|
||||
{:new-keypair new-keypair
|
||||
:address address
|
||||
:account-name @account-name
|
||||
:account-color @account-color
|
||||
:emoji @emoji
|
||||
:derivation-path @derivation-path})}]))
|
||||
derive-address (fn [password]
|
||||
(rf/dispatch
|
||||
[:wallet/derive-address-and-add-account
|
||||
{:sha3-pwd (security/safe-unmask-data password)
|
||||
:emoji @emoji
|
||||
:color @account-color
|
||||
:path @derivation-path
|
||||
:account-name @account-name}]))
|
||||
]
|
||||
(rn/use-unmount #(rf/dispatch [:wallet/clear-new-keypair]))
|
||||
[rn/view {:style {:flex 1}}
|
||||
[quo/page-nav
|
||||
{:type :no-title
|
||||
:background :blur
|
||||
:right-side [{:icon-name :i/info
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content account-origin/view}])}]
|
||||
:icon-name :i/close
|
||||
:on-press #(rf/dispatch [:navigate-back])}]
|
||||
[quo/gradient-cover
|
||||
{:customization-color @account-color
|
||||
:container-style {:top (- top)}}]
|
||||
[rn/view
|
||||
{:style style/account-avatar-container}
|
||||
[floating-button-page/view
|
||||
{:gradient-cover? true
|
||||
:footer-container-padding 0
|
||||
:header-container-style {:padding-top top}
|
||||
:customization-color @account-color
|
||||
:header [quo/page-nav
|
||||
{:type :no-title
|
||||
:background :blur
|
||||
:right-side [{:icon-name :i/info
|
||||
:on-press show-account-origin}]
|
||||
:icon-name :i/close
|
||||
:on-press #(rf/dispatch [:navigate-back])}]
|
||||
:footer [standard-auth/slide-button
|
||||
{:container-style style/slide-button-container
|
||||
:size :size-48
|
||||
:track-text (i18n/label :t/slide-to-create-account)
|
||||
:customization-color @account-color
|
||||
:on-auth-success (fn [entered-password]
|
||||
(if new-keypair
|
||||
(add-keypair entered-password)
|
||||
(derive-address entered-password)))
|
||||
:auth-button-label (i18n/label :t/confirm)
|
||||
:disabled? (empty? @account-name)}]}
|
||||
[rn/view {:style style/account-avatar-container}
|
||||
[quo/account-avatar
|
||||
{:customization-color @account-color
|
||||
:size 80
|
||||
@@ -94,7 +125,8 @@
|
||||
:on-press #(rf/dispatch [:emoji-picker/open
|
||||
{:on-select (fn [selected-emoji]
|
||||
(reset! emoji selected-emoji))}])
|
||||
:container-style style/reaction-button-container} :i/reaction]]
|
||||
:container-style style/reaction-button-container}
|
||||
:i/reaction]]
|
||||
[quo/title-input
|
||||
{:customization-color @account-color
|
||||
:placeholder placeholder
|
||||
@@ -105,8 +137,7 @@
|
||||
:default-value @account-name
|
||||
:container-style style/title-input-container}]
|
||||
[quo/divider-line]
|
||||
[rn/view
|
||||
{:style style/color-picker-container}
|
||||
[rn/view {:style style/color-picker-container}
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
@@ -121,35 +152,7 @@
|
||||
[quo/category
|
||||
{:list-type :settings
|
||||
:label (i18n/label :t/origin)
|
||||
:data (get-keypair-data primary-name @derivation-path @account-color new-keypair)}]
|
||||
[standard-auth/slide-button
|
||||
{:size :size-48
|
||||
:track-text (i18n/label :t/slide-to-create-account)
|
||||
:customization-color @account-color
|
||||
:on-auth-success (fn [entered-password]
|
||||
(if new-keypair
|
||||
(rf/dispatch
|
||||
[:wallet/add-keypair-and-create-account
|
||||
{:sha3-pwd (security/safe-unmask-data
|
||||
entered-password)
|
||||
:new-keypair (create-account.utils/prepare-new-keypair
|
||||
{:new-keypair new-keypair
|
||||
:address address
|
||||
:account-name @account-name
|
||||
:account-color @account-color
|
||||
:emoji @emoji
|
||||
:derivation-path
|
||||
@derivation-path})}])
|
||||
(rf/dispatch [:wallet/derive-address-and-add-account
|
||||
{:sha3-pwd (security/safe-unmask-data
|
||||
entered-password)
|
||||
:emoji @emoji
|
||||
:color @account-color
|
||||
:path @derivation-path
|
||||
:account-name @account-name}])))
|
||||
:auth-button-label (i18n/label :t/confirm)
|
||||
:disabled? (empty? @account-name)
|
||||
:container-style (style/slide-button-container bottom)}]]))))
|
||||
:data (get-keypair-data primary-name @derivation-path @account-color new-keypair)}]]))))
|
||||
|
||||
(defn- view-internal
|
||||
[]
|
||||
|
||||
@@ -446,8 +446,8 @@
|
||||
"decline": "Decline",
|
||||
"decryption-failed-content": "An error occured decrypting your data. You might need to erase your old data and generate a new account. Tap “Apply” to erase or “Cancel” to try again",
|
||||
"default": "Default",
|
||||
"default-account-placeholder": "Account {{number}}",
|
||||
"default-watched-address-placeholder": "Watched address {{number}}",
|
||||
"default-account-placeholder": "Account",
|
||||
"default-watched-address-placeholder": "Watched address",
|
||||
"delete": "Delete",
|
||||
"delete-and-leave-group": "Delete and leave group",
|
||||
"delete-bootnode": "Delete bootnode",
|
||||
|
||||
Reference in New Issue
Block a user