Guest User

Untitled

a guest
Jan 22nd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import React from 'react'
  2. import styled, { css } from 'styled-components'
  3. import Loader from './Loader'
  4.  
  5. const StyledButton = styled.button`
  6. border-radius: 5px;
  7. background-color: ${props => (props.secondary ? '#F7A072' : '#a1cdf1')};
  8. color: #fff;
  9. padding: 10px 15px;
  10. font-size: ${props => {
  11. if (props.big) return '20px'
  12. return '16px'
  13. }};
  14. outline: none;
  15. border: none;
  16. cursor: pointer;
  17. margin: 15px;
  18. border: 2px solid ${props => (props.secondary ? '#F7A072' : '#a1cdf1')};
  19.  
  20. ${props => {
  21. return (
  22. props.inverse &&
  23. css`
  24. background-color: #fff;
  25. color: #a1cdf1;
  26. `
  27. )
  28. }}
  29. `
  30.  
  31. const Button = ({ secondary, big, inverse, loading, children, ...props }) => {
  32. return (
  33. <StyledButton secondary={secondary} big={big} inverse={inverse} {...props}>
  34. {loading ? <Loader small white /> : children}
  35. </StyledButton>
  36. )
  37. }
  38.  
  39. export default Button
Add Comment
Please, Sign In to add comment