From 0b22bddca265037f2d423b4c4bcc8dad30b20e25 Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Mon, 8 Oct 2018 16:27:11 +0200 Subject: [PATCH] Show 3-word names in profile screens in Desktop. Signed-off-by: Igor Mandrigin --- .../ui/screens/desktop/main/tabs/profile/styles.cljs | 3 +++ .../ui/screens/desktop/main/tabs/profile/views.cljs | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/status_im/ui/screens/desktop/main/tabs/profile/styles.cljs b/src/status_im/ui/screens/desktop/main/tabs/profile/styles.cljs index 569ec76755..c3bdb5611b 100644 --- a/src/status_im/ui/screens/desktop/main/tabs/profile/styles.cljs +++ b/src/status_im/ui/screens/desktop/main/tabs/profile/styles.cljs @@ -44,6 +44,9 @@ (def profile-user-name {:font-size 18}) +(def profile-three-words + {:font-size 14}) + (def profile-editing-user-name (merge profile-user-name {:height 20 diff --git a/src/status_im/ui/screens/desktop/main/tabs/profile/views.cljs b/src/status_im/ui/screens/desktop/main/tabs/profile/views.cljs index c124df498f..3a0bfb2942 100644 --- a/src/status_im/ui/screens/desktop/main/tabs/profile/views.cljs +++ b/src/status_im/ui/screens/desktop/main/tabs/profile/views.cljs @@ -8,6 +8,7 @@ [status-im.i18n :as i18n] [status-im.ui.components.icons.vector-icons :as vector-icons] [taoensso.timbre :as log] + [status-im.utils.gfycat.core :as gfy] [clojure.string :as string] [status-im.ui.screens.offline-messaging-settings.views :as offline-messaging.views] [status-im.ui.components.qr-code-viewer.views :as qr-code-viewer] @@ -16,7 +17,7 @@ [status-im.ui.screens.profile.seed.views :as profile.recovery] [status-im.ui.components.common.common :as components.common])) -(defn profile-badge [{:keys [name photo-path]} editing?] +(defn profile-badge [{:keys [name photo-path public-key]} editing?] [react/view styles/profile-badge [react/image {:source {:uri photo-path} :style styles/profile-photo}] @@ -31,7 +32,13 @@ [react/text {:style styles/profile-user-name :font :medium :number-of-lines 1} - name])]) + name]) + (let [gfy-name (gfy/generate-gfy public-key)] + (when (and (not= gfy-name gfy/unknown-gfy) + (not= gfy-name name)) + [react/text {:style styles/profile-three-words + :number-of-lines 1} + gfy-name]))]) (views/defview copied-tooltip [opacity] (views/letsubs []