-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,050 additions
and
882 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -19,4 +19,5 @@ body { | |
|
||
.footer { | ||
font-weight: bold; | ||
margin-top: 130px; | ||
} |
This file contains 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 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 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,36 @@ | ||
import React, {Component} from 'react'; | ||
import Navigation from 'Navigation'; | ||
import Footer from 'Footer'; | ||
|
||
import {connect} from 'react-redux'; | ||
import {bindActionCreators} from 'redux'; | ||
import {getCart} from 'cartActions'; | ||
|
||
|
||
|
||
class Main extends Component { | ||
render() { | ||
return( | ||
<div> | ||
<Navigation cartItems={this.props.totalQuantity} /> | ||
{this.props.children} | ||
<Footer /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
|
||
function mapStateToProps(state) { | ||
return { | ||
totalQuantity: state.cart.totalQuantity | ||
} | ||
} | ||
|
||
function mapDispatchToProps(dispatch) { | ||
return bindActionCreators({ | ||
getCart | ||
}, dispatch); | ||
} | ||
|
||
export default connect(mapStateToProps)(Main); |
This file contains 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 |
---|---|---|
@@ -1,28 +1,36 @@ | ||
import React, {Component} from 'react'; | ||
import {Nav, NavItem, Navbar, Badge} from 'react-bootstrap'; | ||
|
||
const Navigation = () => ( | ||
<Navbar inverse fixedTop> | ||
<Navbar.Header> | ||
<Navbar.Brand> | ||
<a href="/">ReactUniversalShopping</a> | ||
</Navbar.Brand> | ||
<Navbar.Toggle /> | ||
</Navbar.Header> | ||
<Navbar.Collapse> | ||
<Nav> | ||
<NavItem eventKey={1} href="/about">About</NavItem> | ||
<NavItem eventKey={2} href="/contact">Contact</NavItem> | ||
</Nav> | ||
<Nav pullRight> | ||
<NavItem eventKey={1} href="/admin">Admin</NavItem> | ||
<NavItem eventKey={2} href="cart"> | ||
Your Cart <Badge className="badge">4</Badge> | ||
</NavItem> | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar> | ||
); | ||
|
||
|
||
class Navigation extends Component { | ||
|
||
render(){ | ||
return ( | ||
<Navbar inverse fixedTop> | ||
<Navbar.Header> | ||
<Navbar.Brand> | ||
<a href="/">ReactUniversalShoppingApp</a> | ||
</Navbar.Brand> | ||
<Navbar.Toggle /> | ||
</Navbar.Header> | ||
<Navbar.Collapse> | ||
<Nav> | ||
<NavItem eventKey={1} href="/about">About</NavItem> | ||
<NavItem eventKey={2} href="/contact">Contact</NavItem> | ||
</Nav> | ||
<Nav pullRight> | ||
<NavItem eventKey={1} href="/admin">Admin</NavItem> | ||
<NavItem eventKey={2} href="/cart"> | ||
Your Cart <Badge className="badge">{this.props.cartItems}</Badge> | ||
</NavItem> | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar> | ||
); | ||
} | ||
} | ||
|
||
|
||
|
||
export default Navigation; |
This file contains 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 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 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