All files / components/blankslate index.js

0% Statements 0/24
0% Branches 0/4
0% Functions 0/3
0% Lines 0/17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                                                                                                     
import React from 'react'
import PropTypes from 'prop-types'
import { Button } from 'src'
import BlankSlateStyled from './blankslate.styled'
 
const BlankSlate = ({
  visible,
  img,
  title,
  buttonIcon,
  buttonType,
  buttonTitle,
  buttonClick,
  orientation,
  children
}) => (
  <BlankSlateStyled orientation={orientation} visible={visible}>
    <img src={img} className='blankslate-img' />
    <div className='blankslate-label-container'>
      <h2>{title}</h2>
      <p>{children}</p>
      <Button width='223px' type={buttonType} icon={buttonIcon} onClick={buttonClick} >{buttonTitle}</Button>
    </div>
  </BlankSlateStyled>
)
 
BlankSlate.propTypes = {
  visible: PropTypes.bool.isRequired,
  orientation: PropTypes.string.isRequired,
  img: PropTypes.string,
  title: PropTypes.string.isRequired,
  buttonIcon: PropTypes.string,
  buttonTitle: PropTypes.string,
  buttonType: PropTypes.oneOf([
    'primary',
    'secondary',
    'danger',
    'default'
  ]),
  buttonClick: PropTypes.func,
  children: PropTypes.element
}
 
BlankSlate.defaultProps = {
  orientation: 'ltr',
  buttonType: 'primary',
  buttonClick: () => { }
}
 
export { BlankSlate }