diff --git a/README.md b/README.md index 25e78a5..54485d5 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ Fork, clone, run yarn install, yarn start, pull request * Create a component folder to hold component files * Organize this web page into appropriate components * ProductDetail - find a div with className="col-sm-4 col-lg-4 col-md-4" - * Header - find a div with className="navbar-header" - * Footer - find a footer element - * Carousel - find a div with className="row carousel-holder" + + + * The ProductDetail should repesent only one single product * The ProductDetail should take a prop called product with is an object, and use it to populate price, name, description reviews and stars. * Make sure each component is in its own file and imported into App.js * Use the provided data in state.js to dynamically populate information instead of the hard coded html that is there now. -* In index.js provide App with a prop called "products" sending in the product array +* In index.js provide App with a prop called "products" sending in the product array * App should use the product prop and map the array of products into an array of ProductDetail components * Make the star images represent the number rating from data diff --git a/src/App.js b/src/App.js index 4139cab..470d105 100644 --- a/src/App.js +++ b/src/App.js @@ -1,24 +1,27 @@ import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; +import Header from './ComponentFolder/Header'; +import Footer from './ComponentFolder/Footer'; +import Carousel from './ComponentFolder/Carousel'; +import ProductDetail from './ComponentFolder/ProductDetail'; -function App() { +function App(props) { + + // MAPPING THROUGH THE PRODUCTS + const prodDetails = props.products.map((product, keys) => { + return ; +}); + + // WHAT YOURE GOING TO SHOW return (
- + - +
-

Shop Name

+

Collins Random Ass Shit

Category 1 Category 2 @@ -53,155 +56,12 @@ function App() {
-
- -
- -
- -
+
-
-
- -
-

$24.99

-

First Product -

-

See more snippets like this online store item at Bootsnipp - http://bootsnipp.com.

-
-
-

15 reviews

-

- - - - - -

-
-
-
- -
-
- -
-

$64.99

-

Second Product -

-

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
-
-

12 reviews

-

- - - - - -

-
-
-
- -
-
- -
-

$74.99

-

Third Product -

-

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
-
-

31 reviews

-

- - - - - -

-
-
-
- -
-
- -
-

$84.99

-

Fourth Product -

-

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
-
-

6 reviews

-

- - - - - -

-
-
-
- -
-
- -
-

$94.99

-

Fifth Product -

-

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
-
-

18 reviews

-

- - - - - -

-
-
-
- -
-

Like this template? -

-

If you like this template, then check out this tutorial on how to build a working review system for your online store!

- View Tutorial -
+ + {prodDetails}
@@ -210,19 +70,13 @@ function App() {
- +

- -
-
-
-

Copyright © Your Website 2014

-
-
-
+ +
diff --git a/src/ComponentFolder/Carousel.js b/src/ComponentFolder/Carousel.js new file mode 100644 index 0000000..d954335 --- /dev/null +++ b/src/ComponentFolder/Carousel.js @@ -0,0 +1,38 @@ +import React from 'react'; + +function Carousel() { + return( +
+ +
+ +
+ +
+ ); +} + +export default Carousel; diff --git a/src/ComponentFolder/Footer.js b/src/ComponentFolder/Footer.js new file mode 100644 index 0000000..1d97461 --- /dev/null +++ b/src/ComponentFolder/Footer.js @@ -0,0 +1,14 @@ +import React from "react"; + +function Footer() { + return (
+
+
+

Copyright © Your Website 2014

+
+
+
+ ); +} + +export default Footer; diff --git a/src/ComponentFolder/Header.js b/src/ComponentFolder/Header.js new file mode 100644 index 0000000..e8bab75 --- /dev/null +++ b/src/ComponentFolder/Header.js @@ -0,0 +1,17 @@ +import React from "react"; + +function Header(){ + return ( +
+ + Fuck the User +
+ ); +} + +export default Header; diff --git a/src/ComponentFolder/ProductDetail.js b/src/ComponentFolder/ProductDetail.js new file mode 100644 index 0000000..16e7e65 --- /dev/null +++ b/src/ComponentFolder/ProductDetail.js @@ -0,0 +1,30 @@ +import React from "react"; + +function ProductDetail(props){ + + return( +
+
+ +
+

{props.products.price}

+

{props.products.name} +

+

{props.products.description} Bootsnipp-http://bootsnipp.com +

+
+ +
+ +
+
+

{props.products.reviews}

+

+

+
+
+
+ ) +}; + +export default ProductDetail; diff --git a/src/index.js b/src/index.js index e58303d..2172f97 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,11 @@ import App from './App'; import './index.css'; import state from './state'; -ReactDOM.render( - , - document.getElementById('root') -); +// +// function increaseCart(){ +// console.log(state.numberOfItemsInCart +=1); +// reactDom.render(, document.getElementById("root")); +// } + +ReactDOM.render(, document.getElementById('root')); +//this variabel "products" is equal to {state.products} and when using variable name "props"will preceed. i.e. props.product. diff --git a/src/state.js b/src/state.js index b54e269..02415bf 100644 --- a/src/state.js +++ b/src/state.js @@ -1,7 +1,7 @@ export default { products:[{ "id": 1, - "name": "Body Luxuries Sweet Lavender Hand Sanitizer", + "name": "Too many Words", "description": "Psychotropic drugs, not elsewhere classified", "reviews": 46, "rating": 2, @@ -41,7 +41,7 @@ export default { "price": "$70.10" }, { "id": 6, - "name": "Fresh Sugar Honey Tinted Lip Treatment SPF15", + "name": "Less Werds", "description": "this stuff is awesome", "reviews": 79, "rating": 3, @@ -80,4 +80,4 @@ export default { "imgUrl": "http://dummyimage.com/189x109.png/cc0000/ffffff", "price": "$74.37" }] -} \ No newline at end of file +}