Area riservata agli operatori corrieri.
+diff --git a/package-lock.json b/package-lock.json
index e1187b6..adca22d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,8 @@
"version": "0.0.0",
"dependencies": {
"react": "^19.2.6",
- "react-dom": "^19.2.6"
+ "react-dom": "^19.2.6",
+ "react-router-dom": "^7.18.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
@@ -1306,6 +1307,19 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/cookie": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -2370,6 +2384,44 @@
"react": "^19.2.7"
}
},
+ "node_modules/react-router": {
+ "version": "7.18.0",
+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.0.tgz",
+ "integrity": "sha512-pTTGt8J+ji1NOmYnjzT+bAJy/1zD+Jp4ziO6cL7T3ZLvXKtusO7BpFqlRXitqpcPVqllsIXFHRMt+2/k3Xn6HQ==",
+ "license": "MIT",
+ "dependencies": {
+ "cookie": "^1.0.1",
+ "set-cookie-parser": "^2.6.0"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-router-dom": {
+ "version": "7.18.0",
+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.0.tgz",
+ "integrity": "sha512-Fi0yY6kgtKae/Th2xibdWK0KSdYZ4B53Gyf6wRtomOKWgpNm7H7+DyfDhncdz9FKbpS+1jmDhg3F4WoGJ+yFOA==",
+ "license": "MIT",
+ "dependencies": {
+ "react-router": "7.18.0"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ }
+ },
"node_modules/rolldown": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz",
@@ -2420,6 +2472,12 @@
"semver": "bin/semver.js"
}
},
+ "node_modules/set-cookie-parser": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
+ "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",
+ "license": "MIT"
+ },
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
diff --git a/package.json b/package.json
index 9bc2fe0..a4ce236 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,8 @@
},
"dependencies": {
"react": "^19.2.6",
- "react-dom": "^19.2.6"
+ "react-dom": "^19.2.6",
+ "react-router-dom": "^7.18.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
diff --git a/src/App.css b/src/App.css
index f90339d..feac62a 100644
--- a/src/App.css
+++ b/src/App.css
@@ -1,184 +1,135 @@
-.counter {
- font-size: 16px;
- padding: 5px 10px;
- border-radius: 5px;
- color: var(--accent);
- background: var(--accent-bg);
- border: 2px solid transparent;
- transition: border-color 0.3s;
- margin-bottom: 24px;
-
- &:hover {
- border-color: var(--accent-border);
- }
- &:focus-visible {
- outline: 2px solid var(--accent);
- outline-offset: 2px;
- }
+.auth-page {
+ min-height: 100vh;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 2rem;
+ background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}
-.hero {
- position: relative;
-
- .base,
- .framework,
- .vite {
- inset-inline: 0;
- margin: 0 auto;
- }
-
- .base {
- width: 170px;
- position: relative;
- z-index: 0;
- }
-
- .framework,
- .vite {
- position: absolute;
- }
-
- .framework {
- z-index: 1;
- top: 34px;
- height: 28px;
- transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg)
- scale(1.4);
- }
-
- .vite {
- z-index: 0;
- top: 107px;
- height: 26px;
- width: auto;
- transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg)
- scale(0.8);
- }
-}
-
-#center {
+.auth-card {
+ background: #fff;
+ padding: 2rem;
+ border-radius: 12px;
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
+ width: 100%;
+ max-width: 420px;
display: flex;
flex-direction: column;
- gap: 25px;
- place-content: center;
- place-items: center;
- flex-grow: 1;
-
- @media (max-width: 1024px) {
- padding: 32px 20px 24px;
- gap: 18px;
- }
+ gap: 1rem;
}
-#next-steps {
+.auth-card h1 {
+ margin: 0;
+ color: #1e3a5f;
+ font-size: 1.5rem;
+}
+
+.auth-subtitle {
+ margin: 0;
+ color: #64748b;
+ font-size: 0.95rem;
+}
+
+.auth-card label {
display: flex;
- border-top: 1px solid var(--border);
- text-align: left;
-
- & > div {
- flex: 1 1 0;
- padding: 32px;
- @media (max-width: 1024px) {
- padding: 24px 20px;
- }
- }
-
- .icon {
- margin-bottom: 16px;
- width: 22px;
- height: 22px;
- }
-
- @media (max-width: 1024px) {
- flex-direction: column;
- text-align: center;
- }
+ flex-direction: column;
+ gap: 0.35rem;
+ font-size: 0.9rem;
+ color: #334155;
}
-#docs {
- border-right: 1px solid var(--border);
-
- @media (max-width: 1024px) {
- border-right: none;
- border-bottom: 1px solid var(--border);
- }
+.auth-card input {
+ padding: 0.65rem 0.75rem;
+ border: 1px solid #cbd5e1;
+ border-radius: 8px;
+ font-size: 1rem;
}
-#next-steps ul {
- list-style: none;
- padding: 0;
+.auth-card input:focus {
+ outline: 2px solid #3b82f6;
+ outline-offset: 1px;
+ border-color: #3b82f6;
+}
+
+.btn {
+ padding: 0.7rem 1rem;
+ border: none;
+ border-radius: 8px;
+ font-size: 1rem;
+ cursor: pointer;
+ font-weight: 600;
+}
+
+.btn:disabled {
+ opacity: 0.6;
+ cursor: not-allowed;
+}
+
+.btn-primary {
+ background: #1e3a5f;
+ color: #fff;
+}
+
+.btn-primary:hover:not(:disabled) {
+ background: #2d4a6f;
+}
+
+.btn-secondary {
+ background: #e2e8f0;
+ color: #1e293b;
+}
+
+.btn-secondary:hover {
+ background: #cbd5e1;
+}
+
+.error {
+ margin: 0;
+ padding: 0.65rem 0.75rem;
+ background: #fef2f2;
+ color: #b91c1c;
+ border-radius: 8px;
+ font-size: 0.9rem;
+}
+
+.loading {
+ text-align: center;
+ padding: 2rem;
+ color: #64748b;
+}
+
+.dashboard-page {
+ min-height: 100vh;
+ background: #f8fafc;
+}
+
+.dashboard-header {
display: flex;
- gap: 8px;
- margin: 32px 0 0;
-
- .logo {
- height: 18px;
- }
-
- a {
- color: var(--text-h);
- font-size: 16px;
- border-radius: 6px;
- background: var(--social-bg);
- display: flex;
- padding: 6px 12px;
- align-items: center;
- gap: 8px;
- text-decoration: none;
- transition: box-shadow 0.3s;
-
- &:hover {
- box-shadow: var(--shadow);
- }
- .button-icon {
- height: 18px;
- width: 18px;
- }
- }
-
- @media (max-width: 1024px) {
- margin-top: 20px;
- flex-wrap: wrap;
- justify-content: center;
-
- li {
- flex: 1 1 calc(50% - 8px);
- }
-
- a {
- width: 100%;
- justify-content: center;
- box-sizing: border-box;
- }
- }
+ justify-content: space-between;
+ align-items: center;
+ padding: 1.5rem 2rem;
+ background: #1e3a5f;
+ color: #fff;
}
-#spacer {
- height: 88px;
- border-top: 1px solid var(--border);
- @media (max-width: 1024px) {
- height: 48px;
- }
+.dashboard-header h1 {
+ margin: 0 0 0.25rem;
+ font-size: 1.5rem;
}
-.ticks {
- position: relative;
- width: 100%;
-
- &::before,
- &::after {
- content: '';
- position: absolute;
- top: -4.5px;
- border: 5px solid transparent;
- }
-
- &::before {
- left: 0;
- border-left-color: var(--border);
- }
- &::after {
- right: 0;
- border-right-color: var(--border);
- }
+.dashboard-header p {
+ margin: 0;
+ opacity: 0.9;
+}
+
+.dashboard-main {
+ padding: 2rem;
+ max-width: 960px;
+ margin: 0 auto;
+}
+
+.dashboard-main p {
+ margin: 0 0 1.5rem;
+ color: #475569;
}
diff --git a/src/App.tsx b/src/App.tsx
index a66b5ef..c5fa7f9 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,122 +1,29 @@
-import { useState } from 'react'
-import reactLogo from './assets/react.svg'
-import viteLogo from './assets/vite.svg'
-import heroImg from './assets/hero.png'
-import './App.css'
-
-function App() {
- const [count, setCount] = useState(0)
+import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
+import GuestRoute from "./components/GuestRoute";
+import ProtectedRoute from "./components/ProtectedRoute";
+import { AuthProvider } from "./context/AuthContext";
+import Dashboard from "./pages/Dashboard";
+import Login from "./pages/Login";
+import "./App.css";
+export default function App() {
return (
- <>
-
- Edit
-
-
-
Get started
- src/App.tsx and save to test HMR
-
Caricamento...
; + if (user) returnCaricamento...
; + if (!user) return+ Benvenuto, {user?.nome} {user?.cognome} + {user?.ruolo === "Amministratore" ? " (Amministratore)" : ""} +
+Area riservata agli operatori corrieri.
+
Connect with us
-Join the Vite community
---
-
-
- GitHub
-
-
- -
-
-
- Discord
-
-
- -
-
-
- X.com
-
-
- -
-
-
- Bluesky
-
-
-
-