component: add price in OrderSummary

This commit is contained in:
oscarzhou 2020-12-13 13:31:10 +13:00
parent 77a69afbe9
commit 3ec3df773d
2 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ const orderSummary = (props) => {
<ul>
{ingredients}
</ul>
<p><strong>Total Price: {props.price.toFixed(2)}</strong></p>
<p>Continue to Checkout?</p>
<Button btnType="Danger" clicked={props.purchaseCancalled}>CANCEL</Button>
<Button btnType="Success" clicked={props.purchaseContinued}>CONTINUE</Button>

View File

@ -106,6 +106,7 @@ class BurgerBuilder extends Component {
modalClosed={this.purchaseCancelHandler}>
<OrderSummary
ingredients={this.state.ingredients}
price={this.state.totalPrice}
purchaseCancalled={this.purchaseCancelHandler}
purchaseContinued={this.purchaseContinueHandler}></OrderSummary>
</Modal>