From 0e714b8ca1e82648ed7ad7ffb74686d904c83cb4 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 15 Mar 2026 18:05:19 +0300 Subject: [PATCH] clean up frontend icon, app name and refresh bug on login --- backend/app/routes/home.py | 13 +++-- frontend/favicon.svg | 29 ++++++++++ frontend/index.html | 6 +-- frontend/src/App.tsx | 13 ++--- frontend/src/components/Navbar.tsx | 59 ++++++++++---------- frontend/src/components/TaskboardLogo.tsx | 55 +++++++++++++++++++ frontend/src/hooks/useApi.ts | 5 +- frontend/src/hooks/useAuth.ts | 14 +++-- frontend/src/pages/Home.tsx | 24 +++++---- frontend/src/pages/Login.tsx | 66 +++++++++++++---------- frontend/src/pages/Register.tsx | 10 +--- 11 files changed, 189 insertions(+), 105 deletions(-) create mode 100644 frontend/favicon.svg create mode 100644 frontend/src/components/TaskboardLogo.tsx diff --git a/backend/app/routes/home.py b/backend/app/routes/home.py index 6da8cb3..04789f8 100644 --- a/backend/app/routes/home.py +++ b/backend/app/routes/home.py @@ -1,16 +1,19 @@ import os -from flask import Blueprint, jsonify, send_from_directory, current_app as app +from flask import Blueprint +from flask import current_app as app +from flask import send_from_directory home_bp = Blueprint("home", __name__) -@home_bp.route('/') +@home_bp.route("/") def serve_root(): - return send_from_directory(app.static_folder, 'index.html') + return send_from_directory(app.static_folder, "index.html") -@home_bp.route('/') + +@home_bp.route("/") def serve_spa(path): if os.path.exists(os.path.join(app.static_folder, path)): return send_from_directory(app.static_folder, path) - return send_from_directory(app.static_folder, 'index.html') + return send_from_directory(app.static_folder, "index.html") diff --git a/frontend/favicon.svg b/frontend/favicon.svg new file mode 100644 index 0000000..7d70c3c --- /dev/null +++ b/frontend/favicon.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 2e13e82..b39aa8e 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,10 +2,10 @@ - + - - Crafting Shop + + Taskboard
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 7e3dfb9..4bfe05f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,17 +1,14 @@ -import { Routes, Route } from 'react-router-dom'; +import { Routes, Route, Navigate } from 'react-router-dom'; import { ModalProvider } from './context/modals/useModal'; import { ModalRoot } from './context/modals/ModalRoot'; import { ToastProvider } from './context/toasts/useToast'; import { ToastRoot } from './context/toasts/ToastRoot'; import { LoaderProvider } from './context/loaders/useLoader'; import { LoaderRoot } from './context/loaders/LoaderRoot'; -import Cart from './pages/Cart'; import { Navbar } from './components/Navbar'; import { Home } from './pages/Home'; -import { Products } from './pages/Products'; import Login from './pages/Login'; import { Register } from './pages/Register'; -import { Orders } from './pages/Orders'; import { ProtectedRoute } from './components/ProtectedRoute'; import { Boards } from './pages/Boards'; import { BoardCreate } from './pages/BoardCreate'; @@ -28,7 +25,8 @@ const App = () => {
- } /> + } /> + } /> } /> } /> @@ -73,11 +71,6 @@ const App = () => { } /> - - {/* Legacy Routes */} - } /> - } /> - } />
{/* Order matters for Z-Index: Loader (70) > Toast (60) > Modal (50) */} diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index e4991f3..ca3cab1 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -1,60 +1,55 @@ import { Link } from 'react-router-dom'; import { useApp } from '../context/AppContext'; +import { useAuth } from '../hooks/useAuth'; +import { TaskboardLogo } from './TaskboardLogo'; export function Navbar() { const { user } = useApp(); + const { logout } = useAuth(); return (