From 1b6fa1d980717ceb20030f72d680a05e3d2d990f Mon Sep 17 00:00:00 2001 From: Aleksandr Pantiukhov Date: Mon, 1 Oct 2018 11:26:47 +0300 Subject: [PATCH] [#5979]: Add ENS names to profile screen Signed-off-by: Aleksandr Pantiukhov --- src/status_im/events.cljs | 5 +++++ src/status_im/ui/screens/profile/events.cljs | 2 ++ src/status_im/ui/screens/profile/user/views.cljs | 3 +++ translations/en.json | 1 + 4 files changed, 11 insertions(+) diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 2f3be56123..ed1e690715 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -935,3 +935,8 @@ :group-chats.callback/extract-signature-success (fn [cofx [_ group-update sender-signature]] (group-chats/handle-membership-update cofx group-update sender-signature))) + +(handlers/register-handler-fx + :profile.ui/ens-names-button-pressed + (fn [cofx] + (browser/open-url cofx "names.statusnet.eth"))) diff --git a/src/status_im/ui/screens/profile/events.cljs b/src/status_im/ui/screens/profile/events.cljs index 0f019bd6c3..ee2f8b7b4e 100644 --- a/src/status_im/ui/screens/profile/events.cljs +++ b/src/status_im/ui/screens/profile/events.cljs @@ -1,5 +1,7 @@ (ns status-im.ui.screens.profile.events (:require [re-frame.core :as re-frame] + [status-im.browser.core :as browser] + [status-im.ui.screens.profile.models :as profile.models] [status-im.ui.screens.profile.navigation] [status-im.ui.components.list-selection :as list-selection] [status-im.ui.screens.profile.models :as profile.models] diff --git a/src/status_im/ui/screens/profile/user/views.cljs b/src/status_im/ui/screens/profile/user/views.cljs index 9fa3da863d..bf6cb77ce9 100644 --- a/src/status_im/ui/screens/profile/user/views.cljs +++ b/src/status_im/ui/screens/profile/user/views.cljs @@ -99,6 +99,9 @@ (let [show-backup-seed? (and (not seed-backed-up?) (not (string/blank? mnemonic)))] [react/view [profile.components/settings-title (i18n/label :t/settings)] + [profile.components/settings-item {:label-kw :t/ens-names + :action-fn #(re-frame/dispatch [:profile.ui/ens-names-button-pressed]) + :accessibility-label :ens-names-button}] [profile.components/settings-item {:label-kw :t/main-currency :value (:code currency) :action-fn #(re-frame/dispatch [:navigate-to :currency-settings]) diff --git a/translations/en.json b/translations/en.json index a034da9b4c..3d6eb7cf22 100644 --- a/translations/en.json +++ b/translations/en.json @@ -309,6 +309,7 @@ "ok-got-it": "Ok, got it", "ok": "OK", "main-currency": "Main currency", + "ens-names": "ENS names", "clear-history-title": "Clear history?", "image-source-make-photo": "Capture", "chat": "Chat",