All files / components/text blockquote.jsx

100% Statements 3/3
50% Branches 1/2
100% Functions 1/1
100% Lines 3/3
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          1x                       1x                                     1x                      
import React from 'react';
import PropTypes from 'prop-types';
 
class Blockquote extends React.Component {
  render() {
    return (
      <blockquote className={this.props.pullRight ? 'pull-right' : ''}>
        <p className={this.props.quoteTheme}>{this.props.quote}</p>
        <small className={this.props.sourceTheme}>
          {this.props.source}&nbsp;
          <cite className={this.props.citeTheme} title={this.props.cite}>{this.props.cite}</cite>
        </small>
      </blockquote>
    );
  }
}
 
Blockquote.propTypes = {
  quote: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.element
  ]),
  quoteTheme: PropTypes.string,
  source: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.element
  ]),
  sourceTheme: PropTypes.string,
  cite: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.element
  ]),
  citeTheme: PropTypes.string,
  pullRight: PropTypes.bool
};
 
Blockquote.defaultProps = {
  quote: '',
  quoteTheme: '',
  source: '',
  sourceTheme: '',
  cite: '',
  citeTheme: '',
  pullRight: false
};
 
export default Blockquote;