All files / src/containers/SaveBarHandler/SaveBarButton index.jsx

0% Statements 0/25
0% Branches 0/6
0% Functions 0/2
0% Lines 0/11
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                                                                 
import styles from '../style.postcss';
 
import React from 'react';
import classnames from 'classnames';
import Button from 'components/Button';
import PropTypes from 'prop-types';
import testClass from 'domain/testClass';
 
const SaveBarButton = ({ label, isPrimary, disabled, onClick, linkHref, linkTo }) => {
  const className = classnames(styles.SaveBar_button,
    testClass(`toolbar-button-${label.replace(/\s+/g, '-').toLowerCase()}`));
  return <Button autoWidth
      type={isPrimary ? Button.Type.primaryInverse : Button.Type.defaultInverse}
      className={className}
      disabled={disabled}
      onClick={onClick}
      linkHref={linkHref}
      linkTo={linkTo}>
    {label}
  </Button>;
};
 
SaveBarButton.propTypes = {
  label: PropTypes.string,
  isPrimary: PropTypes.bool,
  disabled: PropTypes.bool,
  onClick: PropTypes.func,
  linkHref: PropTypes.string,
  linkTo: PropTypes.string,
};
 
export default SaveBarButton;