-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
465 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,71 @@ | ||
import React from 'react'; | ||
navbar.jsx | ||
import React, { useState } from 'react'; | ||
import { useAuth0 } from '@auth0/auth0-react'; | ||
import '../styles/navbar.css'; // Asegúrate de que la ruta del CSS es correcta | ||
import '../styles/footer.css'; | ||
import { Link } from 'react-router-dom'; | ||
import logo from '../assets/logoo.png'; | ||
import whatsapp from '../assets/whatsapp.png'; | ||
import { FaBars } from 'react-icons/fa'; // Importar el icono de hamburguesa | ||
|
||
function NavBar() { | ||
const { loginWithRedirect, logout, isAuthenticated } = useAuth0(); | ||
const { loginWithRedirect, isAuthenticated } = useAuth0(); | ||
const [menuOpen, setMenuOpen] = useState(false); // Estado para manejar el menú | ||
|
||
const toggleMenu = () => { | ||
setMenuOpen(!menuOpen); // Alternar estado del menú | ||
}; | ||
|
||
return ( | ||
<div className="navbar"> | ||
|
||
<div className="navbar-content"> | ||
<Link to="/"> | ||
<img src={logo} className="navbar-logo" alt="Logo" /> | ||
</Link> | ||
<div className="navbar-links"> | ||
<Link to="/"> | ||
<img src={logo} className="navbar-logo"></img> | ||
</Link> | ||
<Link to="/inicio" className="footer-link">Inicio</Link> | ||
|
||
<Link to="/mapa-navegacion" className="footer-link">Mapa</Link> | ||
|
||
{/* <a href="/publicar">Publicar</a> */} | ||
<Link to="/servicios" className="footer-link">Servicios</Link> | ||
<Link to="/cerca" className="footer-link">A mi alrededor</Link> | ||
|
||
{isAuthenticated && ( | ||
<Link to="/mi-perfil" className="footer-link">Mi Perfil</Link> | ||
)} | ||
{isAuthenticated && ( | ||
<Link to="/publicaciones" className="footer-link">Mis Publicaciones</Link> | ||
<> | ||
<Link to="/mi-perfil" className="footer-link">Mi Perfil</Link> | ||
<Link to="/publicaciones" className="footer-link">Mis Publicaciones</Link> | ||
<Link to="/favoritos" className="footer-link">Mis Favoritos</Link> | ||
<Link to="/notificaciones" className="footer-link">Enviar notificaciones a usuarios</Link> | ||
</> | ||
)} | ||
{isAuthenticated && ( | ||
<Link to="/favoritos" className="footer-link">Mis Favoritos</Link> | ||
|
||
{!isAuthenticated && ( | ||
<a className="footer-link" onClick={loginWithRedirect}>Iniciar sesión</a> | ||
)} | ||
</div> | ||
<FaBars className="navbar-hamburger" onClick={toggleMenu} /> {/* Icono de hamburguesa */} | ||
</div> | ||
<div className="whatsapp-container" onClick={() => alert('Connecting to WhatsApp')}> | ||
<img src={whatsapp} className="whatsapp-icon" alt="WhatsApp" /> | ||
</div> | ||
{menuOpen && ( // Mostrar el menú si está abierto | ||
<div className="navbar-dropdown"> | ||
<Link to="/inicio" className="footer-link" onClick={toggleMenu}>Inicio</Link> | ||
<Link to="/mapa-navegacion" className="footer-link" onClick={toggleMenu}>Mapa</Link> | ||
<Link to="/servicios" className="footer-link" onClick={toggleMenu}>Servicios</Link> | ||
<Link to="/cerca" className="footer-link" onClick={toggleMenu}>A mi alrededor</Link> | ||
|
||
{isAuthenticated && ( | ||
<Link to="/notificaciones" className="footer-link">Enviar notificaciones a usuarios</Link> | ||
<> | ||
<Link to="/mi-perfil" className="footer-link" onClick={toggleMenu}>Mi Perfil</Link> | ||
<Link to="/publicaciones" className="footer-link" onClick={toggleMenu}>Mis Publicaciones</Link> | ||
<Link to="/favoritos" className="footer-link" onClick={toggleMenu}>Mis Favoritos</Link> | ||
<Link to="/notificaciones" className="footer-link" onClick={toggleMenu}>Enviar notificaciones a usuarios</Link> | ||
</> | ||
)} | ||
|
||
{!isAuthenticated ? ( | ||
<a className="footer-link" onClick={loginWithRedirect} >Iniciar sesión</a> | ||
) : ( | ||
<a className="footer-link" onClick={() => logout({ returnTo: window.location.origin })}>Cerrar sesión</a> | ||
|
||
{!isAuthenticated && ( | ||
<a className="footer-link" onClick={() => { loginWithRedirect(); toggleMenu(); }}>Iniciar sesión</a> | ||
)} | ||
|
||
</div> | ||
|
||
</div> | ||
<div onClick={() => alert('Connecting to WhatsApp')}> | ||
<img src={whatsapp} className="navbar-logo"></img> | ||
|
||
</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default NavBar; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.