Skip to content

Commit

Permalink
Make app title a link to /home route
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Jul 25, 2024
1 parent cf5bd17 commit 5ff2250
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions apps/nar-v3/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { Avatar, CssBaseline, AppBar, Toolbar, Typography, Container } from "@mui/material";
import { createBrowserRouter, RouterProvider, Link as RouterLink } from "react-router-dom";

import { Avatar, CssBaseline, AppBar, Link, Toolbar, Typography, Container } from "@mui/material";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import { green } from "@mui/material/colors";

Expand Down Expand Up @@ -64,6 +65,10 @@ const router = createBrowserRouter([
},
]);

function LinkRouter(props) {
return <Link {...props} component={RouterLink} />;
}

function renderApp() {
ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
Expand All @@ -76,7 +81,7 @@ function renderApp() {
<Toolbar>
<Avatar sx={{ mr: 2 }} alt="EBRAINS" src="/favicon.png" />
<Typography variant="h6" color="inherit" noWrap>
EBRAINS: Neural Activity Resource (alpha)
<LinkRouter underline="hover" color="inherit" to="/">EBRAINS: Neural Activity Resource (alpha)</LinkRouter>
</Typography>
</Toolbar>
</AppBar>
Expand Down
2 changes: 1 addition & 1 deletion apps/nar-v3/src/routes/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function Home() {

return (
<React.Suspense fallback={<ProgressIndicator />}>
<Await resolve={data.counts} errorElement={<p>Error loading tissueSample.</p>}>
<Await resolve={data.counts} errorElement={<p>Error loading statistics.</p>}>
{([patchClampCounts, datasetCounts]) => {
return (
<Container maxWidth="lg" sx={{ paddingTop: 8, paddingBottom: 8 }}>
Expand Down

0 comments on commit 5ff2250

Please sign in to comment.