Commit 704e3419 authored by Ben Anderson's avatar Ben Anderson

Added link to new product form in products page header

parent af70a1fa
...@@ -37,7 +37,9 @@ export default function Main() { ...@@ -37,7 +37,9 @@ export default function Main() {
<AuthRoute exact path="/"> <AuthRoute exact path="/">
<Redirect to="/products" /> <Redirect to="/products" />
</AuthRoute> </AuthRoute>
<AuthRoute>404 PAGE</AuthRoute> <AuthRoute>
<h1>404 Page Not Found</h1>
</AuthRoute>
</Switch> </Switch>
</div> </div>
); );
......
...@@ -3,7 +3,8 @@ import Product from "./Product.jsx"; ...@@ -3,7 +3,8 @@ import Product from "./Product.jsx";
import { Col, Container, Row } from "react-bootstrap"; import { Col, Container, Row } from "react-bootstrap";
import "./../styles/ProductGrid.css"; import "./../styles/ProductGrid.css";
import Config from "../config.js"; import Config from "../config.js";
import { set } from "react-hook-form"; import { Link } from "react-router-dom";
export default function ProductGrid({ productData }) { export default function ProductGrid({ productData }) {
const [products, setProducts] = useState([]); const [products, setProducts] = useState([]);
...@@ -19,9 +20,14 @@ export default function ProductGrid({ productData }) { ...@@ -19,9 +20,14 @@ export default function ProductGrid({ productData }) {
return ( return (
<div> <div>
<h1 id="title" className="text-center"> <div className="container mt-3 d-flex justify-content-between align-items-center">
Inventory <h1 id="title" className="text-center">
</h1> Inventory
</h1>
<Link type="link" className="btn btn-success" to="/products/new">
+ New Product
</Link>
</div>
<Container id="prod-grid" className="mt-3"> <Container id="prod-grid" className="mt-3">
<Row xs={1} sm={2} md={3} lg={4}> <Row xs={1} sm={2} md={3} lg={4}>
{products.map((product) => { {products.map((product) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment