diff --git a/src/App.tsx b/src/App.tsx index bf40e640..a8d07848 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -68,6 +68,7 @@ function getItem( children?: MenuItem[], onClick?: () => void, disabled?: boolean, + title?: string, ): MenuItem { return { key, @@ -76,6 +77,7 @@ function getItem( label, onClick, disabled, + title, } as MenuItem; } @@ -176,7 +178,15 @@ const App: React.FC = () => { const items: MenuItem[] = [ getItem("View", "view", ), getItem("Console", "console", ), - getItem("Notebook", "notebook", ), + getItem( + "Notebook", + "notebook", + , + undefined, + undefined, + running || paused, + running || paused ? "Can only analyze in Jupyter notebook after simulation has finished" : undefined, + ), getItem( editMenuLabel, "edit", diff --git a/src/containers/Main.tsx b/src/containers/Main.tsx index 076f91fd..092a11dd 100644 --- a/src/containers/Main.tsx +++ b/src/containers/Main.tsx @@ -1,4 +1,4 @@ -import { Modal, Tabs, Progress, Button, Layout } from "antd"; +import { Modal, Tabs, Progress, Button, Layout, Tooltip } from "antd"; import { useState, useEffect, useMemo } from "react"; import View from "./View"; import Notebook from "./Notebook"; @@ -21,6 +21,7 @@ const Main = ({ isEmbedded }: { isEmbedded: boolean }) => { ); const selectedMenu = useStoreState((state) => state.app.selectedMenu); const running = useStoreState((state) => state.simulation.running); + const paused = useStoreState((state) => state.simulation.paused); const setPreferredView = useStoreActions( (actions) => actions.app.setPreferredView, @@ -100,16 +101,21 @@ const Main = ({ isEmbedded }: { isEmbedded: boolean }) => { width={"80%"} footer={[ <> - + +