mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 08:16:10 +02:00
Cosmetic improvement to app main component.
This commit is contained in:
parent
130895f2c3
commit
632fccec5d
1 changed files with 12 additions and 20 deletions
|
@ -74,8 +74,16 @@
|
||||||
|
|
||||||
;; --- Main App (Component)
|
;; --- Main App (Component)
|
||||||
|
|
||||||
(defn app-render
|
(defn app-will-mount
|
||||||
[own]
|
[own]
|
||||||
|
(when @st/auth-ref
|
||||||
|
(rs/emit! (udu/fetch-profile)))
|
||||||
|
own)
|
||||||
|
|
||||||
|
(mx/defc app
|
||||||
|
{:will-mount app-will-mount
|
||||||
|
:mixins [mx/reactive]}
|
||||||
|
[]
|
||||||
(let [route (mx/react route-ref)
|
(let [route (mx/react route-ref)
|
||||||
auth (mx/react st/auth-ref)
|
auth (mx/react st/auth-ref)
|
||||||
location (:id route)
|
location (:id route)
|
||||||
|
@ -101,19 +109,6 @@
|
||||||
nil
|
nil
|
||||||
))))
|
))))
|
||||||
|
|
||||||
(defn app-will-mount
|
|
||||||
[own]
|
|
||||||
(when @st/auth-ref
|
|
||||||
(rs/emit! (udu/fetch-profile)))
|
|
||||||
own)
|
|
||||||
|
|
||||||
(def app
|
|
||||||
(mx/component
|
|
||||||
{:render app-render
|
|
||||||
:will-mount app-will-mount
|
|
||||||
:mixins [mx/reactive]
|
|
||||||
:name "app"}))
|
|
||||||
|
|
||||||
;; --- Routes
|
;; --- Routes
|
||||||
|
|
||||||
(def routes
|
(def routes
|
||||||
|
@ -137,9 +132,6 @@
|
||||||
|
|
||||||
(defn init
|
(defn init
|
||||||
[]
|
[]
|
||||||
(let [app-dom (gdom/getElement "app")
|
(mx/mount (app) (dom/get-element "app"))
|
||||||
lightbox-dom (gdom/getElement "lightbox")
|
(mx/mount (lightbox) (dom/get-element "lightbox"))
|
||||||
loader-dom (gdom/getElement "loader")]
|
(mx/mount (loader) (dom/get-element "loader")))
|
||||||
(rum/mount (app) app-dom)
|
|
||||||
(rum/mount (lightbox) lightbox-dom)
|
|
||||||
(rum/mount (loader) loader-dom)))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue