Guest User

Untitled

a guest
Jan 23rd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import React from 'react';
  2. import styled from 'styled-components';
  3. import { Icon } from 'react-icons-kit';
  4. import { alertTriangle } from 'react-icons-kit/feather/alertTriangle';
  5. import { info } from 'react-icons-kit/feather/info';
  6.  
  7. const Box = styled.div`
  8. display: flex;
  9. flex-direction: row;
  10. justify-content: flex-start;
  11. align-items: center;
  12. border: 2px solid ${props => props.color};
  13. width: fit-content;
  14. padding: 0.1rem 1rem;
  15. color: ${props => props.color};
  16. `;
  17. const Sign = styled.div`
  18. padding-right: 1rem;
  19. `;
  20. const Text = styled.p`
  21. line-height: 1.5;
  22. color: ${props => props.textColor};
  23. `;
  24.  
  25. function MessageBox(props) {
  26. return (
  27. <Box color={props.boxColor}>
  28. <Sign>
  29. {}
  30. {props.msgType === 'alert' && (
  31. <Icon icon={alertTriangle} size={32} />
  32. )}
  33. {props.msgType === 'info' && <Icon icon={info} size={32} />}
  34. </Sign>
  35. <Text textColor={props.textColor}>{props.children}</Text>
  36. </Box>
  37. );
  38. }
  39.  
  40. export default MessageBox;
Add Comment
Please, Sign In to add comment