fix(docs): fix user-interface.mdx (#2700)

### Change Type

- [x] `documentation` — Changes to the documentation only

### Release Notes

Add `newMenuItem` creation in "Toolbar and Menus" example

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
This commit is contained in:
Rokixy 2024-02-01 23:08:39 +08:00 committed by GitHub
parent 3b286e10c4
commit b76d7b3db1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,6 +122,7 @@ const myOverrides: TLUiOverrides = {
return actions return actions
}, },
contextMenu(editor, contextMenu, { actions }) { contextMenu(editor, contextMenu, { actions }) {
const newMenuItem = menuItem(actions['my-new-action'])
const newMenuGroup = menuGroup('my-items', newMenuItem) const newMenuGroup = menuGroup('my-items', newMenuItem)
contextMenu.unshift(newMenuItem) contextMenu.unshift(newMenuItem)
return contextMenu return contextMenu