✨ 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 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue