Skip to content

Commit

Permalink
Add menu option to create a new component library
Browse files Browse the repository at this point in the history
  • Loading branch information
treo committed Jul 18, 2024
1 parent aefc76e commit f96e4c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/LibraryActionCommands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { requestAPI } from '../server/handler';
import { checkInput } from '../helpers/InputSanitizer';
import { XircuitsFactory } from '../XircuitsFactory';
import { commandIDs } from "./CommandIDs";
import { listIcon, refreshIcon } from "@jupyterlab/ui-components";
import { addIcon, listIcon, refreshIcon } from "@jupyterlab/ui-components";

/**
* Add the commands for node actions.
Expand Down Expand Up @@ -51,6 +51,8 @@ export function addLibraryActionCommands(
})

commands.addCommand(commandIDs.createNewComponentLibrary, {
label: "Create new Component Library",
icon: addIcon,
execute: async (args) => {

let componentCode = args['componentCode'] as any;
Expand Down
2 changes: 2 additions & 0 deletions src/tray_library/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export default function Sidebar(props: SidebarProps) {
const menu = new MenuSvg({ commands: app.commands });
// Add commands to the menu
menu.addItem({ command: commandIDs.refreshComponentList });
menu.addItem({ command: commandIDs.createNewComponentLibrary });
menu.addItem({ type: "separator" });
menu.addItem({ command: commandIDs.toggleDisplayNodesInLibrary });

function showMenu(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) {
Expand Down

0 comments on commit f96e4c5

Please sign in to comment.