From dadb094017e2549b8af045cfe189163e1f84fced Mon Sep 17 00:00:00 2001 From: tylen Date: Sun, 2 Nov 2025 21:56:53 +0200 Subject: [PATCH] frontend: add logout --- frontend/src/App.css | 9 +++++++++ frontend/src/App.tsx | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/frontend/src/App.css b/frontend/src/App.css index d7a866a..9bbba9d 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -264,6 +264,15 @@ nav ul { justify-content: space-around; /* Space the items evenly */ } +nav ul li p { + color: white; + text-decoration: none; +} + +nav ul li p:hover { + text-decoration: underline; +} + nav li { display: inline; } diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 166ded3..acf778c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -10,6 +10,17 @@ import { FullScreenLoading } from './components/Loading'; function App() { const [isNavOpen, setIsNavOpen] = useState(false); + const handleLogout = () => { + const cookies = document.cookie.split(";"); + + for (let cookie of cookies) { + const cookieName = cookie.split("=")[0].trim(); + // Set the cookie's expiration date to the past to delete it + document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;`; + } + window.location.reload(); + }; + const toggleNav = () => { setIsNavOpen(!isNavOpen); }; @@ -35,6 +46,9 @@ function App() {
  • Программа
  • +
  • + +