 ;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
 
 (ns uxbox.view.ui
-  (:require [sablono.core :refer-macros [html]]
-            [goog.dom :as gdom]
-            [lentes.core :as l]
-            [rum.core :as rum]
+  (:require [lentes.core :as l]
             [uxbox.util.i18n :refer (tr)]
             [uxbox.util.rstore :as rs]
             [uxbox.util.router :as rt]
             [uxbox.util.mixins :as mx]
-            [uxbox.util.data :refer (parse-int)]
+            [uxbox.util.dom :as dom]
             [uxbox.main.ui.loader :refer (loader)]
             [uxbox.main.ui.lightbox :refer (lightbox)]
             [uxbox.main.state :as st]


;; --- Main App (Component)

(defn app-render
  [own]
  (let [location (mx/react route-id-ref)]
    (case location
      :view/notfound (notfound-page)
      :view/viewer (viewer-page)
      nil)))

(def app
  (mx/component
   {:render app-render
    :name "app"
    :mixins [mx/static mx/reactive]}))

;; --- Routes



(defn init
  []
  (mx/mount (app) (dom/get-element "app"))
  (mx/mount (lightbox) (dom/get-element "lightbox"))
  (mx/mount (loader) (dom/get-element "loader")))
