Merge pull request #489 from status-im/bug/discover-typo

Fix Discover typo (#483)
This commit is contained in:
Roman Volosovskyi 2016-11-28 16:08:49 +02:00 committed by GitHub
commit ce63e17a31
71 changed files with 199 additions and 198 deletions

View File

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 891 B

View File

Before

Width:  |  Height:  |  Size: 617 B

After

Width:  |  Height:  |  Size: 617 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "icon_tab_discovery.png",
"filename" : "icon_tab_discover.png",
"scale" : "1x"
},
{

View File

@ -15,7 +15,7 @@
[status-im.contacts.views.contact-list :refer [contact-list]]
[status-im.contacts.views.new-contact :refer [new-contact]]
[status-im.qr-scanner.screen :refer [qr-scanner]]
[status-im.discovery.search-results :refer [discovery-search-results]]
[status-im.discover.search-results :refer [discover-search-results]]
[status-im.chat.screen :refer [chat]]
[status-im.accounts.login.screen :refer [login]]
[status-im.accounts.recover.screen :refer [recover]]
@ -87,8 +87,8 @@
(when @view-id
(let [current-view (validate-current-view @view-id @signed-up?)]
(let [component (case current-view
:discovery main-tabs
:discovery-search-results discovery-search-results
:discover main-tabs
:discover-search-results discover-search-results
:add-participants new-participants
:remove-participants remove-participants
:chat-list main-tabs

View File

@ -21,7 +21,7 @@
:additional-height 0}
:chat {:new-message {:border-top-color styles/color-transparent
:border-top-width 0.5}}
:discovery {:subtitle {:color styles/color-gray2
:discover {:subtitle {:color styles/color-gray2
:font-size 14}
:popular {:border-radius 1
:margin-top 2
@ -81,4 +81,4 @@
:new-contact-in-toolbar? false
:uppercase-subtitles? false
:group-block-shadows? true}
:discovery {:uppercase-subtitles? false}})
:discover {:uppercase-subtitles? false}})

View File

@ -103,7 +103,7 @@
(register-handler :received-message-when-commands-loaded
(u/side-effect!
(fn [db [_ chat-id message]]
(if (commands-loaded? db chat-id)
(if true #_(commands-loaded? db chat-id)
(dispatch [:received-message message])
(s/execute-later
#(dispatch [:received-message-when-commands-loaded chat-id message])

View File

@ -99,8 +99,8 @@
:handler (fn []
;; TODO not implemented
)}]
[menu-item {:name (label :t/discovery)
:handler #(dispatch [:navigate-to :discovery])}]
[menu-item {:name (label :t/discover)
:handler #(dispatch [:navigate-to :discover])}]
[menu-item {:name (label :t/contacts)
:handler #(dispatch [:navigate-to :contact-list])}]]
(when (zero? @keyboard-height)

View File

@ -14,7 +14,7 @@
[status-im.components.drawer.view :refer [drawer-view]]
[status-im.components.animation :as anim]
[status-im.chats-list.screen :refer [chats-list]]
[status-im.discovery.screen :refer [discovery]]
[status-im.discover.screen :refer [discover]]
[status-im.contacts.screen :refer [contact-list]]
[status-im.components.tabs.tabs :refer [tabs]]
[status-im.components.tabs.styles :as st]
@ -28,10 +28,10 @@
:screen chats-list
:icon :icon_tab_chats
:index 0}
{:view-id :discovery
:title (label :t/discovery)
:screen discovery
:icon :icon_tab_discovery
{:view-id :discover
:title (label :t/discover)
:screen discover
:icon :icon_tab_discover
:index 1}
{:view-id :contact-list
:title (label :t/contacts)
@ -56,7 +56,7 @@
(dispatch [:on-navigated-to-tab]))))))))))
(def tab->index {:chat-list 0
:discovery 1
:discover 1
:contact-list 2})
(def index->tab (clojure.set/map-invert tab->index))
@ -106,7 +106,7 @@
:onScrollBeginDrag #(reset! dragging? true)
:on-momentum-scroll-end (on-scroll-end swiped? dragging?)})
[chats-list]
[discovery (= @view-id :discovery)]
[discover (= @view-id :discover)]
[contact-list]]
[tabs {:selected-view-id @view-id
:prev-view-id @prev-view-id

View File

@ -21,7 +21,7 @@
(def default-number-of-messages 20)
(def blocks-per-hour 120)
(def default-number-of-discovery-search-results 20)
(def default-number-of-discover-search-results 20)
(def console-chat-id "console")
(def wallet-chat-id "wallet")

View File

@ -1,5 +1,5 @@
(ns status-im.data-store.discovery
(:require [status-im.data-store.realm.discovery :as data-store]))
(ns status-im.data-store.discover
(:require [status-im.data-store.realm.discover :as data-store]))
(defn get-all
[ordering]
@ -7,8 +7,8 @@
(mapv #(update % :tags vals))))
(defn save
[discovery]
(data-store/save discovery))
[discover]
(data-store/save discover))
(defn exists?
[message-id]

View File

@ -1,11 +1,11 @@
(ns status-im.data-store.realm.discovery
(ns status-im.data-store.realm.discover
(:require [status-im.data-store.realm.core :as realm]
[taoensso.timbre :as log])
(:refer-clojure :exclude [exists?]))
(defn get-all
[ordering]
(-> (realm/get-all @realm/account-realm :discovery)
(-> (realm/get-all @realm/account-realm :discover)
(realm/sorted :created-at ordering)))
(defn get-all-as-list
@ -32,37 +32,37 @@
(defn- get-tags
[message-id]
(-> (realm/get-one-by-field-clj @realm/account-realm :discovery :message-id message-id)
(-> (realm/get-one-by-field-clj @realm/account-realm :discover :message-id message-id)
(:tags)
(vals)))
(defn- upsert-discovery [{:keys [message-id tags] :as discovery}]
(log/debug "Creating/updating discovery with tags: " tags)
(defn- upsert-discover [{:keys [message-id tags] :as discover}]
(log/debug "Creating/updating discover with tags: " tags)
(let [prev-tags (get-tags message-id)]
(when prev-tags
(update-tags-counter dec prev-tags))
(realm/create @realm/account-realm :discovery discovery true)
(realm/create @realm/account-realm :discover discover true)
(update-tags-counter inc tags)))
(defn exists?
[message-id]
(realm/exists? @realm/account-realm :discovery {:message-id message-id}))
(realm/exists? @realm/account-realm :discover {:message-id message-id}))
(defn save
[discovery]
[discover]
(realm/write @realm/account-realm
#(upsert-discovery discovery)))
#(upsert-discover discover)))
(defn save-all
[discoveries]
(realm/write @realm/account-realm
(fn []
(doseq [discovery discoveries]
(upsert-discovery discovery)))))
(doseq [discover discoveries]
(upsert-discover discover)))))
(defn delete
[by ordering critical-count to-delete-count]
(let [discoveries (realm/get-all @realm/account-realm :discovery)
(let [discoveries (realm/get-all @realm/account-realm :discover)
count (realm/get-count discoveries)]
(if (> count critical-count)
(let [to-delete (-> (realm/sorted discoveries by ordering)

View File

@ -3,7 +3,7 @@
[status-im.data-store.realm.schemas.account.v1.chat-contact :as chat-contact]
[status-im.data-store.realm.schemas.account.v1.command :as command]
[status-im.data-store.realm.schemas.account.v1.contact :as contact]
[status-im.data-store.realm.schemas.account.v1.discovery :as discovery]
[status-im.data-store.realm.schemas.account.v1.discover :as discover]
[status-im.data-store.realm.schemas.account.v1.kv-store :as kv-store]
[status-im.data-store.realm.schemas.account.v1.message :as message]
[status-im.data-store.realm.schemas.account.v1.pending-message :as pending-message]
@ -16,7 +16,7 @@
chat-contact/schema
command/schema
contact/schema
discovery/schema
discover/schema
kv-store/schema
message/schema
pending-message/schema
@ -30,7 +30,7 @@
(chat-contact/migration old-realm new-realm)
(command/migration old-realm new-realm)
(contact/migration old-realm new-realm)
(discovery/migration old-realm new-realm)
(discover/migration old-realm new-realm)
(kv-store/migration old-realm new-realm)
(message/migration old-realm new-realm)
(pending-message/migration old-realm new-realm)

View File

@ -1,7 +1,7 @@
(ns status-im.data-store.realm.schemas.account.v1.discovery
(ns status-im.data-store.realm.schemas.account.v1.discover
(:require [taoensso.timbre :as log]))
(def schema {:name :discovery
(def schema {:name :discover
:primaryKey :message-id
:properties {:message-id "string"
:name {:type "string" :optional true}
@ -14,4 +14,4 @@
:last-updated "date"}})
(defn migration [old-realm new-realm]
(log/debug "migrating discovery schema"))
(log/debug "migrating discover schema"))

View File

@ -4,7 +4,7 @@
[status-im.data-store.realm.schemas.account.v1.chat :as chat]
[status-im.data-store.realm.schemas.account.v1.chat-contact :as chat-contact]
[status-im.data-store.realm.schemas.account.v1.command :as command]
[status-im.data-store.realm.schemas.account.v1.discovery :as discovery]
[status-im.data-store.realm.schemas.account.v1.discover :as discover]
[status-im.data-store.realm.schemas.account.v1.kv-store :as kv-store]
[status-im.data-store.realm.schemas.account.v1.message :as message]
[status-im.data-store.realm.schemas.account.v1.pending-message :as pending-message]
@ -16,7 +16,7 @@
chat-contact/schema
command/schema
contact/schema
discovery/schema
discover/schema
kv-store/schema
message/schema
pending-message/schema

View File

@ -5,7 +5,7 @@
[status-im.data-store.realm.schemas.account.v2.contact :as contact]
[status-im.data-store.realm.schemas.account.v1.chat-contact :as chat-contact]
[status-im.data-store.realm.schemas.account.v1.command :as command]
[status-im.data-store.realm.schemas.account.v1.discovery :as discovery]
[status-im.data-store.realm.schemas.account.v1.discover :as discover]
[status-im.data-store.realm.schemas.account.v1.kv-store :as kv-store]
[status-im.data-store.realm.schemas.account.v1.pending-message :as pending-message]
[status-im.data-store.realm.schemas.account.v1.request :as request]
@ -16,7 +16,7 @@
chat-contact/schema
command/schema
contact/schema
discovery/schema
discover/schema
kv-store/schema
message/schema
pending-message/schema

View File

@ -5,7 +5,7 @@
[status-im.data-store.realm.schemas.account.v2.contact :as contact]
[status-im.data-store.realm.schemas.account.v1.chat-contact :as chat-contact]
[status-im.data-store.realm.schemas.account.v1.command :as command]
[status-im.data-store.realm.schemas.account.v1.discovery :as discovery]
[status-im.data-store.realm.schemas.account.v1.discover :as discover]
[status-im.data-store.realm.schemas.account.v1.kv-store :as kv-store]
[status-im.data-store.realm.schemas.account.v1.pending-message :as pending-message]
[status-im.data-store.realm.schemas.account.v1.request :as request]
@ -16,7 +16,7 @@
chat-contact/schema
command/schema
contact/schema
discovery/schema
discover/schema
kv-store/schema
message/schema
pending-message/schema

View File

@ -5,7 +5,7 @@
[status-im.data-store.realm.schemas.account.v2.contact :as contact]
[status-im.data-store.realm.schemas.account.v1.chat-contact :as chat-contact]
[status-im.data-store.realm.schemas.account.v1.command :as command]
[status-im.data-store.realm.schemas.account.v5.discovery :as discovery]
[status-im.data-store.realm.schemas.account.v5.discover :as discover]
[status-im.data-store.realm.schemas.account.v1.kv-store :as kv-store]
[status-im.data-store.realm.schemas.account.v1.pending-message :as pending-message]
[status-im.data-store.realm.schemas.account.v1.request :as request]
@ -16,7 +16,7 @@
chat-contact/schema
command/schema
contact/schema
discovery/schema
discover/schema
kv-store/schema
message/schema
pending-message/schema

View File

@ -1,7 +1,7 @@
(ns status-im.data-store.realm.schemas.account.v5.discovery
(ns status-im.data-store.realm.schemas.account.v5.discover
(:require [taoensso.timbre :as log]))
(def schema {:name :discovery
(def schema {:name :discover
:primaryKey :message-id
:properties {:message-id "string"
:name {:type "string" :optional true}
@ -13,4 +13,4 @@
:created-at {:type "int" :default 0}}})
(defn migration [old-realm new-realm]
(log/debug "migrating discovery schema"))
(log/debug "migrating discover schema"))

View File

@ -20,7 +20,7 @@
:new-contact-identity ""
:contacts {}
:discoveries {}
:discovery-search-tags []
:discover-search-tags []
:tags {}
:chats {}

View File

@ -1,10 +1,10 @@
(ns status-im.discovery.handlers
(ns status-im.discover.handlers
(:require [re-frame.core :refer [after dispatch enrich]]
[status-im.utils.utils :refer [first-index]]
[status-im.utils.handlers :refer [register-handler get-hashtags]]
[status-im.protocol.core :as protocol]
[status-im.navigation.handlers :as nav]
[status-im.data-store.discovery :as discoveries]
[status-im.data-store.discover :as discoveries]
[status-im.utils.handlers :as u]
[status-im.utils.datetime :as time]
[status-im.utils.random :as random]))
@ -23,14 +23,14 @@
(or pending dapp?)))
(map :whisper-identity)))
(defmethod nav/preload-data! :discovery
(defmethod nav/preload-data! :discover
[db _]
(dispatch [:set :discovery-show-search? false])
(dispatch [:set :discover-show-search? false])
(-> db
(assoc :tags (discoveries/get-all-tags))
(assoc :discoveries (->> (discoveries/get-all :desc)
(map (fn [{:keys [message-id] :as discovery}]
[message-id discovery]))
(map (fn [{:keys [message-id] :as discover}]
[message-id discover]))
(into {})))))
(register-handler :broadcast-status
@ -59,14 +59,14 @@
(not (get discoveries (:message-id payload))))
(let [{:keys [message-id status hashtags profile]} payload
{:keys [name profile-image]} profile
discovery {:message-id message-id
discover {:message-id message-id
:name name
:photo-path profile-image
:status status
:whisper-id from
:tags (map #(hash-map :name %) hashtags)
:created-at (time/now-ms)}]
(dispatch [:add-discovery discovery]))))))
(dispatch [:add-discover discover]))))))
(register-handler :start-requesting-discoveries
(fn [{:keys [request-discoveries-timer] :as db}]
@ -108,31 +108,31 @@
(fn [{:keys [discoveries contacts]} [_ {:keys [payload from]}]]
(when (get contacts from)
(when-let [data (:data payload)]
(doseq [{:keys [message-id] :as discovery} data]
(doseq [{:keys [message-id] :as discover} data]
(when (and (not (discoveries/exists? message-id))
(not (get discoveries message-id)))
(let [discovery (assoc discovery :created-at (time/now-ms))]
(dispatch [:add-discovery discovery])))))))))
(let [discover (assoc discover :created-at (time/now-ms))]
(dispatch [:add-discover discover])))))))))
(defn add-discovery
[db [_ discovery]]
(assoc db :new-discovery discovery))
(defn add-discover
[db [_ discover]]
(assoc db :new-discover discover))
(defn save-discovery!
[{:keys [new-discovery]} _]
(discoveries/save new-discovery))
(defn save-discover!
[{:keys [new-discover]} _]
(discoveries/save new-discover))
(defn reload-tags!
[db _]
(assoc db :tags (discoveries/get-all-tags)
:discoveries (->> (discoveries/get-all :desc)
(map (fn [{:keys [message-id] :as discovery}]
[message-id discovery]))
(map (fn [{:keys [message-id] :as discover}]
[message-id discover]))
(into {}))))
(register-handler :add-discovery
(-> add-discovery
((after save-discovery!))
(register-handler :add-discover
(-> add-discover
((after save-discover!))
((enrich reload-tags!))))
(register-handler

View File

@ -1,4 +1,4 @@
(ns status-im.discovery.screen
(ns status-im.discover.screen
(:require-macros [status-im.utils.views :refer [defview]])
(:require
[re-frame.core :refer [dispatch subscribe]]
@ -10,12 +10,12 @@
icon]]
[status-im.components.toolbar.view :refer [toolbar]]
[status-im.components.drawer.view :refer [open-drawer]]
[status-im.discovery.styles :as st]
[status-im.discover.styles :as st]
[status-im.components.tabs.bottom-gradient :refer [bottom-gradient]]
[status-im.i18n :refer [label]]
[status-im.components.carousel.carousel :refer [carousel]]
[status-im.discovery.views.popular-list :refer [discovery-popular-list]]
[status-im.discovery.views.discovery-list-item :refer [discovery-list-item]]
[status-im.discover.views.popular-list :refer [discover-popular-list]]
[status-im.discover.views.discover-list-item :refer [discover-list-item]]
[status-im.contacts.styles :as contacts-styles]
[status-im.utils.platform :refer [platform-specific]]
[reagent.core :as r]))
@ -25,29 +25,29 @@
(or hashtags [])))
(defn title-content [show-search?]
[view st/discovery-toolbar-content
[view st/discover-toolbar-content
(if show-search?
[text-input {:style st/discovery-search-input
[text-input {:style st/discover-search-input
:auto-focus true
:placeholder (label :t/search-tags)
:on-blur (fn [e]
(dispatch [:set :discovery-show-search? false]))
(dispatch [:set :discover-show-search? false]))
:on-submit-editing (fn [e]
(let [search (aget e "nativeEvent" "text")
(let [search (aget e "nativeEvent" "text")
hashtags (get-hashtags search)]
(dispatch [:set :discovery-search-tags hashtags])
(dispatch [:navigate-to :discovery-search-results])))}]
(dispatch [:set :discover-search-tags hashtags])
(dispatch [:navigate-to :discover-search-results])))}]
[view
[text {:style st/discovery-title
[text {:style st/discover-title
:font :toolbar-title}
(label :t/discovery)]])])
(label :t/discover)]])])
(defn toogle-search [current-value]
(dispatch [:set :discovery-show-search? (not current-value)]))
(dispatch [:set :discover-show-search? (not current-value)]))
(defn discovery-toolbar [show-search?]
(defn discover-toolbar [show-search?]
[toolbar
{:style st/discovery-toolbar
{:style st/discover-toolbar
:nav-action {:image {:source {:uri :icon_hamburger}
:style st/hamburger-icon}
:handler open-drawer}
@ -58,13 +58,13 @@
(defn title [label-kw spacing?]
[view st/section-spacing
[text {:style (merge (get-in platform-specific [:component-styles :discovery :subtitle])
[text {:style (merge (get-in platform-specific [:component-styles :discover :subtitle])
(when spacing? {:margin-top 16}))
:uppercase? (get-in platform-specific [:discovery :uppercase-subtitles?])
:uppercase? (get-in platform-specific [:discover :uppercase-subtitles?])
:font :medium}
(label label-kw)]])
(defview discovery-popular [{:keys [contacts current-account]}]
(defview discover-popular [{:keys [contacts current-account]}]
[popular-tags [:get-popular-tags 10]]
[view st/popular-container
[title :t/popular-tags false]
@ -73,12 +73,12 @@
:gap 0
:sneak (if (> (count popular-tags) 1) 16 8)}
(for [{:keys [name]} popular-tags]
[discovery-popular-list {:tag name
:contacts contacts
:current-account current-account}])]
[discover-popular-list {:tag name
:contacts contacts
:current-account current-account}])]
[text (label :t/none)])])
(defview discovery-recent [{:keys [current-account]}]
(defview discover-recent [{:keys [current-account]}]
[discoveries [:get-recent-discoveries]]
(when (seq discoveries)
[view st/recent-container
@ -87,22 +87,22 @@
(let [discoveries (map-indexed vector discoveries)]
(for [[i {:keys [message-id] :as message}] discoveries]
^{:key (str "message-recent-" message-id)}
[discovery-list-item {:message message
:show-separator? (not= (inc i) (count discoveries))
:current-account current-account}]))]]))
[discover-list-item {:message message
:show-separator? (not= (inc i) (count discoveries))
:current-account current-account}]))]]))
(defview discovery [current-view?]
[show-search? [:get :discovery-show-search?]
(defview discover [current-view?]
[show-search? [:get :discover-show-search?]
contacts [:get :contacts]
current-account [:get-current-account]
discoveries [:get-recent-discoveries]]
[view st/discovery-container
[discovery-toolbar (and current-view? show-search?)]
[view st/discover-container
[discover-toolbar (and current-view? show-search?)]
(if discoveries
[scroll-view st/scroll-view-container
[discovery-popular {:contacts contacts
:current-account current-account}]
[discovery-recent {:current-account current-account}]]
[discover-popular {:contacts contacts
:current-account current-account}]
[discover-recent {:current-account current-account}]]
[view contacts-styles/empty-contact-groups
;; todo change icon
[icon :group_big contacts-styles/empty-contacts-icon]

View File

@ -1,4 +1,4 @@
(ns status-im.discovery.search-results
(ns status-im.discover.search-results
(:require-macros [status-im.utils.views :refer [defview]])
(:require [re-frame.core :refer [subscribe dispatch]]
[status-im.utils.listview :refer [to-datasource]]
@ -11,8 +11,8 @@
scroll-view]]
[status-im.i18n :refer [label]]
[status-im.components.toolbar.view :refer [toolbar]]
[status-im.discovery.views.discovery-list-item :refer [discovery-list-item]]
[status-im.discovery.styles :as st]
[status-im.discover.views.discover-list-item :refer [discover-list-item]]
[status-im.discover.styles :as st]
[status-im.utils.platform :refer [platform-specific]]
[status-im.contacts.styles :as contacts-styles]
[taoensso.timbre :as log]))
@ -29,25 +29,25 @@
[view st/tag-title-container
(for [tag (take 3 tags)]
^{:key (str "tag-" tag)}
[view (merge (get-in platform-specific [:component-styles :discovery :tag])
[view (merge (get-in platform-specific [:component-styles :discover :tag])
{:margin-left 2 :margin-right 2})
[text {:style st/tag-title
:font :default}
(str " #" tag)]])]])
(defview discovery-search-results []
(defview discover-search-results []
[discoveries [:get-popular-discoveries 250]
tags [:get :discovery-search-tags]
tags [:get :discover-search-tags]
current-account [:get-current-account]]
(let [discoveries (:discoveries discoveries)
datasource (to-datasource discoveries)]
[view st/discovery-tag-container
[view st/discover-tag-container
[status-bar]
[toolbar {:nav-action {:image {:source {:uri :icon_back}
:style st/icon-back}
:handler #(dispatch [:navigate-back])}
:custom-content (title-content tags)
:style st/discovery-tag-toolbar}]
:style st/discover-tag-toolbar}]
(if (empty? discoveries)
[view st/empty-view
;; todo change icon
@ -56,7 +56,7 @@
(label :t/no-statuses-found)]]
[list-view {:dataSource datasource
:renderRow (fn [row _ _]
(list-item [discovery-list-item {:message row
(list-item [discover-list-item {:message row
:current-account current-account}]))
:renderSeparator render-separator
:style st/recent-list}])]))

View File

@ -1,4 +1,4 @@
(ns status-im.discovery.styles
(ns status-im.discover.styles
(:require [status-im.components.styles :refer [color-gray2
color-white]]
[status-im.components.toolbar.styles :refer [toolbar-background2]]))
@ -24,23 +24,23 @@
;; Toolbar
(def discovery-toolbar-content
(def discover-toolbar-content
{:flex 1
:align-items :center
:justify-content :center})
(def discovery-toolbar
(def discover-toolbar
{:background-color toolbar-background2
:elevation 0})
(def discovery-search-input
(def discover-search-input
{:flex 1
:align-self "stretch"
:margin-left 18
:font-size 14
:color "#7099e6"})
(def discovery-title
(def discover-title
{:color "#000000de"
:align-self :center
:text-align :center
@ -117,7 +117,7 @@
:align-items :center
:padding-top 16})
;; discovery_recent
;; discover_recent
(def recent-container
{:background-color toolbar-background2})
@ -126,13 +126,13 @@
{:background-color :white
:padding-left 16})
;; Discovery tag
;; Discover tag
(def discovery-tag-toolbar
(def discover-tag-toolbar
{:border-bottom-color "#D7D7D7"
:border-bottom-width 1})
(def discovery-tag-container
(def discover-tag-container
{:flex 1
:backgroundColor "#eef2f5"})
@ -161,7 +161,7 @@
{:width 17
:height 17})
(def discovery-container
(def discover-container
{:flex 1
:backgroundColor color-white})

View File

@ -1,4 +1,4 @@
(ns status-im.discovery.subs
(ns status-im.discover.subs
(:require-macros [reagent.ratom :refer [reaction]])
(:require [re-frame.core :refer [register-sub]]
[status-im.utils.datetime :as time]))
@ -27,7 +27,7 @@
(fn [db [_ limit tags]]
(let [discoveries (reaction (:discoveries @db))
current-tag (reaction (:current-tag @db))
search-tags (reaction (:discovery-search-tags @db))
search-tags (reaction (:discover-search-tags @db))
discoveries (->> (get-discoveries-by-tags @discoveries @current-tag (or tags @search-tags))
(map #(assoc % :priority (calculate-priority db %)))
(sort-by :priority >))]
@ -45,10 +45,10 @@
(-> (take limit (:tags @db))
(reaction))))
(register-sub :get-discovery-search-results
(register-sub :get-discover-search-results
(fn [db _]
(let [discoveries (reaction (:discoveries @db))
current-tag (reaction (:current-tag @db))
tags (reaction (:discovery-search-tags @db))]
tags (reaction (:discover-search-tags @db))]
(-> (get-discoveries-by-tags @discoveries @current-tag @tags)
(reaction)))))

View File

@ -1,16 +1,16 @@
(ns status-im.discovery.views.discovery-list-item
(ns status-im.discover.views.discover-list-item
(:require-macros [status-im.utils.views :refer [defview]])
(:require [re-frame.core :refer [subscribe dispatch]]
[clojure.string :as str]
[status-im.components.react :refer [view text touchable-highlight]]
[status-im.discovery.styles :as st]
[status-im.components.react :refer [view text image touchable-highlight]]
[status-im.discover.styles :as st]
[status-im.components.status-view.view :refer [status-view]]
[status-im.utils.gfycat.core :refer [generate-gfy]]
[status-im.utils.identicon :refer [identicon]]
[status-im.components.chat-icon.screen :as ci]
[status-im.utils.platform :refer [platform-specific]]))
(defview discovery-list-item [{{:keys [name
(defview discover-list-item [{{:keys [name
photo-path
whisper-id
message-id
@ -23,7 +23,7 @@
:as current-account} :current-account}]
[{contact-name :name
contact-photo-path :photo-path} [:get-in [:contacts whisper-id]]]
(let [item-style (get-in platform-specific [:component-styles :discovery :item])]
(let [item-style (get-in platform-specific [:component-styles :discover :item])]
[view
[view st/popular-list-item
[view st/popular-list-item-name-container

View File

@ -1,4 +1,4 @@
(ns status-im.discovery.views.popular-list
(ns status-im.discover.views.popular-list
(:require-macros [status-im.utils.views :refer [defview]])
(:require
[re-frame.core :refer [subscribe dispatch]]
@ -7,19 +7,19 @@
list-item
touchable-highlight
text]]
[status-im.discovery.styles :as st]
[status-im.discover.styles :as st]
[status-im.utils.listview :refer [to-datasource]]
[status-im.discovery.views.discovery-list-item :refer [discovery-list-item]]
[status-im.discover.views.discover-list-item :refer [discover-list-item]]
[status-im.utils.platform :refer [platform-specific]]))
(defview discovery-popular-list [{:keys [tag contacts current-account]}]
(defview discover-popular-list [{:keys [tag contacts current-account]}]
[discoveries [:get-popular-discoveries 3 [tag]]]
[view (merge st/popular-list-container
(get-in platform-specific [:component-styles :discovery :popular]))
(get-in platform-specific [:component-styles :discover :popular]))
[view st/row
[view (get-in platform-specific [:component-styles :discovery :tag])
[touchable-highlight {:on-press #(do (dispatch [:set :discovery-search-tags [tag]])
(dispatch [:navigate-to :discovery-search-results]))}
[view (get-in platform-specific [:component-styles :discover :tag])
[touchable-highlight {:on-press #(do (dispatch [:set :discover-search-tags [tag]])
(dispatch [:navigate-to :discover-search-results]))}
[view
[text {:style st/tag-name
:font :medium}
@ -29,8 +29,8 @@
:font :default}
(:total discoveries)]]]
(let [discoveries (map-indexed vector (:discoveries discoveries))]
(for [[i {:keys [message-id] :as discovery}] discoveries]
(for [[i {:keys [message-id] :as discover}] discoveries]
^{:key (str "message-popular-" message-id)}
[discovery-list-item {:message discovery
[discover-list-item {:message discover
:show-separator? (not= (inc i) (count discoveries))
:current-account current-account}]))])

View File

@ -11,7 +11,7 @@
status-im.group-settings.handlers
status-im.navigation.handlers
status-im.contacts.handlers
status-im.discovery.handlers
status-im.discover.handlers
status-im.new-group.handlers
status-im.participants.handlers
status-im.profile.handlers

View File

@ -13,7 +13,7 @@
[status-im.contacts.views.contact-list :refer [contact-list]]
[status-im.contacts.views.new-contact :refer [new-contact]]
[status-im.qr-scanner.screen :refer [qr-scanner]]
[status-im.discovery.search-results :refer [discovery-search-results]]
[status-im.discover.search-results :refer [discover-search-results]]
[status-im.chat.screen :refer [chat]]
[status-im.accounts.login.screen :refer [login]]
[status-im.accounts.screen :refer [accounts]]
@ -72,8 +72,8 @@
(when @view-id
(let [current-view (validate-current-view @view-id @signed-up?)]
(let [component (case current-view
:discovery main-tabs
:discovery-search-results discovery-search-results
:discover main-tabs
:discover-search-results discover-search-results
:add-participants new-participants
:remove-participants remove-participants
:chat-list main-tabs

View File

@ -24,7 +24,7 @@
:border-bottom-width 0.5}
:chat {:new-message {:border-top-color styles/color-gray3
:border-top-width 0.5}}
:discovery {:subtitle {:color styles/color-steel
:discover {:subtitle {:color styles/color-steel
:font-size 13
:letter-spacing 1}
:popular {:border-radius 3
@ -88,5 +88,5 @@
:new-contact-in-toolbar? true
:uppercase-subtitles? true
:group-block-shadows? false}
:discovery {:uppercase-subtitles? true}})
:discover {:uppercase-subtitles? true}})

View File

@ -9,11 +9,11 @@
[status-im.protocol.validation :refer-macros [valid?]]
[status-im.utils.random :as random]))
(def discovery-topic-prefix "status-discovery-")
(def discovery-hashtag-prefix "status-hashtag-")
(def discover-topic-prefix "status-discover-")
(def discover-hashtag-prefix "status-hashtag-")
(defn- make-discovery-topic [identity]
(str discovery-topic-prefix identity))
(defn- make-discover-topic [identity]
(str discover-topic-prefix identity))
(s/def :send-online/message
(s/merge :protocol/message
@ -30,7 +30,7 @@
{:requires-ack? false
:type :online
:payload {:timestamp (u/timestamp)}
:topics [(make-discovery-topic (:from message))]})]
:topics [(make-discover-topic (:from message))]})]
(d/add-pending-message! web3 message')))
(s/def ::identity :message/from)
@ -43,7 +43,7 @@
(f/add-filter!
web3
{:from identity
:topics [(make-discovery-topic identity)]}
:topics [(make-discover-topic identity)]}
(l/message-listener (dissoc options :identity))))
(s/def :contact-request/contact map?)
@ -92,7 +92,7 @@
web3
(-> message
(assoc :type :profile
:topics [(make-discovery-topic (:from message))])
:topics [(make-discover-topic (:from message))])
(assoc-in [:payload :timestamp] (u/timestamp))
(assoc-in [:payload :content :profile]
(get-in message [:payload :profile]))
@ -109,8 +109,8 @@
[{:keys [web3 message]}]
(debug :broadcasting-status)
(let [message (-> message
(assoc :type :discovery
:topics [(make-discovery-topic (:from message))]))]
(assoc :type :discover
:topics [(make-discover-topic (:from message))]))]
(d/add-pending-message! web3 message)))
(defn send-discoveries-request!
@ -120,7 +120,7 @@
web3
(-> message
(assoc :type :discoveries-request
:topics [(make-discovery-topic (:from message))]))))
:topics [(make-discover-topic (:from message))]))))
(defn send-discoveries-response!
[{:keys [web3 discoveries message]}]
@ -131,6 +131,6 @@
web3
(-> message
(assoc :type :discoveries-response
:topics [(make-discovery-topic (:from message))]
:topics [(make-discover-topic (:from message))]
:message-id (random/id)
:payload {:data (into [] portion)})))))

View File

@ -86,7 +86,7 @@
:add-group-identity (dispatch [:participant-invited-to-group message])
:leave-group (dispatch [:participant-left-group message])
:contact-request (dispatch [:contact-request-received message])
:discovery (dispatch [:status-received message])
:discover (dispatch [:status-received message])
:discoveries-request (dispatch [:discoveries-request-received message])
:discoveries-response (dispatch [:discoveries-response-received message])
:profile (dispatch [:contact-update-received message])

View File

@ -41,7 +41,7 @@
(when (or (not= (i/normalize-hex identity)
(i/normalize-hex from))
;; allow user to receive his own discoveries
(= type :discovery))
(= type :discover))
(let [content (parse-content (:private keypair) payload' (not= "0x0" to))
payload'' (assoc payload' :content content)

View File

@ -22,11 +22,11 @@
#{:group-message :group-invitation :add-group-identity
:remove-group-identity :leave-group :update-group})
(s/def :discovery-message/type #{:online :status :discovery :contact-request})
(s/def :discover-message/type #{:online :status :discover :contact-request})
(s/def :message/type
(s/or :group :group-message/type
:discovery :discovery-message/type
:discover :discover-message/type
:user #{:message}))
(s/def :message/payload

View File

@ -3,7 +3,7 @@
(:require [re-frame.core :refer [register-sub subscribe]]
status-im.chat.subs
status-im.group-settings.subs
status-im.discovery.subs
status-im.discover.subs
status-im.contacts.subs
status-im.new-group.subs
status-im.participants.subs

View File

@ -99,7 +99,7 @@
:new-group-chat "Nuwe groepgeselsie"
;discover
:discovery "Ontdekking"
:discover "Ontdekking"
:none "Geen"
:search-tags "Tik jou soek-oortjies hier in"
:popular-tags "Gewilde oortjies"

View File

@ -99,7 +99,7 @@
:new-group-chat "مجموعة دردشة جديدة"
;discover
:discovery "اكتشاف"
:discover "اكتشاف"
:none "لا شيء"
:search-tags "اكتب بيانات بحثك هنا"
:popular-tags "العلامات المشهورة"

View File

@ -99,7 +99,7 @@
:new-group-chat "Neuer Gruppenchat"
;discover
:discovery "Entdeckung"
:discover "Entdeckung"
:none "Nichts"
:search-tags "Geben Sie Ihre Suchbegriffe hier ein"
:popular-tags "Beliebte Begriffe"

View File

@ -99,7 +99,7 @@
:new-group-chat "Neuer Gruppenchat"
;discover
:discovery "Entdeckung"
:discover "Entdeckung"
:none "Keine"
:search-tags "Gebe hier deine Suchbegriffe ein"
:popular-tags "Beliebte Suchbegriffe"

View File

@ -106,7 +106,8 @@
:new-group-chat "New group chat"
;discover
:discovery "Discover"
:discover "Discover"
:none "None"
:search-tags "Type your search tags here"
:popular-tags "Popular tags"

View File

@ -104,7 +104,7 @@
:new-group-chat "Un nuevo grupo de chat"
;discover
:discovery "Descubrir"
:discover "Descubrir"
:none "Ninguno"
:search-tags "Escribe tus etiquetas de búsqueda aquí"
:popular-tags "Etiquetas populares"

View File

@ -104,7 +104,7 @@
:new-group-chat "Nuevo chat de grupo"
;discover
:discovery "Descubrimiento"
:discover "Descubrimiento"
:none "Ninguno"
:search-tags "Ingresa aquí tus etiquetas de búsqueda"
:popular-tags "Etiquetas populares"

View File

@ -99,7 +99,7 @@
:new-group-chat "Nouveau chat de groupe"
;discover
:discovery "Découverte"
:discover "Découverte"
:none "Aucun"
:search-tags "Entrez vos mots clés de"
:popular-tags "Mots-clés populaires"

View File

@ -99,7 +99,7 @@
:new-group-chat "Nouveau chat de groupe"
;discover
:discovery "Découverte"
:discover "Découverte"
:none "Aucun"
:search-tags "Tapez vos clés de recherche ici"
:popular-tags "Clés populaires"

View File

@ -99,7 +99,7 @@
:new-group-chat "नई ग्रुप चैट"
;discover
:discovery "खोज"
:discover "खोज"
:none "कोई नहीं"
:search-tags "अपने खोज टैग यहां टाइप करें"
:popular-tags "लोकप्रिय टैग"

View File

@ -99,7 +99,7 @@
:new-group-chat "Új csoportos csevegés"
;discover
:discovery "Felfedezés"
:discover "Felfedezés"
:none "Semmi"
:search-tags "Add meg keresési címkéidet itt"
:popular-tags "Népszerű címkék"

View File

@ -99,7 +99,7 @@
:new-group-chat "Nuova chat di gruppo"
;discover
:discovery "Scopri"
:discover "Scopri"
:none "Nessuno"
:search-tags "Digita qui le tue etichette di ricerca"
:popular-tags "Tag popolari"

View File

@ -99,7 +99,7 @@
:new-group-chat "Nuova conversazione di gruppo"
;discover
:discovery "Scoperta"
:discover "Scoperta"
:none "Nessuna"
:search-tags "Inserisci qui i tag di ricerca"
:popular-tags "Tag popolari"

View File

@ -99,7 +99,7 @@
:new-group-chat "新規グループチャット"
;discover
:discovery "発見"
:discover "発見"
:none "なし"
:search-tags "ここに検索タグを入力してください"
:popular-tags "人気のタグ"

View File

@ -99,7 +99,7 @@
:new-group-chat "새 그룹 채팅"
;discover
:discovery "발견"
:discover "발견"
:none "없음"
:search-tags "여기에 검색 태그를 입력하세요"
:popular-tags "인기 태그"

View File

@ -99,7 +99,7 @@
:new-group-chat "Nieuwe groepchat"
;discover
:discovery "Ontdekking"
:discover "Ontdekking"
:none "Geen"
:search-tags "Typ hier jouw zoektags"
:popular-tags "Populaire tags"

View File

@ -99,7 +99,7 @@
:new-group-chat "Nowy czat grupowy"
;discover
:discovery "Odkryte"
:discover "Odkryte"
:none "Brak"
:search-tags "Tutaj wpisz swoje tagi wyszukiwania"
:popular-tags "Popularne tagi"

View File

@ -99,7 +99,7 @@
:new-group-chat "Novo bate-papo em grupo"
;discover
:discovery "Descoberta"
:discover "Descoberta"
:none "Nenhum(a)"
:search-tags "Digite suas tags de pesquisa aqui"
:popular-tags "Tags populares"

View File

@ -99,7 +99,7 @@
:new-group-chat "Novo chat em grupo"
;discover
:discovery "Descoberta"
:discover "Descoberta"
:none "Nenhum"
:search-tags "Digite aqui os seus tags de pesquisa"
:popular-tags "Tags populares"

View File

@ -99,7 +99,7 @@
:new-group-chat "Grup nou de chat"
;discover
:discovery "Descoperire"
:discover "Descoperire"
:none "Niciuna"
:search-tags "Tastează aici etichetele de căutat"
:popular-tags "Etichete populare"

View File

@ -106,7 +106,7 @@
:new-group-chat "Новый групповой чат"
;discover
:discovery "Поиск"
:discover "Поиск"
:none "Нет"
:search-tags "Введите теги для поиска сюда"
:popular-tags "Популярные теги"

View File

@ -99,7 +99,7 @@
:new-group-chat "Nov skupinski klepet"
;discover
:discovery "Odkrivanje"
:discover "Odkrivanje"
:none "Brez"
:search-tags "Sem vnesi svoje priljubljene oznake"
:popular-tags "Priljubljene oznake"

View File

@ -99,7 +99,7 @@
:new-group-chat "Ny gruppchatt"
;discover
:discovery "Upptäckt"
:discover "Upptäckt"
:none "Inga"
:search-tags "Skriv dina söktaggar här"
:popular-tags "Populära taggar"

View File

@ -104,7 +104,7 @@
:new-group-chat "Gumzo mpya ya kikundi"
;discover
:discovery "Ugunduzi"
:discover "Ugunduzi"
:none "Hakuna"
:search-tags "Andika vitambulisho vyako vya kutafuta hapa"
:popular-tags "Vitambulisho maarufu"

View File

@ -99,7 +99,7 @@
:new-group-chat "แชทกลุ่มใหม่"
;discover
:discovery "การค้นพบ"
:discover "การค้นพบ"
:none "ไม่มี"
:search-tags "พิมพ์แท็กการค้นหาของคุณที่นี่"
:popular-tags "แท็กยอดนิยม"

View File

@ -99,7 +99,7 @@
:new-group-chat "Yeni grup sohbeti"
;discover
:discovery "Keşfet"
:discover "Keşfet"
:none "Hiçbiri"
:search-tags "Arama etiketlerinizi buraya girin"
:popular-tags "Popüler etiketler"

View File

@ -104,7 +104,7 @@
:new-group-chat "Новий груповий чат"
;discover
:discovery "Відкриття"
:discover "Відкриття"
:none "Жоден"
:search-tags "Введіть теги для пошуку тут"
:popular-tags "Популярні теги"

View File

@ -99,7 +99,7 @@
:new-group-chat "نئی گروپ چیٹ"
;discover
:discovery "دریافت"
:discover "دریافت"
:none "کوئی نہیں"
:search-tags "اپنا تلاش کا ٹیگ یہاں درج کریں"
:popular-tags "مشہور ٹیگ"

View File

@ -99,7 +99,7 @@
:new-group-chat "Cuộc trò chuyện theo nhóm mới"
;discover
:discovery "Khám phá"
:discover "Khám phá"
:none "Không"
:search-tags "Gõ các thẻ tìm kiếm của bạn tại đây"
:popular-tags "Các thẻ phổ biến"

View File

@ -99,7 +99,7 @@
:new-group-chat "新的群聊"
;discover
:discovery "发现"
:discover "发现"
:none "无"
:search-tags "在此处输入搜索标签"
:popular-tags "热门标签"

View File

@ -99,7 +99,7 @@
:new-group-chat "新的群聊"
;discover
:discovery "發現"
:discover "發現"
:none "無"
:search-tags "在這裡鍵入您的搜尋標籤"
:popular-tags "熱門標籤"

View File

@ -99,7 +99,7 @@
:new-group-chat "新的群聊"
;discover
:discovery "发现"
:discover "发现"
:none "无"
:search-tags "在这里键入您的搜索标签"
:popular-tags "热门标签"

View File

@ -99,7 +99,7 @@
:new-group-chat "新增群聊"
;discover
:discovery "新發現"
:discover "新發現"
:none "不存在"
:search-tags "請輸入你的搜索標籤"
:popular-tags "熱門標籤"