Skip to content

Modules Structure

Marcus edited this page Feb 14, 2021 · 3 revisions

The latest modules system follows the following structure:

(_params) => {
  return {
    // For functions that source academy cadets will be interacting with in the IDE.
    functions: {
      function1: () => [],
      function2: (arg1, arg2) => [...arg1, ...arg2],
    },
    // For generating the side content tabs on cadet-frontend.
    sideContents: [
      {
        // Renders component if function returns true
        toSpawn: (context) => true,
        // Module component that will be rendered in the tab
        body: (React) => (props) => {
          return (
            <div>
              <h1>Hello World!</h1>
            </div>
          );
        },
        // Tooltip string
        label: "Test Component",
        // Icon for side content tab (uses BlueprintJS icon mame)
        iconName: "mugshot",
      },
    ],
  };
};
Clone this wiki locally