Commit inicial - Sistema de Gestion Hotelera Hacienda San Angel
- Backend Node.js/Express con PostgreSQL - Frontend React 19 con Vite - Docker Compose para orquestacion - Documentacion completa en README.md - Scripts SQL para base de datos - Configuracion de ejemplo (.env.example)
This commit is contained in:
53
frontend/Frontend-Hotel/src/components/Navbar/Navbar.css
Normal file
53
frontend/Frontend-Hotel/src/components/Navbar/Navbar.css
Normal file
@@ -0,0 +1,53 @@
|
||||
z/* src/styles/Navbar.css */
|
||||
|
||||
.navbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #4a0d0d; /* Marrón oscuro */
|
||||
padding: 12px 20px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.navbar__brand {
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.navbar__nav {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.nav__link {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.nav__link.active {
|
||||
border-bottom: 2px solid #f8d47b; /* Amarillo suave */
|
||||
}
|
||||
|
||||
.navbar__actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 6px 12px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.btn--primary {
|
||||
background-color: #f8d47b; /* Amarillo */
|
||||
color: #4a0d0d;
|
||||
}
|
||||
|
||||
.btn--secondary {
|
||||
background-color: #ddd;
|
||||
color: #333;
|
||||
}
|
||||
33
frontend/Frontend-Hotel/src/components/Navbar/Navbar.jsx
Normal file
33
frontend/Frontend-Hotel/src/components/Navbar/Navbar.jsx
Normal file
@@ -0,0 +1,33 @@
|
||||
// src/components/Navbar.jsx
|
||||
import { NavLink, useNavigate } from "react-router-dom";
|
||||
import { useAuth } from "../../context/AuthContext.jsx";
|
||||
import "./Navbar.css"; // estilos separados
|
||||
|
||||
export default function Navbar() {
|
||||
const { isAuthenticated, logout } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleLogout = () => {
|
||||
logout();
|
||||
navigate("/"); // 👈 al cerrar sesión vuelve al Login
|
||||
};
|
||||
|
||||
return (
|
||||
<header className="navbar">
|
||||
<div className="navbar__brand"></div>
|
||||
|
||||
<div className="navbar__actions">
|
||||
{isAuthenticated ? (
|
||||
<button className="btn btn--secondary" onClick={handleLogout}>
|
||||
Logout
|
||||
</button>
|
||||
) : (
|
||||
<NavLink to="/" className="btn btn--primary">
|
||||
Login
|
||||
</NavLink>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user