Skip to content

Commit

Permalink
chore(client): explore not found component
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Jan 18, 2024
1 parent bf00516 commit 8489f4e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {SITE_SUBTITLE, SITE_TITLE} from "../constants/app";
import {EPIVAR_NODES} from "../config";
import {useNode, useUrlEncodedNode} from "../hooks";
import DatasetPage from "./pages/DatasetPage";
import NotFound from "./NotFound";


const RoutedApp = () => {
Expand Down Expand Up @@ -165,6 +166,7 @@ const App = () => {
<Route index={true} element={<PeakResults />} />
<Route path="locus/:chrom/:position/:assay" element={<PeakResults />} />
<Route path="locus/:chrom/:position" element={<PeakResults />} />
<Route path="*" element={<NotFound context="no explore route" />} />
</Route>
</Route>
<Route path="faq" element={<FAQPage />} />
Expand Down
18 changes: 18 additions & 0 deletions client/src/components/NotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, {useEffect} from "react";
import {useLocation} from "react-router-dom";

const NotFound = ({context}) => {
const location = useLocation();

useEffect(() => {
console.debug("not found location", location);
}, [location]);

return (
<div>
<h2>Not Found{context ? `: ${context}` : null}</h2>
</div>
);
};

export default NotFound;

0 comments on commit 8489f4e

Please sign in to comment.