Skip to content

Instantly share code, notes, and snippets.

@Eyongkevin
Created June 17, 2020 19:12
Show Gist options
  • Save Eyongkevin/78929a681d7d595dfe7c70f49a8bdf18 to your computer and use it in GitHub Desktop.
Save Eyongkevin/78929a681d7d595dfe7c70f49a8bdf18 to your computer and use it in GitHub Desktop.
sample code for the tut `Build a Shopping Cart with React, Redux, and React-DnD`
import React, { Component } from 'react';
import Phone from './Phone'
import ShoppingCart from './ShoppingCart'
class Container extends Component {
render(){
const { phones } = this.props
return(
<div className='container'>
<div className="shopping">
<h1>Phone Brands</h1>
{Object.keys(phones).map((phone) =>(
<Phone key={phone} name={phones[phone].brand} />
))}
<ShoppingCart />
</div>
<dive className="shoppingDetails">
<h1>Shopping Details</h1>
{/* display shopping detail here. */}
</dive>
</div>
)
}
}
export default Container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment