Created
June 17, 2020 19:12
-
-
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`
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
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