From f5bfd63f0ed08e2cffd9c7939d2c9d7d366ea9bb Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Wed, 9 Jan 2019 16:40:43 +0100 Subject: [PATCH] [Mobile] Show status-go version on separate line in About. Signed-off-by: Igor Mandrigin --- src/status_im/ui/screens/about_app/views.cljs | 11 ++++++++-- src/status_im/ui/screens/profile/subs.cljs | 20 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/status_im/ui/screens/about_app/views.cljs b/src/status_im/ui/screens/about_app/views.cljs index a475c37fd4..1f4dc843b2 100644 --- a/src/status_im/ui/screens/about_app/views.cljs +++ b/src/status_im/ui/screens/about_app/views.cljs @@ -8,7 +8,8 @@ [re-frame.core :as re-frame])) (views/defview about-app [] - (views/letsubs [version [:get-app-version]] + (views/letsubs [app-version [:get-app-short-version] + node-version [:get-app-node-version]] [react/view {:flex 1} [status-bar/status-bar] [toolbar/simple-toolbar (i18n/label :t/about-app)] @@ -22,6 +23,12 @@ (when status-im.utils.platform/ios? [profile.components/settings-item-separator]) [profile.components/settings-item - {:item-text (i18n/label :t/version {:version version}) + {:item-text (i18n/label :t/version {:version app-version}) + :accessibility-label :version + :hide-arrow? true}] + (when status-im.utils.platform/ios? + [profile.components/settings-item-separator]) + [profile.components/settings-item + {:item-text node-version :accessibility-label :version :hide-arrow? true}]]]])) diff --git a/src/status_im/ui/screens/profile/subs.cljs b/src/status_im/ui/screens/profile/subs.cljs index 0714948290..f0e6c5ac84 100644 --- a/src/status_im/ui/screens/profile/subs.cljs +++ b/src/status_im/ui/screens/profile/subs.cljs @@ -4,6 +4,13 @@ [status-im.utils.build :as build] [status-im.utils.platform :as platform])) +(defn- node-version [{:keys [web3-node-version]}] + (str "status-go v" (or web3-node-version "N/A") "")) + +(def app-short-version + (let [version (if platform/desktop? build/version build/build-no)] + (str build/version " (" version ")"))) + (re-frame/reg-sub :get-profile-unread-messages-number :<- [:account/account] @@ -12,9 +19,16 @@ (re-frame/reg-sub :get-app-version - (fn [{:keys [web3-node-version]}] - (let [version (if platform/desktop? build/version build/build-no)] - (str build/version " (" version "); node " (or web3-node-version "N/A") "")))) + (fn [db] + (str app-short-version "; " (node-version db)))) + +(re-frame/reg-sub + :get-app-short-version + (fn [db] app-short-version)) + +(re-frame/reg-sub + :get-app-node-version + node-version) (re-frame/reg-sub :get-device-UUID