mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 15:36:11 +02:00
✨ Adapt code to rumext changes.
This commit is contained in:
parent
247be4a8a4
commit
176ca590e1
8 changed files with 15 additions and 22 deletions
|
@ -57,9 +57,8 @@
|
|||
" the projects will be periodicaly wiped."]])
|
||||
|
||||
(mf/defc login-form
|
||||
{:wrap [mf/wrap-reactive]}
|
||||
[]
|
||||
(let [data (mf/react form-data)
|
||||
(let [data (mf/deref form-data)
|
||||
valid? (fm/valid? ::login-form data)]
|
||||
[:form {:on-submit #(on-submit % data)}
|
||||
[:div.login-content
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
;; --- Profile Form
|
||||
(mf/def profile-form
|
||||
:mixins [mf/memo mf/reactive mf/sync-render (fm/clear-mixin st/store :profile)]
|
||||
:mixins [mf/memo mf/reactive (fm/clear-mixin st/store :profile)]
|
||||
:render
|
||||
(fn [own props]
|
||||
(let [data (merge {:language @i18n/locale}
|
||||
|
@ -113,7 +113,6 @@
|
|||
;; --- Profile Photo Form
|
||||
|
||||
(mf/defc profile-photo-form
|
||||
{:wrap [mf/wrap-reactive]}
|
||||
[]
|
||||
(letfn [(on-change [event]
|
||||
(let [target (dom/get-target event)
|
||||
|
@ -122,7 +121,7 @@
|
|||
(first))]
|
||||
(st/emit! (udu/update-photo file))
|
||||
(dom/clean-value! target)))]
|
||||
(let [{:keys [photo]} (mf/react profile-ref)
|
||||
(let [{:keys [photo]} (mf/deref profile-ref)
|
||||
photo (if (or (str/empty? photo) (nil? photo))
|
||||
"images/avatar.jpg"
|
||||
photo)]
|
||||
|
|
|
@ -49,10 +49,9 @@
|
|||
(l/derive st/state)))
|
||||
|
||||
(mf/defc user
|
||||
{:wrap [mf/wrap-reactive]}
|
||||
[_]
|
||||
(let [open (mf/use-state false)
|
||||
profile (mf/react profile-ref)
|
||||
profile (mf/deref profile-ref)
|
||||
photo (if (str/empty? (:photo profile ""))
|
||||
"/images/avatar.jpg"
|
||||
(:photo profile))]
|
||||
|
|
|
@ -83,8 +83,8 @@
|
|||
:no-tool-bar-left (not left-sidebar?)
|
||||
:scrolling (:viewport-positionig workspace))]
|
||||
|
||||
(mf/use-effect {:deps #js [canvas page]
|
||||
:fn #(subscribe canvas page)})
|
||||
(mf/use-effect #(subscribe canvas page)
|
||||
#js [(:id page)])
|
||||
[:*
|
||||
(messages-widget)
|
||||
[:& header {:page page
|
||||
|
|
|
@ -29,9 +29,8 @@
|
|||
;; --- Zoom Widget
|
||||
|
||||
(mf/defc zoom-widget
|
||||
{:wrap [mf/wrap-reactive]}
|
||||
[props]
|
||||
(let [zoom (mf/react refs/selected-zoom)
|
||||
(let [zoom (mf/deref refs/selected-zoom)
|
||||
increase #(st/emit! (dw/increase-zoom))
|
||||
decrease #(st/emit! (dw/decrease-zoom))]
|
||||
[:ul.options-view
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
[uxbox.builtins.icons :as i]
|
||||
[uxbox.main.data.icons :as udi]
|
||||
[uxbox.main.data.workspace :as dw]
|
||||
[uxbox.main.lenses :as ul]
|
||||
[uxbox.main.store :as st]
|
||||
[uxbox.main.ui.dashboard.icons :as icons]
|
||||
[uxbox.main.ui.shapes.icon :as icon]
|
||||
|
@ -22,12 +21,12 @@
|
|||
|
||||
;; --- Refs
|
||||
|
||||
(def ^:private drawing-shape-ref
|
||||
"A focused vision of the drawing property
|
||||
of the workspace status. This avoids
|
||||
rerender the whole toolbox on each workspace
|
||||
change."
|
||||
(l/derive ul/selected-drawing st/state))
|
||||
;; (def ^:private drawing-shape-ref
|
||||
;; "A focused vision of the drawing property
|
||||
;; of the workspace status. This avoids
|
||||
;; rerender the whole toolbox on each workspace
|
||||
;; change."
|
||||
;; (l/derive ul/selected-drawing st/state))
|
||||
|
||||
(def ^:private icons-toolbox-ref
|
||||
(-> (l/in [:workspace :icons-toolbox])
|
||||
|
|
|
@ -56,9 +56,8 @@
|
|||
(l/derive st/state)))
|
||||
|
||||
(mf/defc app
|
||||
{:wrap [mf/wrap-reactive]}
|
||||
[]
|
||||
(let [route (mf/react route-ref)]
|
||||
(let [route (mf/deref route-ref)]
|
||||
(case (get-in route [:data :name])
|
||||
:view/notfound (notfound-page)
|
||||
:view/viewer (let [{:keys [token id]} (get-in route [:params :path])]
|
||||
|
|
|
@ -34,9 +34,8 @@
|
|||
;; --- Component
|
||||
|
||||
(mf/defc viewer-page
|
||||
{:wrap [mf/wrap-reactive]}
|
||||
[{:keys [token id]}]
|
||||
(let [{:keys [project pages flags]} (mf/react state-ref)]
|
||||
(let [{:keys [project pages flags]} (mf/deref state-ref)]
|
||||
(mf/use-effect
|
||||
{:fn #(st/emit! (dv/initialize token))})
|
||||
(when (seq pages)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue