Your Cart
- {/* Write some code here... */}
+ {cartItems.map((item, index) => (
+ -
+
+ {item.name}
+
+ {item.quantity}
+
+
+ ))}
@@ -39,7 +212,9 @@ export default function App() {
Total
- £0.00
+
+ £{Math.abs(totalCost).toFixed(2)}
+
@@ -57,5 +232,5 @@ export default function App() {
>
- )
+ );
}
diff --git a/src/store-items.js b/src/store-items.js
index 8e8013c..d427e77 100644
--- a/src/store-items.js
+++ b/src/store-items.js
@@ -1,55 +1,64 @@
-
-const storeItems = [
+const storeItems = [
{
id: "001-beetroot",
name: "beetroot",
- price: 0.35
+ price: 0.1,
+ type: "vegetable",
},
{
id: "002-carrot",
name: "carrot",
- price: 0.35
+ price: 0.15,
+ type: "vegetable",
},
{
id: "003-apple",
name: "apple",
- price: 0.35
+ price: 0.3,
+ type: "fruit",
},
{
id: "004-apricot",
name: "apricot",
- price: 0.35
+ price: 0.2,
+ type: "fruit",
},
{
id: "005-avocado",
name: "avocado",
- price: 0.35
+ price: 0.35,
+ type: "fruit",
},
{
id: "006-bananas",
name: "bananas",
- price: 0.35
+ price: 0.4,
+ type: "fruit",
},
{
id: "007-bell-pepper",
name: "bell pepper",
- price: 0.35
+ price: 0.45,
+ type: "fruit",
},
{
id: "008-berry",
name: "berry",
- price: 0.35
+ price: 0.5,
+ type: "berry",
},
{
id: "009-blueberry",
name: "blueberry",
- price: 0.35
+ price: 0.55,
+ type: "berry",
},
{
id: "010-eggplant",
name: "eggplant",
- price: 0.35
- }
-]
+ price: 0.6,
+ type: "vegetable",
+ },
+];
-export default storeItems
\ No newline at end of file
+export default storeItems;
diff --git a/src/styles/index.css b/src/styles/index.css
index 0a04c2b..a804342 100644
--- a/src/styles/index.css
+++ b/src/styles/index.css
@@ -182,3 +182,12 @@ button {
border-bottom: 2px solid #00675b;
}
}
+
+.filter li, .sorting li {
+ display: inline-block;
+ margin-right: 10px;
+}
+
+.sort, .filter {
+ list-style: none;
+}
\ No newline at end of file