1
0
Fork 0

Updated Blockquote component to take data-test attributes

This commit is contained in:
Joost De Cock 2019-08-17 18:18:19 +02:00
parent 4a1070f900
commit 112ead9796

View file

@ -1,25 +1,28 @@
import React from "react";
import PropTypes from "prop-types";
import Icon from "../Icon";
import React from 'react'
import PropTypes from 'prop-types'
import Icon from '../Icon'
const Blockquote = ({ type, children, style }) => {
const Blockquote = props => {
const attr = Object.assign({}, props)
delete attr.type
delete attr.children
return (
<blockquote className={type} style={style}>
{children}
<Icon icon={type} className={"icon " + type} />
<blockquote className={props.type} {...attr}>
{props.children}
<Icon icon={props.type} className={'icon ' + props.type} />
</blockquote>
);
};
)
}
Blockquote.propTypes = {
type: PropTypes.string.isRequired,
children: PropTypes.node,
style: PropTypes.object
};
}
Blockquote.defaultProps = {
type: "note",
type: 'note',
children: null,
style: {}
};
export default Blockquote;
}
export default Blockquote