mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 10:38:13 -05:00
✨ Allow pin/unpin from project header
This commit is contained in:
parent
93311b8b98
commit
70cba4bbdf
2 changed files with 19 additions and 1 deletions
|
@ -105,4 +105,14 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pin-icon {
|
||||
svg {
|
||||
fill: $color-gray-20;
|
||||
}
|
||||
|
||||
&.active {
|
||||
svg { fill: $color-gray-50; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
on-edit
|
||||
(mf/use-callback #(swap! local assoc :edition true :menu-open false))
|
||||
|
||||
toggle-pin
|
||||
(mf/use-callback
|
||||
(mf/deps project)
|
||||
(st/emitf (dd/toggle-project-pin project)))
|
||||
|
||||
delete-fn
|
||||
(mf/use-callback
|
||||
|
@ -82,7 +86,11 @@
|
|||
[:& context-menu {:on-close on-menu-close
|
||||
:show (:menu-open @local)
|
||||
:options [[(t locale "labels.rename") on-edit]
|
||||
[(t locale "labels.delete") on-delete]]}]]))
|
||||
[(t locale "labels.delete") on-delete]]}]
|
||||
[:div.icon.pin-icon
|
||||
{:class (when (:is-pinned project) "active")
|
||||
:on-click toggle-pin}
|
||||
i/pin]]))
|
||||
[:a.btn-secondary.btn-small {:on-click on-create-clicked}
|
||||
(t locale "dashboard.new-file")]]))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue