bug #5307 - showing new contract as recipient in contract creation transactions

Signed-off-by: Goran Jovic <goranjovic@gmail.com>
This commit is contained in:
Goran Jovic 2018-07-27 12:42:12 +02:00
parent 216d6dfb8a
commit 30b4d601fb
No known key found for this signature in database
GPG Key ID: D429D1A9B2EB8A8E
3 changed files with 11 additions and 6 deletions

View File

@ -173,10 +173,13 @@
(when error
[tooltip/tooltip error {}])])))
(defn- recipient-address [address]
(defn- recipient-address [address modal?]
[react/text {:style (merge styles/recipient-address (when-not address styles/recipient-no-address))
:accessibility-label :recipient-address-text}
(or (ethereum/normalized-address address) (i18n/label :t/specify-recipient))])
(or (ethereum/normalized-address address)
(if modal?
(i18n/label :t/new-contract)
(i18n/label :t/specify-recipient)))])
(views/defview recipient-contact [address name request?]
(views/letsubs [contact [:get-contact-by-address address]]
@ -258,7 +261,7 @@
{:label (i18n/label :t/recipient-code)
:action #(re-frame/dispatch [:navigate-to :contact-code])}]))}))
(defn recipient-selector [{:keys [name address disabled? contact-only? request?]}]
(defn recipient-selector [{:keys [name address disabled? contact-only? request? modal?]}]
[cartouche {:on-press #(on-choose-recipient contact-only?)
:disabled? disabled?
:icon :icons/dots-horizontal
@ -267,7 +270,7 @@
[react/view {:accessibility-label :choose-recipient-button}
(if name
[recipient-contact address name request?]
[recipient-address address])]])
[recipient-address address modal?])]])
(defn- amount-input [{:keys [input-options amount amount-text disabled?]}
{:keys [symbol decimals]}]

View File

@ -40,7 +40,8 @@
[components/recipient-selector {:contact-only? true
:address to
:name to-name
:request? true}]
:request? true
:modal? false}]
[components/asset-selector {:disabled? false
:type :request
:symbol symbol}]

View File

@ -233,7 +233,8 @@
[react/view styles/send-transaction-form
[components/recipient-selector {:disabled? (or from-chat? modal?)
:address to
:name to-name}]
:name to-name
:modal? modal?}]
[components/asset-selector {:disabled? (or from-chat? modal?)
:error asset-error
:type :send