refactor(components): Removed prop-types dependency
This commit is contained in:
parent
8cf8424437
commit
cda9b03713
44 changed files with 559 additions and 1026 deletions
|
@ -1,26 +1,16 @@
|
|||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import Icon from '../Icon'
|
||||
|
||||
const Blockquote = props => {
|
||||
const Blockquote = (props) => {
|
||||
const attr = Object.assign({}, props)
|
||||
delete attr.type
|
||||
delete attr.children
|
||||
return (
|
||||
<blockquote className={props.type} {...attr}>
|
||||
{props.children}
|
||||
{props.type === 'fixme' ? null : <Icon icon={props.type} className={'icon ' + props.type} />}
|
||||
<blockquote className={props.type || 'note'} {...attr}>
|
||||
{props.children || null}
|
||||
{props.type !== 'fixme' && <Icon icon={props.type} className={'icon ' + props.type} />}
|
||||
</blockquote>
|
||||
)
|
||||
}
|
||||
|
||||
Blockquote.propTypes = {
|
||||
type: PropTypes.string.isRequired,
|
||||
children: PropTypes.node
|
||||
}
|
||||
|
||||
Blockquote.defaultProps = {
|
||||
type: 'note',
|
||||
children: null
|
||||
}
|
||||
export default Blockquote
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue