0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 02:28:18 -05:00

Merge pull request #1 from uxbox/delete-project

Project deletion
This commit is contained in:
Andrey Antukh 2016-01-28 10:57:21 +02:00
commit e1780977af
2 changed files with 19 additions and 1 deletions

View file

@ -34,6 +34,13 @@
(let [uuid (:id proj)]
(update-in state [:projects-by-id] assoc uuid proj)))
(defn dissoc-project
"A reduce function for dissoc the project
from the state map."
[state proj]
(let [uuid (:id proj)]
(update-in state [:projects-by-id] dissoc uuid)))
(defn assoc-page
"A reduce function for assoc the page
to the state map."
@ -122,6 +129,17 @@
(-pr-writer [mv writer _]
(-write writer "#<event:u.s.p/create-project>")))))
(defn delete-project
[proj]
(reify
rs/UpdateEvent
(-apply-update [_ state]
(dissoc-project state proj))
IPrintWithWriter
(-pr-writer [mv writer _]
(-write writer "#<event:u.s.p/delete-project>"))))
(defn go-to
"A shortcut event that redirects the user to the
first page of the project."

View file

@ -205,7 +205,7 @@
[:div.project-th-icon.delete
{:on-click #(do
(dom/stop-propagation %)
;; (actions/delete-project conn uuid)
(rs/emit! (dp/delete-project project))
%)}
i/trash]]])))