remade frontend
This commit is contained in:
parent
02281120dc
commit
36d99b1e35
45 changed files with 1290 additions and 4979 deletions
5
frontend/src/Components/Navbar/Navbar.module.scss
Normal file
5
frontend/src/Components/Navbar/Navbar.module.scss
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.navbar {
|
||||
display: grid;
|
||||
grid-template-columns: 10% 80% 10%;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
33
frontend/src/Components/Navbar/Navbar.tsx
Normal file
33
frontend/src/Components/Navbar/Navbar.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { Navbar as BsNavbar, Container } from "react-bootstrap";
|
||||
// import styles from "./Navbar.module.scss";
|
||||
import Searchbar from "../Searchbar/Searchbar";
|
||||
import { useState } from "react";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
|
||||
const Navbar = () => {
|
||||
const [searchText, setSearchText] = useState<string>("");
|
||||
const navigate = useNavigate();
|
||||
|
||||
function onSearch() {
|
||||
navigate(`/search?search=${searchText}`);
|
||||
setSearchText("");
|
||||
}
|
||||
|
||||
return (
|
||||
<BsNavbar expand="lg" className={"bg-light "}>
|
||||
<Container>
|
||||
<Link to={"/"} style={{ textDecoration: "none" }}>
|
||||
<BsNavbar.Brand>JellyGlass</BsNavbar.Brand>
|
||||
</Link>
|
||||
<BsNavbar.Toggle />
|
||||
<BsNavbar.Collapse>
|
||||
<Container className="justify-content-center d-flex">
|
||||
<Searchbar text={searchText} setText={setSearchText} onSearch={onSearch} />
|
||||
</Container>
|
||||
</BsNavbar.Collapse>
|
||||
</Container>
|
||||
</BsNavbar>
|
||||
)
|
||||
}
|
||||
|
||||
export default Navbar;
|
||||
Loading…
Add table
Add a link
Reference in a new issue