Beginning to reformat propTypes and set redux, intl functions to end of component files

• Beginning:
- to reformat propTypes and set redux, intl functions to end of component files
This commit is contained in:
mgabdev
2020-08-17 17:06:22 -05:00
parent 0a331ad389
commit 46a0cbca7d
28 changed files with 650 additions and 645 deletions

View File

@@ -131,12 +131,6 @@ const keyMap = {
class SwitchingArea extends React.PureComponent {
static propTypes = {
children: PropTypes.node,
location: PropTypes.object,
onLayoutChange: PropTypes.func.isRequired,
}
componentDidMount() {
window.addEventListener('resize', this.handleResize, {
passive: true
@@ -264,26 +258,18 @@ class SwitchingArea extends React.PureComponent {
}
}
export default
@connect(mapStateToProps)
@injectIntl
@withRouter
SwitchingArea.propTypes = {
children: PropTypes.node,
location: PropTypes.object,
onLayoutChange: PropTypes.func.isRequired,
}
class UI extends React.PureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,
}
static propTypes = {
dispatch: PropTypes.func.isRequired,
children: PropTypes.node,
isComposing: PropTypes.bool,
hasComposingText: PropTypes.bool,
hasMediaAttachments: PropTypes.bool,
location: PropTypes.object,
intl: PropTypes.object.isRequired,
}
state = {
fetchedHome: false,
fetchedNotifications: false,
@@ -589,3 +575,15 @@ class UI extends React.PureComponent {
}
}
UI.propTypes = {
dispatch: PropTypes.func.isRequired,
children: PropTypes.node,
isComposing: PropTypes.bool,
hasComposingText: PropTypes.bool,
hasMediaAttachments: PropTypes.bool,
location: PropTypes.object,
intl: PropTypes.object.isRequired,
}
export default injectIntl(withRouter(connect(mapStateToProps)(UI)))