AllenYuan

Untitled

May 31st, 2020
34
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 { string } from 'prop-types';
  3. import styled from 'styled-components';
  4. import constants from '../constants';
  5.  
  6. const Wrapper = styled.div`
  7. background-color: ${constants.colorDanger};
  8. padding: 15px;
  9. color: white;
  10. `;
  11.  
  12. const Error = props => (
  13. <Wrapper>
  14. Whoops! Something went wrong. {props.text ? props.text : ''}
  15. </Wrapper>
  16. );
  17.  
  18. Error.propTypes = {
  19. text: string,
  20. };
  21.  
  22. export default Error;
Advertisement
Add Comment
Please, Sign In to add comment