Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate components page #21

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import App from "./App";

test("renders stompy urdf link", () => {
render(<App />);
const linkElement = screen.getByText(/Listings/i);
const linkElement = screen.getByText(/Robots/i);
expect(linkElement).toBeInTheDocument();
});
37 changes: 12 additions & 25 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
import "bootstrap/dist/css/bootstrap.min.css";
import Authentication from "components/Authentication";
import Listings from "components/Listings";
import TopNavbar from "components/nav/NavBar";
import NotFoundRedirect from "components/NotFoundRedirect";
import ComponentDetails from "pages/ComponentDetails";
import Components from "pages/Components";
import Home from "pages/Home";
import NotFound from "pages/NotFound";
import RobotDetails from "pages/Robot";
import { Container, Nav, Navbar } from "react-bootstrap";
import { BrowserRouter, Link, Route, Routes } from "react-router-dom";
import RobotDetails from "pages/RobotDetails";
import Robots from "pages/Robots";
import { Container } from "react-bootstrap";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import "./App.css";

const App = () => {
return (
<BrowserRouter>
<Container>
<Navbar className="bg-body-tertiary">
<Container>
<Navbar.Brand as={Link} to="/">
robolist
</Navbar.Brand>
<Navbar.Toggle />
<Navbar.Collapse className="justify-content-end">
<Nav>
<Nav.Link as={Link} to="/robots/">
Listings
</Nav.Link>
</Nav>
<Navbar.Text>
<Authentication />
</Navbar.Text>
</Navbar.Collapse>
</Container>
</Navbar>
<TopNavbar />

<Container className="mt-3">
<Routes>
<Route path="/" element={<Home />} />
<Route path="/robots/" element={<Listings />} />
<Route path="/robots/:id" element={<RobotDetails />} />
<Route path="/robots/" element={<Robots />} />
<Route path="/robot/:id" element={<RobotDetails />} />
<Route path="/components/" element={<Components />} />
<Route path="/component/:id" element={<ComponentDetails />} />
<Route path="/404" element={<NotFound />} />
<Route path="*" element={<NotFoundRedirect />} />
</Routes>
Expand Down
66 changes: 0 additions & 66 deletions frontend/src/components/Listings.tsx

This file was deleted.

31 changes: 31 additions & 0 deletions frontend/src/components/nav/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Authentication from "components/Authentication";
import { Container, Nav, Navbar } from "react-bootstrap";
import { Link } from "react-router-dom";

const TopNavbar = () => {
return (
<Navbar className="bg-body-tertiary">
<Container>
<Navbar.Brand as={Link} to="/">
robolist
</Navbar.Brand>
<Navbar.Toggle />
<Navbar.Collapse className="justify-content-end">
<Nav>
<Nav.Link as={Link} to="/robots/">
Robots
</Nav.Link>
<Nav.Link as={Link} to="/components/">
Components
</Nav.Link>
</Nav>
<Navbar.Text>
<Authentication />
</Navbar.Text>
</Navbar.Collapse>
</Container>
</Navbar>
);
};

export default TopNavbar;
Loading
Loading