Merge branch 'api_call_search_sahej' of https://github.com/AmanTahiliani/PeerNotes into api_call_search_sahej

This commit is contained in:
afazio1
2024-04-20 23:13:29 -04:00
2 changed files with 26 additions and 10 deletions

View File

@@ -31,6 +31,14 @@ export default function App() {
) )
} }
function Navbar() { function Navbar() {
const linkStyle = {
textDecoration: 'none',
color: 'black',
background: '#B1D4E0',
padding: '8px 16px',
borderRadius: '5px',
margin: '0 5px'
};
const session = useContext(SessionContext); const session = useContext(SessionContext);
const logout = () => { const logout = () => {
destroySessionCookie(); destroySessionCookie();
@@ -39,8 +47,10 @@ function Navbar() {
const links = session ? ( const links = session ? (
<> <>
<Link to="/">Home</Link> <img src="/PeerNotes.png" alt="PeerNotes Logo" style={{ height: '60px', marginRight: '10px' }} />
<a onClick={logout}>Logout</a> <Link to="/" style={linkStyle}>Home</Link>
<Link to="/search" style={linkStyle}>Search</Link>
<a onClick={logout} style={linkStyle}>Logout</a>
</> </>
): ( ): (
<Link to="/login">Login</Link> <Link to="/login">Login</Link>

View File

@@ -3,10 +3,16 @@ nav {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 1rem 2rem; padding: 1rem 2rem;
border: 3px solid #f1f1f1; margin: 0;
border-radius: 5px; width: 100%;
color: black; background-color: #145DA0;
background-color: white; border: none;
border-radius: 0;
position: fixed;
top: 0;
left: 0;
z-index: 1000;
box-sizing: border-box;
} }
.App { .App {
display: flex; display: flex;