✨ Updated Blockquote component to take data-test attributes
This commit is contained in:
parent
4a1070f900
commit
112ead9796
1 changed files with 16 additions and 13 deletions
|
@ -1,25 +1,28 @@
|
||||||
import React from "react";
|
import React from 'react'
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from 'prop-types'
|
||||||
import Icon from "../Icon";
|
import Icon from '../Icon'
|
||||||
|
|
||||||
const Blockquote = ({ type, children, style }) => {
|
const Blockquote = props => {
|
||||||
|
const attr = Object.assign({}, props)
|
||||||
|
delete attr.type
|
||||||
|
delete attr.children
|
||||||
return (
|
return (
|
||||||
<blockquote className={type} style={style}>
|
<blockquote className={props.type} {...attr}>
|
||||||
{children}
|
{props.children}
|
||||||
<Icon icon={type} className={"icon " + type} />
|
<Icon icon={props.type} className={'icon ' + props.type} />
|
||||||
</blockquote>
|
</blockquote>
|
||||||
);
|
)
|
||||||
};
|
}
|
||||||
|
|
||||||
Blockquote.propTypes = {
|
Blockquote.propTypes = {
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
style: PropTypes.object
|
style: PropTypes.object
|
||||||
};
|
}
|
||||||
|
|
||||||
Blockquote.defaultProps = {
|
Blockquote.defaultProps = {
|
||||||
type: "note",
|
type: 'note',
|
||||||
children: null,
|
children: null,
|
||||||
style: {}
|
style: {}
|
||||||
};
|
}
|
||||||
export default Blockquote;
|
export default Blockquote
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue