From 8d43dbf6cad07b69fe7888ef94e7c119281c87df Mon Sep 17 00:00:00 2001 From: Adrian Tiberius Date: Fri, 14 Oct 2016 15:45:41 +0300 Subject: [PATCH] changed to GFYCat-style naming convention --- src/status_im/chat/handlers.cljs | 11 ++++++----- src/status_im/chat/views/message.cljs | 3 ++- src/status_im/chat/views/toolbar_content.cljs | 3 ++- src/status_im/chats_list/views/inner_item.cljs | 5 +++-- src/status_im/components/drawer/view.cljs | 3 ++- src/status_im/contacts/views/contact_inner.cljs | 3 ++- .../discovery/views/discovery_list_item.cljs | 3 ++- src/status_im/translations/en.cljs | 1 - 8 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index b1456e55ea..c8f6712d96 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -26,6 +26,7 @@ [status-im.chat.handlers.commands :refer [command-prefix]] [status-im.chat.utils :refer [console? not-console?]] [status-im.constants :refer [console-chat-id]] + [status-im.utils.gfycat.core :refer [generate-gfy]] status-im.chat.handlers.animation status-im.chat.handlers.requests status-im.chat.handlers.unviewed-messages @@ -284,15 +285,15 @@ init-chat)))) (defn prepare-chat - [{:keys [contacts] :as db} [_ contcat-id options]] - (let [name (get-in contacts [contcat-id :name]) - chat (merge {:chat-id contcat-id - :name (or name contcat-id) + [{:keys [contacts] :as db} [_ contact-id options]] + (let [name (get-in contacts [contact-id :name]) + chat (merge {:chat-id contact-id + :name (or name (generate-gfy)) :color default-chat-color :group-chat false :is-active true :timestamp (.getTime (js/Date.)) - :contacts [{:identity contcat-id}] + :contacts [{:identity contact-id}] :dapp-url nil :dapp-hash nil} options)] diff --git a/src/status_im/chat/views/message.cljs b/src/status_im/chat/views/message.cljs index ce45e5fe4a..3edc391e9a 100644 --- a/src/status_im/chat/views/message.cljs +++ b/src/status_im/chat/views/message.cljs @@ -25,6 +25,7 @@ content-type-command content-type-command-request]] [status-im.utils.identicon :refer [identicon]] + [status-im.utils.gfycat.core :refer [generate-gfy]] [status-im.i18n :refer [label]] [status-im.chat.utils :as cu] [clojure.string :as str])) @@ -66,7 +67,7 @@ :font :default :number-of-lines 1} (if (str/blank? @name) - (label :t/user-anonymous) + (generate-gfy) (or @name (label :t/chat-name)))] (when (or status content) [text {:style st/status-text diff --git a/src/status_im/chat/views/toolbar_content.cljs b/src/status_im/chat/views/toolbar_content.cljs index cac831a0e8..ea88f1719d 100644 --- a/src/status_im/chat/views/toolbar_content.cljs +++ b/src/status_im/chat/views/toolbar_content.cljs @@ -10,6 +10,7 @@ [status-im.components.refreshable-text.view :refer [refreshable-text]] [status-im.utils.datetime :as time] [status-im.utils.platform :refer [platform-specific]] + [status-im.utils.gfycat.core :refer [generate-gfy]] [status-im.constants :refer [console-chat-id]])) (defn online-text [contact chat-id] @@ -58,7 +59,7 @@ :number-of-lines 1 :font :toolbar-title} (if (str/blank? @name) - (label :t/user-anonymous) + (generate-gfy) (or @name (label :t/chat-name)))] (if @group-chat [group-last-activity {:contacts @contacts diff --git a/src/status_im/chats_list/views/inner_item.cljs b/src/status_im/chats_list/views/inner_item.cljs index 179d62a2b4..e87e37c7aa 100644 --- a/src/status_im/chats_list/views/inner_item.cljs +++ b/src/status_im/chats_list/views/inner_item.cljs @@ -6,6 +6,7 @@ [status-im.utils.utils :refer [truncate-str]] [status-im.i18n :refer [label label-pluralize]] [status-im.utils.datetime :as time] + [status-im.utils.gfycat.core :refer [generate-gfy]] [status-im.constants :refer [console-chat-id]] [clojure.string :as str])) @@ -54,7 +55,7 @@ online group-chat contacts] :as chat}] (let [last-message (or (first (:messages chat)) last-message) - name (or name chat-id)] + name (or name (generate-gfy))] [view st/chat-container [view st/chat-icon-container [chat-icon-view-chat-list chat-id group-chat name color online]] @@ -63,7 +64,7 @@ [text {:style st/name-text :font :medium} (if (str/blank? name) - (label :t/user-anonymous) + (generate-gfy) (truncate-str name 30))] (when group-chat [icon :group st/group-icon]) diff --git a/src/status_im/components/drawer/view.cljs b/src/status_im/components/drawer/view.cljs index 474166680c..19fd639362 100644 --- a/src/status_im/components/drawer/view.cljs +++ b/src/status_im/components/drawer/view.cljs @@ -15,6 +15,7 @@ [status-im.components.drawer.styles :as st] [status-im.profile.validations :as v] [status-im.resources :as res] + [status-im.utils.gfycat.core :refer [generate-gfy]] [status-im.i18n :refer [label]] [status-im.components.react :refer [dismiss-keyboard!]])) @@ -55,7 +56,7 @@ [text-field {:line-color :white :focus-line-color :white - :placeholder (label :t/user-anonymous) + :placeholder (generate-gfy) :editable true :input-style (st/name-input-text (s/valid? ::v/name (or new-name name))) :wrapper-style st/name-input-wrapper diff --git a/src/status_im/contacts/views/contact_inner.cljs b/src/status_im/contacts/views/contact_inner.cljs index 5234453933..eccee6d939 100644 --- a/src/status_im/contacts/views/contact_inner.cljs +++ b/src/status_im/contacts/views/contact_inner.cljs @@ -3,6 +3,7 @@ [status-im.components.react :refer [view image text]] [status-im.components.chat-icon.screen :refer [contact-icon-contacts-tab]] [status-im.contacts.styles :as st] + [status-im.utils.gfycat.core :refer [generate-gfy]] [status-im.i18n :refer [label]])) (defn contact-photo [contact] @@ -21,7 +22,7 @@ (if (pos? (count (:name contact))) name ;; todo is this correct behaviour? - (label :t/user-anonymous))] + (generate-gfy))] (when info [text {:style st/info-text} info])]])) diff --git a/src/status_im/discovery/views/discovery_list_item.cljs b/src/status_im/discovery/views/discovery_list_item.cljs index 56d622b88f..a597ae44e7 100644 --- a/src/status_im/discovery/views/discovery_list_item.cljs +++ b/src/status_im/discovery/views/discovery_list_item.cljs @@ -4,6 +4,7 @@ [clojure.string :as str] [status-im.components.react :refer [view text image]] [status-im.discovery.styles :as st] + [status-im.utils.gfycat.core :refer [generate-gfy]] [status-im.utils.identicon :refer [identicon]] [status-im.i18n :refer [label]])) @@ -18,7 +19,7 @@ (cond (not (str/blank? contact-name)) contact-name (not (str/blank? name)) name - :else (label :t/user-anonymous))] + :else (generate-gfy))] [text {:style st/popular-list-item-status :font :default :number-of-lines 2} diff --git a/src/status_im/translations/en.cljs b/src/status_im/translations/en.cljs index 92727dfe9b..101de3602c 100644 --- a/src/status_im/translations/en.cljs +++ b/src/status_im/translations/en.cljs @@ -61,7 +61,6 @@ :report-user "REPORT USER" :message "Message" :username "Username" - :user-anonymous "Anonymous" :not-specified "Not specified" :public-key "Public Key" :phone-number "Phone number"