Guest User

Untitled

a guest
Jan 12th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3.  
  4. const ColorSwatch = (props) => {
  5.  
  6. let style = {
  7. backgroundColor: props.color,
  8. };
  9.  
  10. return (
  11. <div style={style}>
  12. <h2>{props.text}</h2>
  13. <p>
  14. Lorem ...
  15. </p>
  16. </div>
  17. );
  18. };
  19.  
  20. ColorSwatch.PropTypes = {
  21. color: PropTypes.string.isRequired,
  22. text: PropTypes.string.isRequired
  23. };
  24.  
  25. export default ColorSwatch;
Add Comment
Please, Sign In to add comment