diff --git a/src/App.css b/src/App.css index 74b5e05..d380993 100644 --- a/src/App.css +++ b/src/App.css @@ -1,38 +1,23 @@ -.App { - text-align: center; +* { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; } -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} -.App-header { - background-color: #282c34; - min-height: 100vh; +.cardContainer { display: flex; - flex-direction: column; align-items: center; justify-content: center; - font-size: calc(10px + 2vmin); - color: white; + + ; } -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} +.priceFormat { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-size: 2rem; + align-content: center; +} \ No newline at end of file diff --git a/src/Components/ProductCards.js b/src/Components/ProductCards.js index ed323ca..b254426 100644 --- a/src/Components/ProductCards.js +++ b/src/Components/ProductCards.js @@ -1,26 +1,32 @@ -import Button from 'react-bootstrap/Button'; -import Card from 'react-bootstrap/Card'; +import Button from "react-bootstrap/Button"; +import Card from "react-bootstrap/Card"; function ProductCards({ products }) { - - - return ( -
- {products.map((products) => ( - - - - {products.prodname} - - {products.description} - - - - - - ))} -
- ); + return ( + <> + {products.map((products) => ( +
+ + + + {products.prodname} + + {products.description} +
+
+ ${products.price} +
+ +
+
+
+ ))} + + ); } export default ProductCards; diff --git a/src/Components/StoreFront.js b/src/Components/StoreFront.js index 5b2d6c6..c919721 100644 --- a/src/Components/StoreFront.js +++ b/src/Components/StoreFront.js @@ -1,31 +1,28 @@ -import {useState, useEffect} from 'react'; -import { API } from '../API/Api'; -import ProductCards from './ProductCards' -import '../../node_modules/bootstrap/dist/css/bootstrap.css' - - -export default function StoreFront(){ -const [products, setProducts] = useState([]); - - - -useEffect(() => { - fetchProducts(); -}, []); - - - -const fetchProducts = async () => {const addProduct = await API.getProducts(); - console.log(addProduct); - setProducts(addProduct); - console.log(addProduct); -}; - -console.log(products); -return( -
- -
-) - -} \ No newline at end of file +import { useState, useEffect } from "react"; +import { API } from "../API/Api"; +import ProductCards from "./ProductCards"; +import "../../node_modules/bootstrap/dist/css/bootstrap.css"; + +export default function StoreFront() { + const [products, setProducts] = useState([]); + + useEffect(() => { + fetchProducts(); + }, []); + + const fetchProducts = async () => { + const addProduct = await API.getProducts(); + console.log(addProduct); + setProducts(addProduct); + console.log(addProduct); + }; + + console.log(products); + return ( +
+
+ +
+
+ ); +}