Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. const Answer = (props) => {
  2. const {
  3. yesLabel,
  4. noLabel,
  5. onClickYes,
  6. onClickNo,
  7. } = this.props;
  8. return (
  9. <div className={styles.container}>
  10. <div className={styles.buttonContainerLeft}>
  11. <Button color="white" onClick={onClickYes}>
  12. {yesLabel}
  13. </Button>
  14. </div>
  15.  
  16. <div className={styles.buttonContainer}>
  17. <Button color="white" onClick={onClickNo}>
  18. {noLabel}
  19. </Button>
  20. </div>
  21. </div>
  22. );
  23. }
  24.  
  25. Answer.propTypes = {
  26. yesLabel: React.PropTypes.string.isRequired,
  27. noLabel: React.PropTypes.string.isRequired,
  28. onClickYes: React.PropTypes.func,
  29. onClickNo: React.PropTypes.func,
  30. }
  31.  
  32. Answer.defaultProps = {
  33. yesLabel: 'Yes',
  34. noLabel: 'No',
  35. onClickYes: null,
  36. onClickNo: null,
  37. }
  38.  
  39. export default Answer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement