Skip to content

Commit

Permalink
15. disabled checkout button when cart is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
bbandydd committed Jul 28, 2017
1 parent 3398396 commit fae7da9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/containers/Home/components/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ export default class Content extends Component {
</Alert>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.toggle}>結帳</Button>{' '}
<Button
disabled={cart.length === 0}
color="primary"
onClick={this.toggle}
>
結帳
</Button>{' '}
<Button color="secondary" onClick={this.toggle}>取消</Button>
</ModalFooter>
</Modal>
Expand Down

0 comments on commit fae7da9

Please sign in to comment.