Give all components a :display-name.
Make sure components use :reagent-render.
This commit is contained in:
parent
9e73097446
commit
646f61a406
|
@ -116,7 +116,8 @@
|
|||
(fn []
|
||||
(.stop http-bridge)
|
||||
(.removeEventListener app-state "change" app-state-change-handler))
|
||||
:render
|
||||
:display-name "root"
|
||||
:reagent-render
|
||||
(fn []
|
||||
(when @view-id
|
||||
(let [current-view (validate-current-view @view-id @signed-up?)]
|
||||
|
|
|
@ -76,7 +76,8 @@
|
|||
result (reaction (when @geolocation (get-places (:coords @geolocation) cur-loc-geocoded)))]
|
||||
(r/create-class
|
||||
{:component-will-mount #(dispatch [:request-geolocation-update])
|
||||
:render
|
||||
:display-name "current-location-view"
|
||||
:reagent-render
|
||||
(fn []
|
||||
(let [_ @result]
|
||||
(when (and @cur-loc-geocoded (> (count (:features @cur-loc-geocoded)) 0))
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
(r/create-class
|
||||
{:component-did-update
|
||||
on-update
|
||||
:display-name "container"
|
||||
:reagent-render
|
||||
(fn [height & children]
|
||||
[animated-view {:style (st/bottom-info-container height)}
|
||||
|
@ -69,7 +70,8 @@
|
|||
(let [bottom-info (subscribe [:chat-ui-props :bottom-info])
|
||||
contacts (subscribe [:get-contacts])]
|
||||
(r/create-class
|
||||
{:reagent-render
|
||||
{:display-name "bottom-info-view"
|
||||
:reagent-render
|
||||
(fn []
|
||||
(let [{:keys [user-statuses message-status participants]} @bottom-info
|
||||
participants (->> participants
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
(if height
|
||||
(dispatch [:set-expandable-height key height])
|
||||
(dispatch [:choose-predefined-expandable-height key :default])))
|
||||
:display-name "expandable-view"
|
||||
:reagent-render
|
||||
(fn [{:keys [draggable? custom-header]} & elements]
|
||||
@to-changed-height @changes-counter @max-height
|
||||
|
|
|
@ -180,7 +180,8 @@
|
|||
set-container-width-fn #(r/set-state component {:container-width %})
|
||||
command (subscribe [:selected-chat-command])]
|
||||
(r/create-class
|
||||
{:reagent-render
|
||||
{:display-name "input-view"
|
||||
:reagent-render
|
||||
(fn [{:keys [anim-margin single-line-input?]}]
|
||||
(let [{:keys [width height container-width]} (r/state component)
|
||||
command @command]
|
||||
|
@ -246,7 +247,8 @@
|
|||
container-anim-margin (anim/create-value 16)
|
||||
bottom-anim-margin (anim/create-value 14)]
|
||||
(r/create-class
|
||||
{:component-did-mount
|
||||
{:display-name "input-container"
|
||||
:component-did-mount
|
||||
(fn []
|
||||
(when-not (str/blank? @input-text)
|
||||
(.setValue anim-margin 0)
|
||||
|
|
|
@ -371,6 +371,7 @@
|
|||
(r/create-class
|
||||
{:component-did-update
|
||||
on-update
|
||||
:display-name "message-container"
|
||||
:reagent-render
|
||||
(fn [_ & children]
|
||||
@layout-height
|
||||
|
@ -387,7 +388,8 @@
|
|||
status (subscribe [:get-in [:message-data :user-statuses message-id my-identity]])
|
||||
preview (subscribe [:get-in [:message-data :preview message-id :markup]])]
|
||||
(r/create-class
|
||||
{:component-will-mount
|
||||
{:display-name "chat-message"
|
||||
:component-will-mount
|
||||
(fn []
|
||||
(let [{:keys [bot command] :as content} (get-in message [:content])
|
||||
message' (assoc message :jail-id bot)]
|
||||
|
|
|
@ -50,7 +50,8 @@
|
|||
:answered? answered?
|
||||
:loop? loop?}]
|
||||
(r/create-class
|
||||
{:component-did-mount
|
||||
{:display-name "request-button"
|
||||
:component-did-mount
|
||||
(if @answered? (fn []) #(request-button-animation-logic context))
|
||||
:component-will-unmount
|
||||
#(reset! loop? false)
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
(let [message (subscribe [:get-last-message chat-id])
|
||||
preview (subscribe [:get-last-message-short-preview chat-id])]
|
||||
(r/create-class
|
||||
{:component-will-mount
|
||||
{:display-name "message-content-text"
|
||||
:component-will-mount
|
||||
(fn []
|
||||
(when (and (get-in @message [:content :command])
|
||||
(not @preview))
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
(let [to (scroll-to @prev-view-id @view-id)]
|
||||
(a/put! scroll-start [@main-swiper to]))))
|
||||
(reset! tabs-were-hidden? @tabs-hidden?))
|
||||
:display-name "main-tabs"
|
||||
:reagent-render
|
||||
(fn []
|
||||
[view common-st/flex
|
||||
|
|
|
@ -105,6 +105,7 @@
|
|||
on-update
|
||||
:component-did-update
|
||||
on-update
|
||||
:display-name "sync-state-gradient-view"
|
||||
:reagent-render
|
||||
(fn []
|
||||
[view st/sync-style-gradient
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
on-update
|
||||
:component-did-update
|
||||
on-update
|
||||
:display-name "offline-view"
|
||||
:reagent-render
|
||||
(fn [{:keys [top]}]
|
||||
(when (or (= @network-status :offline) (= @sync-state :offline))
|
||||
|
|
|
@ -86,7 +86,8 @@
|
|||
:component-will-unmount
|
||||
(fn []
|
||||
(.stop http-bridge))
|
||||
:render
|
||||
:display-name "root"
|
||||
:reagent-render
|
||||
(fn []
|
||||
(when @view-id
|
||||
(let [current-view (validate-current-view @view-id @signed-up?)]
|
||||
|
|
|
@ -58,7 +58,8 @@
|
|||
(let [~@vars-bindings]
|
||||
(apply ~f ~args)))])))
|
||||
(into {}))
|
||||
{:reagent-render
|
||||
{:display-name (name '~n)
|
||||
:reagent-render
|
||||
(fn ~params
|
||||
(let [~@vars-bindings]
|
||||
~body))}))))))
|
||||
|
|
Loading…
Reference in New Issue