-
Notifications
You must be signed in to change notification settings - Fork 87
1/29/18 advanced-hw-1 complete #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
psc478
wants to merge
2
commits into
AustinCodingAcademy:master
Choose a base branch
from
psc478:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,4 +51,4 @@ body { | |
|
|
||
| footer { | ||
| margin: 50px 0; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import React from "react"; | ||
|
|
||
| function Carousel(props) { | ||
| return ( | ||
| <div className="row carousel-holder"> | ||
|
|
||
| <div className="col-md-12"> | ||
| <div id="carousel-example-generic" className="carousel slide" data-ride="carousel"> | ||
| <ol className="carousel-indicators"> | ||
| <li data-target="#carousel-example-generic" data-slide-to="0" className="active"></li> | ||
| <li data-target="#carousel-example-generic" data-slide-to="1"></li> | ||
| <li data-target="#carousel-example-generic" data-slide-to="2"></li> | ||
| </ol> | ||
| <div className="carousel-inner"> | ||
| <div className="item active"> | ||
| <img className="slide-image" src="./carouselimg/product1.png" alt=""/> | ||
| </div> | ||
| <div className="item"> | ||
| <img className="slide-image" src="./carouselimg/product2.jpg" alt=""/> | ||
| </div> | ||
| <div className="item"> | ||
| <img className="slide-image" src="./carouselimg/product3.jpg" alt=""/> | ||
| </div> | ||
| </div> | ||
| <a className="left carousel-control" href="#carousel-example-generic" data-slide="prev"> | ||
| <span className="glyphicon glyphicon-chevron-left"></span> | ||
| </a> | ||
| <a className="right carousel-control" href="#carousel-example-generic" data-slide="next"> | ||
| <span className="glyphicon glyphicon-chevron-right"></span> | ||
| </a> | ||
| </div> | ||
| </div> | ||
|
|
||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default Carousel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import React from "react"; | ||
|
|
||
| function Footer(props) { | ||
| return( | ||
| <footer> | ||
| <div className="row"> | ||
| <div className="col-lg-12"> | ||
| <p>Copyright © E-commerce Template 2018</p> | ||
| </div> | ||
| </div> | ||
| </footer> | ||
| ) | ||
| } | ||
|
|
||
| export default Footer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import React from "react"; | ||
|
|
||
| function Header(props) { | ||
| return ( | ||
|
|
||
| <nav className="navbar navbar-inverse navbar-fixed-top" role="navigation"> | ||
| <div className="container"> | ||
|
|
||
| <div className="navbar-header"> | ||
| <button type="button" className="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> | ||
| <span className="sr-only">Toggle navigation</span> | ||
| <span className="icon-bar"></span> | ||
| <span className="icon-bar"></span> | ||
| <span className="icon-bar"></span> | ||
| </button> | ||
| <a className="navbar-brand" href="#">Generic E-commerce</a> | ||
| </div> | ||
|
|
||
| <div className="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> | ||
| <ul className="nav navbar-nav"> | ||
| <li> | ||
| <a href="#">About</a> | ||
| </li> | ||
| <li> | ||
| <a href="#">Services</a> | ||
| </li> | ||
| <li> | ||
| <a href="#">Contact</a> | ||
| </li> | ||
| <li> | ||
| <a href="#">Items in Cart ({props.numberOfItemsInCart})</a> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
|
|
||
| </div> | ||
|
|
||
| </nav> | ||
| ) | ||
| } | ||
|
|
||
| export default Header; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import React from "react"; | ||
|
|
||
| function ProductDetail(props) { | ||
|
|
||
| let allStars = []; | ||
|
|
||
| function stars(num){ | ||
| let fullStars = num; | ||
| let emptyStars = 5 - fullStars; | ||
| let allStars = []; | ||
| for (var i = 0; i < fullStars; i++) { | ||
| allStars.push(<span className="glyphicon glyphicon-star" key={i}></span>); | ||
| } | ||
| for (var i = 0; i < emptyStars; i++) { | ||
| allStars.push(<span className="glyphicon glyphicon-star-empty" key={i+fullStars}></span>); | ||
| } | ||
| return allStars; | ||
| } | ||
|
|
||
| return ( | ||
| <div className="col-sm-4 col-lg-4 col-md-4"> | ||
| <div className="thumbnail"> | ||
| <img src={props.prod.imgUrl} alt=""/> | ||
| <div className="caption"> | ||
| <h4 className="pull-right">{props.prod.price}</h4> | ||
| <h4><a href="#">{props.prod.name}</a> | ||
| </h4> | ||
| <p>{props.prod.description}</p> | ||
| </div> | ||
| <div className="ratings"> | ||
| <p className="pull-right">{props.prod.reviews} reviews</p> | ||
| <p>{stars(props.prod.rating)}</p> | ||
| </div> | ||
| <button onClick={()=>{ | ||
| props.increase(); | ||
| }}>Add to Cart</button> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default ProductDetail; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like you were experimenting with things trying to figure out how props works, which is good.
But you should probably go back and try to code it the way the readme describes.
You can't hard code 5 product details, that is not realistic to how real apps work.
Where is your use of the map function