From e32e8d85d9cc7c4b91e431a247a9b1f81c31abb2 Mon Sep 17 00:00:00 2001 From: Sergio Neves Barros Date: Sat, 9 Dec 2023 17:42:12 +0000 Subject: [PATCH] storing state of menu in cookie. --- src/containers/App.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/containers/App.js b/src/containers/App.js index 8e1a1d7..743e981 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -51,7 +51,7 @@ const App = function (props) { const location = useLocation(); const teamRequests = new TeamRequests(axios); const environmentRequests = new EnvironmentRequests(axios); - const [expand, setExpand] = useState(true); + const [expand, setExpand] = useState(Cookies.get('expand') === undefined || (Cookies.get('expand') === 'true')); const { teams, currentTeam, @@ -156,6 +156,11 @@ const App = function (props) { Cookies.set('theme', theme); }; + const toggleMenu = () => { + Cookies.set('expand', !expand, { expires: 365 }); + setExpand(!expand); + }; + return (