-
-
+ {this.renderOverlay(isEmbedded)}
+
@@ -230,7 +255,11 @@ class App extends React.Component {
/>
)}
-
+
diff --git a/src/containers/Simularium/style.css b/src/containers/Simularium/style.css
index 26560d9c1..2cb522b1e 100644
--- a/src/containers/Simularium/style.css
+++ b/src/containers/Simularium/style.css
@@ -15,6 +15,12 @@
background: var(--dark-theme-body-bg);
}
+.container.embed :global(.ant-layout-content) {
+ height: 100vh;
+ /* Prevents a light gray background from flashing upon collapsing the right sidebar */
+ background: var(--dark-theme-body-bg);
+}
+
.content {
position: relative;
height: 100%;
diff --git a/src/index.tsx b/src/index.tsx
index cb65a0726..86724fd87 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -11,7 +11,7 @@ import { BrowserRouter, Switch, Route, useLocation } from "react-router-dom";
import { APP_ID } from "./constants";
import { createReduxStore } from "./state";
-import routes, { VIEWER_PATHNAME } from "./routes";
+import routes, { EMBED_PATHNAME, VIEWER_PATHNAME } from "./routes";
import ScrollToTop from "./components/ScrollToTop";
import AppHeader from "./containers/AppHeader";
@@ -32,7 +32,10 @@ function useLocationChange() {
const dispatch = useDispatch();
React.useEffect(() => {
- if (location.pathname !== VIEWER_PATHNAME) {
+ if (
+ location.pathname !== VIEWER_PATHNAME &&
+ location.pathname !== EMBED_PATHNAME
+ ) {
batch(() => {
// if we're navigating away from the viewer, stop playing and reset state
dispatch(setIsPlaying(false));
@@ -76,9 +79,11 @@ const App = () => {
}
>
-
+ {location.pathname !== EMBED_PATHNAME && (
+
+ )}
diff --git a/src/routes/index.tsx b/src/routes/index.tsx
index 0d20a8c9f..eb473fce1 100644
--- a/src/routes/index.tsx
+++ b/src/routes/index.tsx
@@ -4,6 +4,7 @@ import Simularium from "../containers/Simularium";
export const VIEWER_PATHNAME = "/viewer";
export const TUTORIAL_PATHNAME = "/tutorial";
+export const EMBED_PATHNAME = "/embed";
export default [
{
@@ -21,4 +22,9 @@ export default [
component: Simularium,
path: VIEWER_PATHNAME,
},
+ {
+ name: "Embed",
+ component: Simularium,
+ path: EMBED_PATHNAME,
+ },
];