mirror of
https://github.com/penpot/penpot.git
synced 2025-08-06 12:28:22 +02:00
✨ Add shortcuts for dashboard viewer and path
This commit is contained in:
parent
8072caeff1
commit
771bb20976
8 changed files with 145 additions and 54 deletions
|
@ -544,18 +544,17 @@
|
|||
(rx/of (rt/nav rname pparams qparams))))))
|
||||
|
||||
(defn go-to-workspace
|
||||
[page-id]
|
||||
(ptk/reify ::go-to-workspace
|
||||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
(let [project-id (get-in state [:viewer :project :id])
|
||||
file-id (get-in state [:viewer :file :id])
|
||||
pparams {:project-id project-id :file-id file-id}
|
||||
qparams {:page-id page-id}]
|
||||
([] (go-to-workspace nil))
|
||||
([page-id]
|
||||
(ptk/reify ::go-to-workspace
|
||||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
(let [project-id (get-in state [:viewer :project :id])
|
||||
file-id (get-in state [:viewer :file :id])
|
||||
pparams {:project-id project-id :file-id file-id}
|
||||
qparams {:page-id (or page-id (:current-page-id state))}]
|
||||
(rx/of (rt/nav-new-window*
|
||||
{:rname :workspace
|
||||
:path-params pparams
|
||||
:query-params qparams
|
||||
:name (str "workspace-" file-id)}))))))
|
||||
|
||||
|
||||
:name (str "workspace-" file-id)})))))))
|
Loading…
Add table
Add a link
Reference in a new issue