= ({ menu }) => {
}, []);
return (
- <>
+ push('/')}>
{/* Using portal so that we can retain the same nav items both in the dialog and in the base header */}
= ({ menu }) => {
- >
+
);
};
diff --git a/pkg/grid/src/nav/Notifications.tsx b/pkg/grid/src/nav/Notifications.tsx
index dda03cfc2..85e5fb2c2 100644
--- a/pkg/grid/src/nav/Notifications.tsx
+++ b/pkg/grid/src/nav/Notifications.tsx
@@ -1,10 +1,12 @@
import React, { useEffect } from 'react';
-import { Link, NavLink, Route, Switch } from 'react-router-dom';
+import { ErrorBoundary } from 'react-error-boundary';
+import { Link, NavLink, Route, RouteComponentProps, Switch } from 'react-router-dom';
import { Button } from '../components/Button';
+import { ErrorAlert } from '../components/ErrorAlert';
import { useHarkStore } from '../state/hark';
import { Inbox } from './notifications/Inbox';
-export const Notifications = () => {
+export const Notifications = ({ history }: RouteComponentProps) => {
const markAllAsRead = () => {
const { archiveAll } = useHarkStore.getState();
archiveAll();
@@ -26,43 +28,48 @@ export const Notifications = () => {
// const select = useLeapStore((s) => s.select);
return (
-
-
-
- New
-
-
- Archive
-
-
-
-
-
-
-
-
-
-
-
-
-
+ history.push('/leap/notifications')}
+ >
+
+
+
+ New
+
+
+ Archive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
};
diff --git a/pkg/grid/src/nav/Search.tsx b/pkg/grid/src/nav/Search.tsx
index c926f69d6..ebcd5f4ee 100644
--- a/pkg/grid/src/nav/Search.tsx
+++ b/pkg/grid/src/nav/Search.tsx
@@ -1,24 +1,28 @@
import React from 'react';
import { Route, RouteComponentProps, Switch } from 'react-router-dom';
+import { ErrorBoundary } from 'react-error-boundary';
import { TreatyInfo } from './search/TreatyInfo';
import { Apps } from './search/Apps';
import { Home } from './search/Home';
import { Providers } from './search/Providers';
+import { ErrorAlert } from '../components/ErrorAlert';
type SearchProps = RouteComponentProps<{
query?: string;
}>;
-export const Search = ({ match }: SearchProps) => {
+export const Search = ({ match, history }: SearchProps) => {
return (
-
-
-
-
-
-
+ history.push('/leap/search')}>
+
+
+
+
+
+
+
);
};
diff --git a/pkg/grid/src/nav/SystemPreferences.tsx b/pkg/grid/src/nav/SystemPreferences.tsx
index 9bcf6a9cc..7cd3f724f 100644
--- a/pkg/grid/src/nav/SystemPreferences.tsx
+++ b/pkg/grid/src/nav/SystemPreferences.tsx
@@ -1,5 +1,6 @@
import React, { PropsWithChildren, useCallback } from 'react';
import { Link, Route, RouteComponentProps, Switch, useRouteMatch } from 'react-router-dom';
+import { ErrorBoundary } from 'react-error-boundary';
import classNames from 'classnames';
import { NotificationPrefs } from './preferences/NotificationPrefs';
import { SystemUpdatePrefs } from './preferences/SystemUpdatePrefs';
@@ -9,6 +10,7 @@ import { InterfacePrefs } from './preferences/InterfacePrefs';
import { useCharges } from '../state/docket';
import { AppPrefs } from './preferences/AppPrefs';
import { DocketImage } from '../components/DocketImage';
+import { ErrorAlert } from '../components/ErrorAlert';
interface SystemPreferencesSectionProps {
url: string;
@@ -36,7 +38,7 @@ function SystemPreferencesSection({
}
export const SystemPreferences = (props: RouteComponentProps<{ submenu: string }>) => {
- const { match } = props;
+ const { match, history } = props;
const subMatch = useRouteMatch<{ submenu: string; desk?: string }>(
`${match.url}/:submenu/:desk?`
);
@@ -60,54 +62,59 @@ export const SystemPreferences = (props: RouteComponentProps<{ submenu: string }
const subUrl = useCallback((submenu: string) => `${match.url}/${submenu}`, [match]);
return (
-
+
);
};
diff --git a/pkg/grid/src/pages/Grid.tsx b/pkg/grid/src/pages/Grid.tsx
index a5918b29c..e0425a8e5 100644
--- a/pkg/grid/src/pages/Grid.tsx
+++ b/pkg/grid/src/pages/Grid.tsx
@@ -1,6 +1,8 @@
import { map, omit } from 'lodash';
import React, { FunctionComponent } from 'react';
+import { ErrorBoundary } from 'react-error-boundary';
import { Route, RouteComponentProps } from 'react-router-dom';
+import { ErrorAlert } from '../components/ErrorAlert';
import { MenuState, Nav } from '../nav/Nav';
import { useCharges } from '../state/docket';
import { RemoveApp } from '../tiles/RemoveApp';
@@ -12,7 +14,7 @@ type GridProps = RouteComponentProps<{
menu?: MenuState;
}>;
-export const Grid: FunctionComponent = ({ match }) => {
+export const Grid: FunctionComponent = ({ match, history }) => {
const charges = useCharges();
const chargesLoaded = Object.keys(charges).length > 0;
@@ -32,15 +34,17 @@ export const Grid: FunctionComponent = ({ match }) => {
))}
)}
-
-
-
-
-
-
-
-
-
+ history.push('/')}>
+
+
+
+
+
+
+
+
+
+
);