0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00
penpot/frontend/uxbox/ui.cljs
Andrey Antukh 7b8f241d41 WIP:
2015-12-30 00:19:46 +02:00

32 lines
916 B
Clojure

(ns uxbox.ui
(:require [rum.core :as rum]
[cats.labs.lens :as l]
[uxbox.state :as s]
[uxbox.util :as util]
[uxbox.ui.users :as ui.u]
[uxbox.ui.dashboard :as ui.d]))
(def ^:private ^:static state
(as-> (l/select-keys [:location :location-params]) $
(l/focus-atom $ s/state)))
(defn app-render
[own]
(let [{:keys [location location-params] :as state} (rum/react state)]
(case location
:auth/login (ui.u/login)
;; :auth/register (u/register)
;; :auth/recover (u/recover-password)
:main/dashboard (ui.d/dashboard)
;; :main/project (w/workspace conn location-params)
;; :main/page (w/workspace conn location-params))))
nil
)))
(def app
(util/component {:render app-render
:mixins [rum/reactive]
:name "app"}))
(defn mount!
[el]
(rum/mount (app) el))