From 2a0705f1c26befa75703238462930847b18895e1 Mon Sep 17 00:00:00 2001 From: Desmond Kyeremeh Date: Fri, 2 Jul 2021 17:07:17 +0000 Subject: show admin title in mobile appbar --- modern/src/settings/OptionsLayout/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modern/src/settings/OptionsLayout/index.js') diff --git a/modern/src/settings/OptionsLayout/index.js b/modern/src/settings/OptionsLayout/index.js index 37b6355..61a94cf 100644 --- a/modern/src/settings/OptionsLayout/index.js +++ b/modern/src/settings/OptionsLayout/index.js @@ -33,7 +33,7 @@ const useStyles = makeStyles(theme => ({ content: { flex: 1, padding: theme.spacing(5, 3, 3, 3), - [theme.breakpoints.down('md')]:{ + [theme.breakpoints.down('md')]: { paddingTop: theme.spacing(10) } }, @@ -58,8 +58,10 @@ const OptionsLayout = ({ children }) => { const routes = useRoutes(); useEffect(() => { - const activeRoute = routes.find(route => location.pathname.match(route.match)); - setOptionTitle(activeRoute.name); + const activeRoute = routes.find( + route => route.href && location.pathname.match(route.match || route.href) + ); + setOptionTitle(activeRoute?.name); }, [location, routes]); const title = `Options / ${optionTitle}`; -- cgit v1.2.3