diff --git a/app/src/components/TextEditor.tsx b/app/src/components/TextEditor.tsx
index e3f13e3f9..6d38cb342 100644
--- a/app/src/components/TextEditor.tsx
+++ b/app/src/components/TextEditor.tsx
@@ -50,7 +50,9 @@ export function TextEditor({ extendOptions = {}, ...props }: TextEditorProps) {
}}
wrapperProps={{
"data-testid": "Editor",
- className: isDragging ? "overflow-hidden" : "",
+ className:
+ "bg-white dark:bg-neutral-900 " +
+ (isDragging ? "overflow-hidden" : ""),
}}
/>
);
diff --git a/app/src/components/Main.module.css b/app/src/components/WithGraph.module.css
similarity index 100%
rename from app/src/components/Main.module.css
rename to app/src/components/WithGraph.module.css
diff --git a/app/src/components/Main.test.tsx b/app/src/components/WithGraph.test.tsx
similarity index 74%
rename from app/src/components/Main.test.tsx
rename to app/src/components/WithGraph.test.tsx
index 70107c991..48b8ac600 100644
--- a/app/src/components/Main.test.tsx
+++ b/app/src/components/WithGraph.test.tsx
@@ -1,5 +1,5 @@
import { render } from "../test-utils";
-import Main from "./Main";
+import WithGraph from "./WithGraph";
beforeAll(() => {
jest.spyOn(console, "warn");
@@ -8,6 +8,6 @@ beforeAll(() => {
describe("Main", () => {
test("renders", () => {
- render();
+ render();
});
});
diff --git a/app/src/components/Main.tsx b/app/src/components/WithGraph.tsx
similarity index 67%
rename from app/src/components/Main.tsx
rename to app/src/components/WithGraph.tsx
index a344aa5fd..b5dbb7243 100644
--- a/app/src/components/Main.tsx
+++ b/app/src/components/WithGraph.tsx
@@ -6,22 +6,31 @@ import { CloneButton } from "./CloneButton";
import Graph from "./Graph";
import GraphWrapper from "./GraphWrapper";
import Loading from "./Loading";
-import styles from "./Main.module.css";
+import styles from "./WithGraph.module.css";
import TabPane from "./TabPane";
+import { useMobileStore } from "../lib/useMobileStore";
+import { useTabsStore } from "../lib/useTabsStore";
type MainProps = {
children?: ReactNode;
};
/** The left/right column wrapper. Also controls when things should be fullscreen. */
-const Main = memo(({ children }: MainProps) => {
+const WithGraph = memo(({ children }: MainProps) => {
const [shouldResize, triggerResize] = useState(0);
const trigger = useCallback(() => triggerResize((n) => n + 1), []);
const isFullscreen = useFullscreen();
const unmount = useUnmountStore((state) => state.unmount);
const isProUser = useIsProUser();
+ const tab = useMobileStore((state) => state.tab);
+ const selectedTab = useTabsStore((state) => state.selectedTab);
+
return (
- <>
+
{isFullscreen ? null : (
}>{children}
@@ -35,10 +44,10 @@ const Main = memo(({ children }: MainProps) => {
) : null}
- >
+
);
});
-Main.displayName = "Main";
+WithGraph.displayName = "Main";
-export default Main;
+export default WithGraph;
diff --git a/app/src/components/EditWrapper.module.css b/app/src/components/WithMobileTabToggle.module.css
similarity index 72%
rename from app/src/components/EditWrapper.module.css
rename to app/src/components/WithMobileTabToggle.module.css
index 27d2855d8..cbaab0ab3 100644
--- a/app/src/components/EditWrapper.module.css
+++ b/app/src/components/WithMobileTabToggle.module.css
@@ -1,12 +1,12 @@
@media (max-width: 799px) {
- .EditWrapper {
+ .WithMobileTabToggle {
max-height: 100%;
overflow: hidden;
}
}
@media (min-width: 800px) {
- .EditWrapper {
+ .WithMobileTabToggle {
display: flex;
}
}
diff --git a/app/src/components/EditWrapper.tsx b/app/src/components/WithMobileTabToggle.tsx
similarity index 62%
rename from app/src/components/EditWrapper.tsx
rename to app/src/components/WithMobileTabToggle.tsx
index 46f3bdf53..08ffc53fa 100644
--- a/app/src/components/EditWrapper.tsx
+++ b/app/src/components/WithMobileTabToggle.tsx
@@ -1,26 +1,22 @@
import { ReactNode } from "react";
import { useFullscreen } from "../lib/hooks";
-import { Box } from "../slang";
-import styles from "./EditWrapper.module.css";
import MobileTabToggle from "./MobileTabToggle";
import { useMobileStore } from "../lib/useMobileStore";
/**
* Adds the wrapper for the toggle between the editor and the graph
* on mobile.
*/
-export function EditWrapper({ children }: { children: ReactNode }) {
+export function WithMobileTabToggle({ children }: { children: ReactNode }) {
const tab = useMobileStore((state) => state.tab);
const isFullscreen = useFullscreen();
return (
-