 ;; UI
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defmulti render-lightbox identity)
+(defmulti render-lightbox :name)
 (defmethod render-lightbox :default [_] nil)
 
 (defn- on-esc-clicked

    (close!)))

(defn- lightbox-will-mount
  [state]
  (events/listen js/document
                 EventType.KEYDOWN
                 on-esc-clicked)
  state)

(defn- lightbox-will-umount
  [state]
  (events/unlisten js/document
                   EventType.KEYDOWN
                   on-esc-clicked)
  state)

(defn- lightbox-render
  [own]
  (let [name (rum/react +current+)]
    (html
     [:div.lightbox {:class (when (nil? name) "hide")}
      (render-lightbox name)])))

(def ^:static lightbox
  (util/component
   {:name "lightbox"
    :render lightbox-render
    :will-mount lightbox-will-mount
    :will-unmount lightbox-will-umount
    :mixins [rum/reactive]}))


(defonce +current+ (atom nil))

(defn open!
  ([kind]
   (open! kind nil))
  ([kind params]
   (reset! +current+ (merge {:name kind} params))))

(defn close!
  []
