refiling and api call for search (#11)

* refiling and api call for search

* updating allowed hosts

* update search

* proper api call

* search page working

* navbar

* small fixes

* fix types

---------

Co-authored-by: Sahej Panag <spanag3@gatech.edu>
Co-authored-by: afazio1 <alexa.fazio04@gmail.com>
This commit is contained in:
Sahej Panag
2024-04-20 23:22:45 -04:00
committed by GitHub
parent 5089a36bf7
commit 9e618803ed
12 changed files with 233 additions and 97 deletions

View File

@@ -31,12 +31,26 @@ export default function App() {
)
}
function Navbar() {
const linkStyle = {
textDecoration: 'none',
color: 'black',
background: '#B1D4E0',
padding: '8px 16px',
borderRadius: '5px',
margin: '0 5px'
};
const session = useContext(SessionContext);
const logout = () => {
destroySessionCookie();
window.location.reload();
}
const links = session ? (
<>
<Link to="/">Home</Link>
<Link to="/login" onClick={destroySessionCookie}>Logout</Link>
<img src="/PeerNotes.png" alt="PeerNotes Logo" style={{ height: '60px', marginRight: '10px' }} />
<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>