mirror of
https://github.com/penpot/penpot.git
synced 2025-08-06 05:28:28 +02:00
Properly refresh pages list on interactions sidebar menus.
And convert the interaction related components to use the defc/defcs macros.
This commit is contained in:
parent
027b4a5d57
commit
7c4717fcfa
3 changed files with 303 additions and 420 deletions
|
@ -24,6 +24,14 @@
|
|||
(let [id (l/focus ul/selected-page state)]
|
||||
(get-in state [:pages id])))
|
||||
|
||||
(defn- resolve-project-pages
|
||||
[state]
|
||||
(let [project (get-in state [:workspace :project])
|
||||
get-order #(get-in % [:metadata :order])]
|
||||
(->> (vals (:pages state))
|
||||
(filter #(= project (:project %)))
|
||||
(sort-by get-order))))
|
||||
|
||||
(def workspace
|
||||
(l/derive ul/workspace st/state))
|
||||
|
||||
|
@ -32,6 +40,10 @@
|
|||
(-> (l/lens resolve-project)
|
||||
(l/derive st/state)))
|
||||
|
||||
(def selected-project-pages
|
||||
(-> (l/lens resolve-project-pages)
|
||||
(l/derive st/state)))
|
||||
|
||||
(def selected-page
|
||||
"Ref to the current selected page."
|
||||
(-> (l/lens resolve-page)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue