Remove all usage of mx/component and replace that with rumext.

This commit is contained in:
Andrey Antukh 2017-04-08 18:30:03 +02:00
parent 491d91b1ee
commit 671c2d912c
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
78 changed files with 328 additions and 503 deletions

View file

@ -1,13 +1,11 @@
(ns uxbox.main.ui.lightbox
(:require [sablono.core :as html :refer-macros [html]]
[rum.core :as rum]
[lentes.core :as l]
(:require [lentes.core :as l]
[uxbox.main.store :as st]
[uxbox.main.data.lightbox :as udl]
[uxbox.util.mixins :as mx :include-macros true]
[rumext.core :as mx :include-macros true]
[uxbox.main.ui.keyboard :as k]
[uxbox.util.dom :as dom]
[uxbox.util.data :refer (classnames)]
[uxbox.util.data :refer [classnames]]
[goog.events :as events])
(:import goog.events.EventType))
@ -47,23 +45,17 @@
(events/unlistenByKey (::key own))
(dissoc own ::key))
(defn- lightbox-render
(mx/defcs lightbox
{:mixins [mx/reactive]
:will-mount lightbox-will-mount
:will-unmount lightbox-will-umount}
[own]
(let [data (mx/react lightbox-ref)
classes (classnames
:hide (nil? data)
:transparent (:transparent? data))]
(html
[:div.lightbox
{:class classes
:ref "parent"
:on-click (partial on-out-clicked own)}
(render-lightbox data)])))
(def lightbox
(mx/component
{:name "lightbox"
:render lightbox-render
:will-mount lightbox-will-mount
:will-unmount lightbox-will-umount
:mixins [mx/reactive]}))
[:div.lightbox
{:class classes
:ref "parent"
:on-click (partial on-out-clicked own)}
(render-lightbox data)]))