Continuing updating the reformatting of propTypes and set redux, intl functions to end of component
• Removing: - the reformatting of propTypes and set redux, intl functions to end of component
This commit is contained in:
@@ -3,20 +3,12 @@ import PropTypes from 'prop-types'
|
||||
import { CX } from '../constants'
|
||||
import Button from './button'
|
||||
|
||||
export default class BackButton extends React.PureComponent {
|
||||
class BackButton extends React.PureComponent {
|
||||
|
||||
static contextTypes = {
|
||||
router: PropTypes.object,
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
className: PropTypes.string,
|
||||
icon: PropTypes.string,
|
||||
iconClassName: PropTypes.string,
|
||||
iconSize: PropTypes.string,
|
||||
toHome: PropTypes.bool,
|
||||
}
|
||||
|
||||
historyBack = () => {
|
||||
if (window.history && window.history.length === 1 || this.props.toHome) {
|
||||
this.context.router.history.push('/home')
|
||||
@@ -62,3 +54,13 @@ export default class BackButton extends React.PureComponent {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BackButton.propTypes = {
|
||||
className: PropTypes.string,
|
||||
icon: PropTypes.string,
|
||||
iconClassName: PropTypes.string,
|
||||
iconSize: PropTypes.string,
|
||||
toHome: PropTypes.bool,
|
||||
}
|
||||
|
||||
export default BackButton
|
||||
Reference in New Issue
Block a user