From a2722a1263e809b4f83100dbecc992cdeacf13ea Mon Sep 17 00:00:00 2001 From: Desmond Kyeremeh Date: Thu, 1 Jul 2021 14:21:56 +0000 Subject: Show option title for mobile navbar --- modern/src/settings/OptionsLayout/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'modern/src/settings') 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 (
- +