[#3941]: Introducing wallet / notification not for new user

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Aleksandr Pantiukhov 2018-05-17 15:44:28 +02:00 committed by Pedro Pombeiro
parent 184fb1d612
commit 4f6830b271
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
7 changed files with 64 additions and 21 deletions

View File

@ -22,5 +22,4 @@
:sharing-usage-data? {:type :bool :default false} :sharing-usage-data? {:type :bool :default false}
:dev-mode? {:type :bool :default false} :dev-mode? {:type :bool :default false}
:seed-backed-up? {:type :bool :default false} :seed-backed-up? {:type :bool :default false}
:wallet-set-up-passed? {:type :bool :wallet-set-up-passed? {:type :bool :default false}}})
:default false}}})

View File

@ -177,6 +177,8 @@
:wallet-set-up-signing-phrase "This is your personal transaction phrase that youll use everytime you make a transaction. Make sure to write it down on a piece of paper, store it somewhere, and only confirm transactions when you see these three words." :wallet-set-up-signing-phrase "This is your personal transaction phrase that youll use everytime you make a transaction. Make sure to write it down on a piece of paper, store it somewhere, and only confirm transactions when you see these three words."
:wallet-set-up-confirm-title "Wrote it down?" :wallet-set-up-confirm-title "Wrote it down?"
:wallet-set-up-confirm-description "You wont be able to see your 3-word transaction phrase again after this." :wallet-set-up-confirm-description "You wont be able to see your 3-word transaction phrase again after this."
:wallet-backup-seed-title "Backup your Seed Phrase"
:wallet-backup-seed-description "This will help you to keep your money safe"
;;make_photo ;;make_photo
:image-source-title "Edit picture" :image-source-title "Edit picture"

View File

@ -7,6 +7,7 @@
(def white-lighter-transparent "rgba(255, 255, 255, 0.6)") ;; Used for input placeholder color (def white-lighter-transparent "rgba(255, 255, 255, 0.6)") ;; Used for input placeholder color
(def black "#000000") ;; Used as the default text color (def black "#000000") ;; Used as the default text color
(def black-transparent "#00000020") ;; Used as background color for rounded button on dark background (def black-transparent "#00000020") ;; Used as background color for rounded button on dark background
(def black-darker-transparent "#00000033") ;; Used as background color for containers like "Backup seed phrase"
(def gray "#939ba1") ;; Used as a background for a light foreground and as section header and secondary text color (def gray "#939ba1") ;; Used as a background for a light foreground and as section header and secondary text color
(def gray-icon "#6e777e") ;; Used for forward icon in accounts (def gray-icon "#6e777e") ;; Used for forward icon in accounts
(def gray-light "#e8ebec") ;; Used as divider color (def gray-light "#e8ebec") ;; Used as divider color

View File

@ -70,15 +70,15 @@
[re-frame/trim-v (re-frame/inject-cofx ::get-signing-phrase) (re-frame/inject-cofx ::get-status)] [re-frame/trim-v (re-frame/inject-cofx ::get-signing-phrase) (re-frame/inject-cofx ::get-status)]
(fn [{:keys [signing-phrase status db] :as cofx} [{:keys [pubkey address mnemonic]} password]] (fn [{:keys [signing-phrase status db] :as cofx} [{:keys [pubkey address mnemonic]} password]]
(let [normalized-address (utils.hex/normalize-hex address) (let [normalized-address (utils.hex/normalize-hex address)
account {:public-key pubkey account {:public-key pubkey
:address normalized-address :address normalized-address
:name (generate-gfy pubkey) :name (generate-gfy pubkey)
:status status :status status
:signed-up? true :signed-up? true
:photo-path (identicon pubkey) :photo-path (identicon pubkey)
:signing-phrase signing-phrase :signing-phrase signing-phrase
:mnemonic mnemonic :mnemonic mnemonic
:settings (constants/default-account-settings)}] :settings (constants/default-account-settings)}]
(log/debug "account-created") (log/debug "account-created")
(when-not (str/blank? pubkey) (when-not (str/blank? pubkey)
(-> (add-account db account) (-> (add-account db account)
@ -164,4 +164,4 @@
(handlers/register-handler-fx (handlers/register-handler-fx
:wallet-set-up-passed :wallet-set-up-passed
(fn [cofx] (fn [cofx]
(accounts.utils/account-update {:wallet-set-up-passed? true} cofx))) (accounts.utils/account-update {:wallet-set-up-passed? true} cofx)))

View File

@ -1,5 +1,6 @@
(ns status-im.ui.screens.wallet.send.transaction-sent.styles (ns status-im.ui.screens.wallet.send.transaction-sent.styles
(:require-macros [status-im.utils.styles :refer [defnstyle defstyle]])) (:require-macros [status-im.utils.styles :refer [defnstyle defstyle]])
(:require [status-im.ui.components.colors :as colors]))
(def transaction-sent-container (def transaction-sent-container
{:align-items :center}) {:align-items :center})
@ -30,7 +31,7 @@
(def transaction-details-container (def transaction-details-container
{:height 42 {:height 42
:background-color "#00000033" :background-color colors/black-darker-transparent
:margin-horizontal 16 :margin-horizontal 16
:opacity 0.2 :opacity 0.2
:align-items :center :align-items :center

View File

@ -81,6 +81,30 @@
(def section (def section
{:background-color colors/blue}) {:background-color colors/blue})
(def backup-seed-phrase-container
{:flex-direction :row
:align-items :center
:border-radius 8
:margin 16
:background-color colors/black-darker-transparent
:padding-top 10
:padding-bottom 10
:padding-left 14
:padding-right 12})
(def backup-seed-phrase-text-container
{:flex 1})
(def backup-seed-phrase-title
{:font-size 15
:line-height 20
:color colors/white})
(def backup-seed-phrase-description
{:font-size 14
:line-height 20
:color colors/white-lighter-transparent})
(def total-balance-container (def total-balance-container
{:align-items :center {:align-items :center
:justify-content :center}) :justify-content :center})

View File

@ -6,11 +6,10 @@
[status-im.ui.components.list.views :as list] [status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react] [status-im.ui.components.react :as react]
[status-im.ui.components.toolbar.view :as toolbar] [status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.screens.wallet.onboarding.views :as onboarding.views] [status-im.ui.screens.wallet.onboarding.views :as onboarding.views]
[status-im.ui.screens.wallet.styles :as styles] [status-im.ui.screens.wallet.styles :as styles]
[status-im.ui.screens.wallet.utils :as wallet.utils] [status-im.ui.screens.wallet.utils :as wallet.utils]))
[status-im.utils.ethereum.core :as ethereum]
[status-im.utils.ethereum.tokens :as tokens]))
(defn toolbar-view [] (defn toolbar-view []
[toolbar/toolbar {:style styles/toolbar :flat? true} [toolbar/toolbar {:style styles/toolbar :flat? true}
@ -35,6 +34,17 @@
(:code currency)]] (:code currency)]]
[react/text {:style styles/total-value} (i18n/label :t/wallet-total-value)]]]) [react/text {:style styles/total-value} (i18n/label :t/wallet-total-value)]]])
(defn- backup-seed-phrase []
[react/view styles/section
[react/touchable-highlight {:on-press #(re-frame/dispatch [:navigate-to :backup-seed])}
[react/view styles/backup-seed-phrase-container
[react/view styles/backup-seed-phrase-text-container
[react/text {:style styles/backup-seed-phrase-title}
(i18n/label :t/wallet-backup-seed-title)]
[react/text {:style styles/backup-seed-phrase-description}
(i18n/label :t/wallet-backup-seed-description)]]
[vector-icons/icon :icons/forward {:color :white}]]]])
(def actions (def actions
[{:label (i18n/label :t/send-transaction) [{:label (i18n/label :t/send-transaction)
:accessibility-label :send-transaction-button :accessibility-label :send-transaction-button
@ -83,7 +93,8 @@
(views/defview wallet-root [] (views/defview wallet-root []
(views/letsubs [assets [:wallet/visible-assets-with-amount] (views/letsubs [assets [:wallet/visible-assets-with-amount]
currency [:wallet/currency] currency [:wallet/currency]
portfolio-value [:portfolio-value]] portfolio-value [:portfolio-value]
{:keys [seed-backed-up?]} [:get-current-account]]
[react/view styles/main-section [react/view styles/main-section
[toolbar-view] [toolbar-view]
[react/scroll-view {:refresh-control [react/scroll-view {:refresh-control
@ -92,6 +103,11 @@
:tint-color :white :tint-color :white
:refreshing false}])} :refreshing false}])}
[total-section portfolio-value currency] [total-section portfolio-value currency]
(when (and (not seed-backed-up?)
(some (fn [{:keys [amount]}]
(and amount (not (.isZero amount))))
assets))
[backup-seed-phrase])
[list/action-list actions [list/action-list actions
{:container-style styles/action-section}] {:container-style styles/action-section}]
[asset-section assets currency] [asset-section assets currency]
@ -100,6 +116,6 @@
(views/defview wallet [] (views/defview wallet []
(views/letsubs [{:keys [wallet-set-up-passed?]} [:get-current-account]] (views/letsubs [{:keys [wallet-set-up-passed?]} [:get-current-account]]
(if wallet-set-up-passed? (if (not wallet-set-up-passed?)
[wallet-root] [onboarding.views/onboarding]
[onboarding.views/onboarding]))) [wallet-root])))