Add description to context menu + Improve context menu position and size

This commit is contained in:
Eric NGUYEN 2022-10-04 16:30:55 +02:00
parent 84f968a872
commit cc84e59701
4 changed files with 31 additions and 8 deletions

View file

@ -38,6 +38,7 @@ function InitActions(
'elements-sidebar-row',
[{
text: 'Delete',
title: 'Delete the container',
action: (target: HTMLElement) => {
const id = target.id;
const newHistory = DeleteContainer(
@ -53,6 +54,7 @@ function InitActions(
'symbols-sidebar-row',
[{
text: 'Delete',
title: 'Delete the container',
action: (target: HTMLElement) => {
const id = target.id;
const newHistory = DeleteSymbol(
@ -83,6 +85,7 @@ function InitActions(
const currentState = GetCurrentHistoryState(history, historyCurrentStep);
const newAction: IMenuAction = {
text: action.Label,
title: action.Description,
action: GetAction(
action,
currentState,
@ -320,7 +323,7 @@ export function Editor(props: IEditorProps): JSX.Element {
<Menu
getListener={() => editorRef.current}
actions={menuActions}
className="z-30 transition-opacity rounded bg-slate-200 py-1 drop-shadow-xl"
className="z-30 transition-opacity rounded bg-slate-200 drop-shadow-xl"
/>
</div>
);