From 8d963726a792325aa183416dae0c0947a9a0c398 Mon Sep 17 00:00:00 2001 From: alwx Date: Fri, 2 Dec 2016 15:40:33 +0300 Subject: [PATCH] Add contact form: public key instead of address (#523) --- src/status_im/contacts/views/new_contact.cljs | 12 ++++++------ src/status_im/translations/en.cljs | 1 + src/status_im/translations/ru.cljs | 1 + src/status_im/translations/uk.cljs | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/status_im/contacts/views/new_contact.cljs b/src/status_im/contacts/views/new_contact.cljs index 38418fcbf7..c05d06591b 100644 --- a/src/status_im/contacts/views/new_contact.cljs +++ b/src/status_im/contacts/views/new_contact.cljs @@ -45,7 +45,7 @@ :photo-path (identicon whisper-identity) :whisper-identity whisper-identity}] (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) :photo-path (identicon id) :whisper-identity id}]))) @@ -61,7 +61,7 @@ (label :t/contact-already-added) (not (s/valid? ::v/whisper-identity whisper-identity)) - (label :t/enter-valid-address) + (label :t/enter-valid-public-key) :else error)) @@ -85,10 +85,10 @@ :input-style st/qr-input :value whisper-identity :wrapper-style button-input - :label (label :t/address) + :label (label :t/public-key) :on-change-text #(do - (dispatch [:set-in [:new-contact-identity] %]) - (dispatch [:set :new-contact-address-error nil]))}] + (dispatch [:set-in [:new-contact-identity] %]) + (dispatch [:set :new-contact-public-key-error nil]))}] [scan-button {:show-label? (zero? (count whisper-identity)) :handler #(dispatch [:scan-qr-code {:toolbar-title (label :t/new-contact)} @@ -97,7 +97,7 @@ (defview new-contact [] [new-contact-identity [:get :new-contact-identity] - error [:get :new-contact-address-error] + error [:get :new-contact-public-key-error] account [:get-current-account]] [view st/contact-form-container [status-bar] diff --git a/src/status_im/translations/en.cljs b/src/status_im/translations/en.cljs index 3cdaffd203..5e46abcd8b 100644 --- a/src/status_im/translations/en.cljs +++ b/src/status_im/translations/en.cljs @@ -189,6 +189,7 @@ :whisper-identity "Whisper Identity" :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-public-key "Please enter a valid public key or scan a QR code" :contact-already-added "The contact has already been added" :can-not-add-yourself "You can't add yourself" :unknown-address "Unknown address" diff --git a/src/status_im/translations/ru.cljs b/src/status_im/translations/ru.cljs index f9af405cab..7823ead833 100644 --- a/src/status_im/translations/ru.cljs +++ b/src/status_im/translations/ru.cljs @@ -186,6 +186,7 @@ :whisper-identity "Скрытая личность" :address-explication "Может быть, здесь должен быть какой-то текст, поясняющий адрес и то, где его искать" :enter-valid-address "Введите действительный адрес или сканируйте QR-код" + :enter-valid-public-key "Введите действительный публичный ключ или сканируйте QR-код" :contact-already-added "Контакт уже добавлен" :can-not-add-yourself "Вы не можете добавить себя" :unknown-address "Неизвестный адрес" diff --git a/src/status_im/translations/uk.cljs b/src/status_im/translations/uk.cljs index 094117b7e5..37ccf9031b 100644 --- a/src/status_im/translations/uk.cljs +++ b/src/status_im/translations/uk.cljs @@ -183,6 +183,7 @@ :whisper-identity "Прошепотіти справжність" :address-explication "Можливо тут повинен бути текст, який пояснює, що таке адреса і де її шукати" :enter-valid-address "Будь ласка, введіть дійсну адресу або відскануйте QR-код" + :enter-valid-public-key "Будь ласка, введіть дійсний відкритий ключ або відскануйте QR-код" :contact-already-added "Контакт вже додано" :can-not-add-yourself "Ви не можете додати себе" :unknown-address "Невідома адреса"