Merge pull request #535 from status-im/bug/#523

Add contact form: public key instead of address (#523)
This commit is contained in:
Roman Volosovskyi 2016-12-02 19:18:48 +02:00 committed by GitHub
commit e7463b877a
4 changed files with 9 additions and 6 deletions

View File

@ -45,7 +45,7 @@
:photo-path (identicon whisper-identity) :photo-path (identicon whisper-identity)
:whisper-identity whisper-identity}] :whisper-identity whisper-identity}]
(dispatch [:add-new-contact contact])) (dispatch [:add-new-contact contact]))
(dispatch [:set :new-contact-address-error (label :t/unknown-address)])))) (dispatch [:set :new-contact-public-key-error (label :t/unknown-address)]))))
(dispatch [:add-new-contact {:name (generate-gfy) (dispatch [:add-new-contact {:name (generate-gfy)
:photo-path (identicon id) :photo-path (identicon id)
:whisper-identity id}]))) :whisper-identity id}])))
@ -61,7 +61,7 @@
(label :t/contact-already-added) (label :t/contact-already-added)
(not (s/valid? ::v/whisper-identity whisper-identity)) (not (s/valid? ::v/whisper-identity whisper-identity))
(label :t/enter-valid-address) (label :t/enter-valid-public-key)
:else error)) :else error))
@ -85,10 +85,10 @@
:input-style st/qr-input :input-style st/qr-input
:value whisper-identity :value whisper-identity
:wrapper-style button-input :wrapper-style button-input
:label (label :t/address) :label (label :t/public-key)
:on-change-text #(do :on-change-text #(do
(dispatch [:set-in [:new-contact-identity] %]) (dispatch [:set-in [:new-contact-identity] %])
(dispatch [:set :new-contact-address-error nil]))}] (dispatch [:set :new-contact-public-key-error nil]))}]
[scan-button {:show-label? (zero? (count whisper-identity)) [scan-button {:show-label? (zero? (count whisper-identity))
:handler #(dispatch [:scan-qr-code :handler #(dispatch [:scan-qr-code
{:toolbar-title (label :t/new-contact)} {:toolbar-title (label :t/new-contact)}
@ -97,7 +97,7 @@
(defview new-contact [] (defview new-contact []
[new-contact-identity [:get :new-contact-identity] [new-contact-identity [:get :new-contact-identity]
error [:get :new-contact-address-error] error [:get :new-contact-public-key-error]
account [:get-current-account]] account [:get-current-account]]
[view st/contact-form-container [view st/contact-form-container
[status-bar] [status-bar]

View File

@ -189,6 +189,7 @@
:whisper-identity "Whisper Identity" :whisper-identity "Whisper Identity"
:address-explication "Maybe here should be some text explaining what an address is and where to look for it" :address-explication "Maybe here should be some text explaining what an address is and where to look for it"
:enter-valid-address "Please enter a valid address or scan a QR code" :enter-valid-address "Please enter a valid address or scan a QR code"
:enter-valid-public-key "Please enter a valid public key or scan a QR code"
:contact-already-added "The contact has already been added" :contact-already-added "The contact has already been added"
:can-not-add-yourself "You can't add yourself" :can-not-add-yourself "You can't add yourself"
:unknown-address "Unknown address" :unknown-address "Unknown address"

View File

@ -186,6 +186,7 @@
:whisper-identity "Скрытая личность" :whisper-identity "Скрытая личность"
:address-explication "Может быть, здесь должен быть какой-то текст, поясняющий адрес и то, где его искать" :address-explication "Может быть, здесь должен быть какой-то текст, поясняющий адрес и то, где его искать"
:enter-valid-address "Введите действительный адрес или сканируйте QR-код" :enter-valid-address "Введите действительный адрес или сканируйте QR-код"
:enter-valid-public-key "Введите действительный публичный ключ или сканируйте QR-код"
:contact-already-added "Контакт уже добавлен" :contact-already-added "Контакт уже добавлен"
:can-not-add-yourself "Вы не можете добавить себя" :can-not-add-yourself "Вы не можете добавить себя"
:unknown-address "Неизвестный адрес" :unknown-address "Неизвестный адрес"

View File

@ -183,6 +183,7 @@
:whisper-identity "Прошепотіти справжність" :whisper-identity "Прошепотіти справжність"
:address-explication "Можливо тут повинен бути текст, який пояснює, що таке адреса і де її шукати" :address-explication "Можливо тут повинен бути текст, який пояснює, що таке адреса і де її шукати"
:enter-valid-address "Будь ласка, введіть дійсну адресу або відскануйте QR-код" :enter-valid-address "Будь ласка, введіть дійсну адресу або відскануйте QR-код"
:enter-valid-public-key "Будь ласка, введіть дійсний відкритий ключ або відскануйте QR-код"
:contact-already-added "Контакт вже додано" :contact-already-added "Контакт вже додано"
:can-not-add-yourself "Ви не можете додати себе" :can-not-add-yourself "Ви не можете додати себе"
:unknown-address "Невідома адреса" :unknown-address "Невідома адреса"