@@ -318,16 +356,6 @@ class InstanceScreenImpl extends React.PureComponent {
- return (
-
- );
- };
-
private renderLoadingState = () => } />;
private renderPersonalInstanceErrorState = () => {
@@ -390,6 +418,7 @@ const mapStateToProps = (state: IAppState) => {
};
};
const mapDispatchToProps = (dispatch: Dispatch) => ({
+ navigateToInstance: (domain: string) => dispatch(push(`/instance/${domain}`)),
navigateToRoot: () => dispatch(push("/"))
});
const InstanceScreen = connect(
diff --git a/frontend/src/constants.tsx b/frontend/src/constants.tsx
index 3a95788..c1a577c 100644
--- a/frontend/src/constants.tsx
+++ b/frontend/src/constants.tsx
@@ -1,5 +1,5 @@
/* Screen widths less than this will be treated as mobile */
-export const DESKTOP_WIDTH_THRESHOLD = 800;
+export const DESKTOP_WIDTH_THRESHOLD = 1000;
export const DEFAULT_NODE_COLOR = "#CED9E0";
export const SELECTED_NODE_COLOR = "#48AFF0";
diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx
index 06351c3..5828cd7 100644
--- a/frontend/src/index.tsx
+++ b/frontend/src/index.tsx
@@ -16,7 +16,7 @@ import { FocusStyleManager } from "@blueprintjs/core";
import { routerMiddleware } from "connected-react-router";
import { createBrowserHistory } from "history";
-import { AppRouter } from "./AppRouter";
+import AppRouter from "./AppRouter";
import createRootReducer from "./redux/reducers";
// https://blueprintjs.com/docs/#core/accessibility.focus-management
diff --git a/frontend/src/redux/reducers.ts b/frontend/src/redux/reducers.ts
index 91f121d..7131584 100644
--- a/frontend/src/redux/reducers.ts
+++ b/frontend/src/redux/reducers.ts
@@ -13,6 +13,7 @@ const data = (state: IDataState = initialDataState, action: IAction) => {
case ActionType.REQUEST_GRAPH:
return {
...state,
+ graph: undefined,
isLoadingGraph: true
};
case ActionType.RECEIVE_GRAPH:
diff --git a/frontend/src/util.ts b/frontend/src/util.ts
index bedf53f..2b4dd5b 100644
--- a/frontend/src/util.ts
+++ b/frontend/src/util.ts
@@ -1,6 +1,6 @@
import { createMatchSelector } from "connected-react-router";
import fetch from "cross-fetch";
-import { IInstanceDomainPath, INSTANCE_DOMAIN_PATH } from "./constants";
+import { DESKTOP_WIDTH_THRESHOLD, IInstanceDomainPath, INSTANCE_DOMAIN_PATH } from "./constants";
import { IAppState } from "./redux/types";
let API_ROOT = "http://localhost:4000/api/";
@@ -16,3 +16,5 @@ export const getFromApi = (path: string): Promise => {
};
export const domainMatchSelector = createMatchSelector(INSTANCE_DOMAIN_PATH);
+
+export const isSmallScreen = window.innerWidth < DESKTOP_WIDTH_THRESHOLD;