diff options
author | Desmond Kyeremeh <elDekyfin@gmail.com> | 2021-07-01 14:21:56 +0000 |
---|---|---|
committer | Desmond Kyeremeh <elDekyfin@gmail.com> | 2021-07-01 14:21:56 +0000 |
commit | a2722a1263e809b4f83100dbecc992cdeacf13ea (patch) | |
tree | a1080f87ddf578cfd15bf49aaeb9fec0d30d1962 /modern/src | |
parent | a154c692e08f340f3a81e024fb8e9f1d3a56cf52 (diff) | |
download | trackermap-web-a2722a1263e809b4f83100dbecc992cdeacf13ea.tar.gz trackermap-web-a2722a1263e809b4f83100dbecc992cdeacf13ea.tar.bz2 trackermap-web-a2722a1263e809b4f83100dbecc992cdeacf13ea.zip |
Show option title for mobile navbar
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/settings/OptionsLayout/index.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modern/src/settings/OptionsLayout/index.js b/modern/src/settings/OptionsLayout/index.js index a3a89f84..c56ebc3b 100644 --- a/modern/src/settings/OptionsLayout/index.js +++ b/modern/src/settings/OptionsLayout/index.js @@ -52,18 +52,20 @@ const OptionsLayout = ({ children }) => { const history = useHistory(); const location = useLocation(); const [openDrawer, setOpenDrawer] = useState(false); - const [OptionsTitle, setOptionsTitle] = useState(); + const [optionTitle, setOptionTitle] = useState(); const routes = useRoutes(); useEffect(() => { - routes.find(route => route.href === location.pathname); - setOptionsTitle(route.name); + const activeRoute = routes.find(route => route.href === location.pathname); + setOptionTitle(activeRoute.name); }, [location]); + const title = `Options / ${optionTitle}`; + return ( <div className={classes.root}> <Hidden lgUp> - <NavBar setOpenDrawer={setOpenDrawer} OptionsTitle={OptionsTitle} /> + <NavBar setOpenDrawer={setOpenDrawer} title={title} /> <Drawer variant="temporary" open={openDrawer} |