Skip to content
Open
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
18 changes: 9 additions & 9 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
### Setup
Fork, Clone, yarn install, yarn start
DONE --- Fork, Clone, yarn install, yarn start

### Do
* Take the html out of the App component and put in separate components
* Header - look for div with a className of "top-header"
* Footer - look for div with a className of "footer"
* ImageSlider - look for div with className of "image-slider"
* ProductDetail - look for div with className of "grid_1_of_5"
* DONE --- Header - look for div with a className of "top-header"
* DONE --- Footer - look for div with a className of "footer"
* DONE --- ImageSlider - look for div with className of "image-slider"
* DONE --- ProductDetail - look for div with className of "grid_1_of_5"
* Use PropTypes to require a prop "product"
* Use product prop to populate the UI instead of hard coded
* SubHeader - look for div with className of "sub-header"
* TopNav - look for div with className of "top-nav"
* Make sure to import and use all these components back in App
* Use product prop to populate the UI instead of hard coded
* DONE --- SubHeader - look for div with className of "sub-header"
* DONE --- TopNav - look for div with className of "top-nav"
* DONE --- Make sure to import and use all these components back in App
* Create a variable in index.js called currentCategory and set it to "tires"
* Create a function in index.js called changeCategory thats takes a parameter category. It will assign category to currentCategory and call render()
* Send the changeCategory function to App and then to the TopNav component by way of props
Expand Down
Empty file modified package.json
100644 → 100755
Empty file.
Empty file modified public/favicon.ico
100644 → 100755
Empty file.
Empty file modified src/App.css
100644 → 100755
Empty file.
164 changes: 21 additions & 143 deletions src/App.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,117 +1,38 @@
import React from "react";
import Header from "./components/Header";
import Footer from "./components/Footer";
import ImageSlider from "./components/ImageSlider";
import ProductDetail from "./components/ProductDetail";
import SubHeader from "./components/SubHeader";
import TopNav from "./components/TopNav";
import "./App.css";


function App(props) {
return (
<div className="App">
<div className="wrap">

<div className="header">

<div className="top-header">
<div className="top-header-left">
<ul>
<li className="active"><a href="#">Home</a></li>
<li><a href="#">Specials</a></li>
<li><a href="#">Delivery</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div className="top-header-right">
<ul>
<li><a href="#">CURRENCY:</a></li>
<li>
<select>
<option>Dollar</option>
<option>Euro</option>
<option>Pound</option>
</select>
</li>
</ul>
</div>
<div className="clear"> </div>
</div>

<Header />

<div className="clear"> </div>
<div className="sub-header">
<div className="logo">
<a href="index.html"><img src="images/logo.png" title="logo" /></a>
</div>
<div className="sub-header-right">
<ul>
<li><a href="#">log in</a></li>
<li><a href="#">Your account</a></li>
<li><a href="#">CART: (EMPTY) <img src="images/cart.png" title="cart" /></a></li>
</ul>
<input type="text" /><input type="submit" value="search" />
</div>
<div className="clear"> </div>
</div>
<SubHeader />
<div className="clear"> </div>
<div className="top-nav">
<ul>
<li><a href="carlights.html">car lights</a></li>
<li><a href="carwheels.html">Car wheels</a></li>
<li><a href="carbumpers.html">car bumpers</a></li>
<li><a href="caradsystem.html">car audiosystem</a></li>
<li><a href="truckbumpers.html">Truck bumpers</a></li>
<li><a href="contact.html">Feedback</a></li>
<div className="clear"> </div>
</ul>
</div>

<TopNav />

</div>


<div className="image-slider">

<ul className="rslides" id="slider1">
<li><img src="images/slider1.jpg" alt="" /></li>
<li><img src="images/slider3.jpg" alt="" /></li>
<li><img src="images/slider1.jpg" alt="" /></li>
</ul>

</div>



<ImageSlider />

<div className="content">
<div className="products-box">
<div className="products">
<h5><span>FEATURED</span> PRODUCTS</h5>
<div className="section group">
<div className="grid_1_of_5 images_1_of_5">
<img src="images/g3.png" />
<h3>Lorem Ipsum is simply </h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, in reprehenderit.</p>
<h4>$512.00</h4>
<div className="button"><span><a href="singlepage.html">Read More</a></span></div>
</div>
<div className="grid_1_of_5 images_1_of_5">
<img src="images/g1.jpg" />
<h3>Lorem Ipsum is simply </h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, in reprehenderit.</p>
<h4>$300.00</h4>
<div className="button"><span><a href="singlepage.html">Read More</a></span></div>
</div>
<div className="grid_1_of_5 images_1_of_5">
<img src="images/g2.jpg" />
<h3>Lorem Ipsum is simply </h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, in reprehenderit.</p>
<h4>$120.00</h4>
<div className="button"><span><a href="singlepage.html">Read More</a></span></div>
</div>
<div className="grid_1_of_5 images_1_of_5">
<img src="images/g3.png" />
<h3>Lorem Ipsum is simply </h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, in reprehenderit.</p>
<h4>$500.00</h4>
<div className="button"><span><a href="singlepage.html">Read More</a></span></div>
</div>
<div className="grid_1_of_5 images_1_of_5">
<img src="images/g4.jpg" />
<h3>Lorem Ipsum is simply</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, in reprehenderit.</p>
<h4>$120.00</h4>
<div className="button"><span><a href="singlepage.html">Read More</a></span></div>
</div>
<ProductDetail/>
</div>
</div>
<div className="products products-secondbox">
Expand Down Expand Up @@ -157,52 +78,9 @@ function App(props) {
</div>
</div>
<div className="clear"> </div>
<div className="footer">
<div className="section group">
<div className="col_1_of_4 span_1_of_4">
<h3>INFORMATION</h3>
<ul>
<li><a href="#">About us</a></li>
<li><a href="#">Sitemap</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Terms and conditions</a></li>
<li><a href="#">Legal Notice</a></li>
</ul>
</div>
<div className="col_1_of_4 span_1_of_4">
<h3>OUR OFFERS</h3>
<ul>
<li><a href="#">New products</a></li>
<li><a href="#">top sellers</a></li>
<li><a href="#">Specials</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Comments</a></li>
</ul>
</div>
<div className="col_1_of_4 span_1_of_4">
<h3>YOUR ACCOUNT</h3>
<ul>
<li><a href="#">Your Account</a></li>
<li><a href="#">Personal info</a></li>
<li><a href="#">Prices</a></li>
<li><a href="#">Address</a></li>
<li><a href="#">Locations</a></li>
</ul>
</div>
<div className="col_1_of_4 span_1_of_4 footer-lastgrid">
<h3>Get in touch</h3>
<ul>
<li><a href="#"><img src="images/facebook.png" title="facebook" /></a></li>
<li><a href="#"><img src="images/twitter.png" title="Twiiter" /></a></li>
<li><a href="#"><img src="images/rss.png" title="Rss" /></a></li>
<li><a href="#"><img src="images/gpluse.png" title="Google+" /></a></li>
</ul>
<p>Design by <a href="#">W3layouts</a></p>
</div>
</div>
</div>
<Footer />
</div>

</div>
);
}
Expand Down
Empty file modified src/App.test.js
100644 → 100755
Empty file.
51 changes: 51 additions & 0 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from "react";

function Footer() {
return ( <div className="footer">
<div className="section group">
<div className="col_1_of_4 span_1_of_4">
<h3>INFORMATION</h3>
<ul>
<li><a href="#">About us</a></li>
<li><a href="#">Sitemap</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Terms and conditions</a></li>
<li><a href="#">Legal Notice</a></li>
</ul>
</div>
<div className="col_1_of_4 span_1_of_4">
<h3>OUR OFFERS</h3>
<ul>
<li><a href="#">New products</a></li>
<li><a href="#">top sellers</a></li>
<li><a href="#">Specials</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Comments</a></li>
</ul>
</div>
<div className="col_1_of_4 span_1_of_4">
<h3>YOUR ACCOUNT</h3>
<ul>
<li><a href="#">Your Account</a></li>
<li><a href="#">Personal info</a></li>
<li><a href="#">Prices</a></li>
<li><a href="#">Address</a></li>
<li><a href="#">Locations</a></li>
</ul>
</div>
<div className="col_1_of_4 span_1_of_4 footer-lastgrid">
<h3>Get in touch</h3>
<ul>
<li><a href="#"><img src="images/facebook.png" title="facebook" /></a></li>
<li><a href="#"><img src="images/twitter.png" title="Twiiter" /></a></li>
<li><a href="#"><img src="images/rss.png" title="Rss" /></a></li>
<li><a href="#"><img src="images/gpluse.png" title="Google+" /></a></li>
</ul>
<p>Design by <a href="#">W3layouts</a></p>
</div>
</div>
</div>
);
}

export default Footer;
25 changes: 24 additions & 1 deletion src/components/Header.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
import React from "react";

function Header() {
return (<div />);
return (
<div className="top-header">
<div className="top-header-left">
<ul>
<li className="active"><a href="#">Home</a></li>
<li><a href="#">Specials</a></li>
<li><a href="#">Delivery</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div className="top-header-right">
<ul>
<li><a href="#">CURRENCY:</a></li>
<li>
<select>
<option>Dollar</option>
<option>Euro</option>
<option>Pound</option>
</select>
</li>
</ul>
</div>
<div className="clear"> </div>
</div>);
}

export default Header;
15 changes: 15 additions & 0 deletions src/components/ImageSlider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";

function ImageSlider() {
return (
<div className="image-slider">
<ul className="rslides" id="slider1">
<li><img src="images/slider1.jpg" alt="" /></li>
<li><img src="images/slider3.jpg" alt="" /></li>
<li><img src="images/slider1.jpg" alt="" /></li>
</ul>
</div>
);
}

export default ImageSlider;
22 changes: 22 additions & 0 deletions src/components/ProductDetail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import PropTypes from "prop-types";

function ProductDetail(props) {
console.log(props);
// Always define before using props. Could be in context of map fnc or not
return (
<div className="grid_1_of_5 images_1_of_5">
<img src="images/g3.png" />
<h3>Lorem Ipsum is simply </h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, in reprehenderit.</p>
<h4>$512.00</h4>
<div className="button"><span><a href="singlepage.html">Read More</a></span></div>
</div>
);
}

ProductDetail.propTypes = {
product: PropTypes.object.isRequired
};

export default ProductDetail;
22 changes: 22 additions & 0 deletions src/components/SubHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";

function SubHeader() {
return(
<div className="sub-header">
<div className="logo">
<a href="index.html"><img src="images/logo.png" title="logo" /></a>
</div>
<div className="sub-header-right">
<ul>
<li><a href="#">log in</a></li>
<li><a href="#">Your account</a></li>
<li><a href="#">CART: (EMPTY) <img src="images/cart.png" title="cart" /></a></li>
</ul>
<input type="text" /><input type="submit" value="search" />
</div>
<div className="clear"> </div>
</div>
);
}

export default SubHeader;
19 changes: 19 additions & 0 deletions src/components/TopNav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";

function TopNav() {
return (
<div className="top-nav">
<ul>
<li><a href="carlights.html">car lights</a></li>
<li><a href="carwheels.html">Car wheels</a></li>
<li><a href="carbumpers.html">car bumpers</a></li>
<li><a href="caradsystem.html">car audiosystem</a></li>
<li><a href="truckbumpers.html">Truck bumpers</a></li>
<li><a href="contact.html">Feedback</a></li>
<div className="clear"> </div>
</ul>
</div>
);
}

export default TopNav;
Empty file modified src/index.css
100644 → 100755
Empty file.
Empty file modified src/index.js
100644 → 100755
Empty file.
Empty file modified src/logo.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/state.js
100644 → 100755
Empty file.
Empty file modified yarn.lock
100644 → 100755
Empty file.