|
|
@ -4,6 +4,7 @@ import NavigationContainer from './containers/navigation_container';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
import { mountCompose, unmountCompose } from 'flavours/glitch/actions/compose';
|
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import SearchContainer from './containers/search_container';
|
|
|
|
import SearchContainer from './containers/search_container';
|
|
|
@ -27,6 +28,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|
|
|
onClickElefriend () {
|
|
|
|
onClickElefriend () {
|
|
|
|
dispatch(cycleElefriendCompose());
|
|
|
|
dispatch(cycleElefriendCompose());
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMount () {
|
|
|
|
|
|
|
|
dispatch(mountCompose());
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onUnmount () {
|
|
|
|
|
|
|
|
dispatch(unmountCompose());
|
|
|
|
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export default @connect(mapStateToProps, mapDispatchToProps)
|
|
|
|
export default @connect(mapStateToProps, mapDispatchToProps)
|
|
|
@ -38,9 +47,27 @@ class Compose extends React.PureComponent {
|
|
|
|
isSearchPage: PropTypes.bool,
|
|
|
|
isSearchPage: PropTypes.bool,
|
|
|
|
elefriend: PropTypes.number,
|
|
|
|
elefriend: PropTypes.number,
|
|
|
|
onClickElefriend: PropTypes.func,
|
|
|
|
onClickElefriend: PropTypes.func,
|
|
|
|
|
|
|
|
onMount: PropTypes.func,
|
|
|
|
|
|
|
|
onUnmount: PropTypes.func,
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount () {
|
|
|
|
|
|
|
|
const { isSearchPage } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isSearchPage) {
|
|
|
|
|
|
|
|
this.props.onMount();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentWillUnmount () {
|
|
|
|
|
|
|
|
const { isSearchPage } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isSearchPage) {
|
|
|
|
|
|
|
|
this.props.onUnmount();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
elefriend,
|
|
|
|
elefriend,
|
|
|
|