-
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.
Building the
<Checkout />
& <CheckoutSummary />
Components
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 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
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
41 changes: 41 additions & 0 deletions
41
src/components/Order/CheckoutSummary/CheckoutSummary.component.jsx
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,41 @@ | ||
// LIBRARY IMPORTS | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
// CUSTOM COMPONENTS | ||
import Burger from '../../Burger/Burger.component'; | ||
import { StyledButton as Button } from '../../UI/Buttons/StyledButton.styled'; | ||
|
||
// STYLED COMPONENTS | ||
const CheckoutDiv = styled.div` | ||
text-align: center; | ||
width: 80%; | ||
margin: auto; | ||
& > div { | ||
width: 100%; | ||
margin: auto; | ||
} | ||
@media (min-width: 600px) { | ||
width: 500px; | ||
} | ||
`; | ||
|
||
// RENDERED JSX COMPONENT | ||
const checkoutSummary = props => { | ||
return ( | ||
<CheckoutDiv> | ||
<h1>We hope it tastes well!</h1> | ||
<div><Burger ingredients={props.ingredients} /></div> | ||
<Button | ||
type="danger" | ||
onClick={() => { }}>CANCEL</Button> | ||
<Button | ||
type="success" | ||
onClick={() => { }}>CONTINUE</Button> | ||
</CheckoutDiv> | ||
); | ||
} | ||
|
||
export default checkoutSummary; |
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,23 @@ | ||
// LIBRARY IMPORTS | ||
import React, { Component } from 'react'; | ||
|
||
// CUSTOM COMPONENTS | ||
import CheckoutSummary from '../../components/Order/CheckoutSummary/CheckoutSummary.component'; | ||
|
||
class Checkout extends Component { | ||
// Dummy data in the state for now. Later on we will pass in | ||
// data regarding ingredients, using Routing | ||
state = { | ||
ingredients: { salad: 1, meat: 1, cheese: 1, bacon: 1, } | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<CheckoutSummary ingredients={this.state.ingredients}/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Checkout; |