mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05:00
✨ Add pin version to main menu
This commit is contained in:
parent
c1d3e4cd6e
commit
d22f6e37c9
4 changed files with 36 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
|||
[app.main.data.workspace.libraries :as dwl]
|
||||
[app.main.data.workspace.shortcuts :as sc]
|
||||
[app.main.data.workspace.undo :as dwu]
|
||||
[app.main.data.workspace.versions :as dwv]
|
||||
[app.main.features :as features]
|
||||
[app.main.refs :as refs]
|
||||
[app.main.store :as st]
|
||||
|
@ -537,6 +538,19 @@
|
|||
(when (kbd/enter? event)
|
||||
(on-show-version-history event))))
|
||||
|
||||
on-pin-version
|
||||
(mf/use-fn
|
||||
(mf/deps file-id)
|
||||
(fn [_]
|
||||
(st/emit! (dwv/create-version file-id))))
|
||||
|
||||
on-pin-version-key-down
|
||||
(mf/use-fn
|
||||
(mf/deps on-pin-version)
|
||||
(fn [event]
|
||||
(when (kbd/enter? event)
|
||||
(on-pin-version event))))
|
||||
|
||||
on-export-shapes
|
||||
(mf/use-fn #(st/emit! (de/show-workspace-export-dialog {:origin "workspace:menu"})))
|
||||
|
||||
|
@ -599,6 +613,15 @@
|
|||
[:span {:class (stl/css :item-name)}
|
||||
(tr "dashboard.add-shared")]]))
|
||||
|
||||
[:div {:class (stl/css :separator)}]
|
||||
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
:on-click on-pin-version
|
||||
:on-key-down on-pin-version-key-down
|
||||
:id "file-menu-show-version-history"}
|
||||
[:span {:class (stl/css :item-name)}
|
||||
(tr "dashboard.create-version-menu")]]
|
||||
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
:on-click on-show-version-history
|
||||
:on-key-down on-show-version-history-key-down
|
||||
|
@ -606,6 +629,8 @@
|
|||
[:span {:class (stl/css :item-name)}
|
||||
(tr "dashboard.show-version-history")]]
|
||||
|
||||
[:div {:class (stl/css :separator)}]
|
||||
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
:on-click on-export-shapes
|
||||
:on-key-down on-export-shapes-key-down
|
||||
|
|
|
@ -43,9 +43,12 @@
|
|||
}
|
||||
|
||||
.separator {
|
||||
margin-top: $s-8;
|
||||
border-top: $s-1 solid var(--color-background-quaternary);
|
||||
height: $s-4;
|
||||
border-top: $s-1 solid var(--color-background-secondary);
|
||||
left: calc(-1 * $s-4);
|
||||
margin-top: $s-8;
|
||||
position: relative;
|
||||
width: calc(100% + $s-8);
|
||||
}
|
||||
|
||||
.shortcut {
|
||||
|
|
|
@ -400,6 +400,9 @@ msgstr "Add as Shared Library"
|
|||
msgid "dashboard.show-version-history"
|
||||
msgstr "Version history"
|
||||
|
||||
msgid "dashboard.create-version-menu"
|
||||
msgstr "Pin this version"
|
||||
|
||||
#: src/app/main/ui/settings/profile.cljs:72
|
||||
msgid "dashboard.change-email"
|
||||
msgstr "Change email"
|
||||
|
|
|
@ -402,6 +402,9 @@ msgstr "Añadir como Biblioteca Compartida"
|
|||
msgid "dashboard.show-version-history"
|
||||
msgstr "Histórico de versiones"
|
||||
|
||||
msgid "dashboard.create-version-menu"
|
||||
msgstr "Guardar esta versión"
|
||||
|
||||
#: src/app/main/ui/settings/profile.cljs:72
|
||||
msgid "dashboard.change-email"
|
||||
msgstr "Cambiar correo"
|
||||
|
|
Loading…
Add table
Reference in a new issue