Add context menu item for set groups

This commit is contained in:
Florian Schroedl 2024-12-03 11:13:51 +01:00
parent d34c88b6e4
commit 53229c03d6
2 changed files with 22 additions and 0 deletions

View file

@ -7,6 +7,7 @@
(ns app.main.ui.workspace.tokens.sets-context-menu
(:require-macros [app.main.style :as stl])
(:require
[app.common.types.tokens-lib :as ctob]
[app.main.data.tokens :as wdt]
[app.main.refs :as refs]
[app.main.store :as st]
@ -40,6 +41,8 @@
edit-name (mf/use-fn #(on-edit prefixed-set-path))
delete-set (mf/use-fn #(st/emit! (wdt/delete-token-set-path prefixed-set-path)))]
[:ul {:class (stl/css :context-list)}
(when (ctob/prefixed-set-path-final-group? prefixed-set-path)
[:& menu-entry {:title "Add set to this group" :on-click js/console.log}])
[:& menu-entry {:title (tr "labels.rename") :on-click edit-name}]
[:& menu-entry {:title (tr "labels.delete") :on-click delete-set}]]))