mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Deleting unnecesary connects
This commit is contained in:
@@ -211,8 +211,10 @@ export default class Moderation extends Component {
|
||||
rejectComment={props.rejectComment} />
|
||||
)}
|
||||
<StorySearch
|
||||
visible={this.props.moderation.storySearchVisible}
|
||||
moderation={this.props.moderation}
|
||||
closeSearch={this.closeSearch}
|
||||
storySearchChange={this.props.storySearchChange}
|
||||
storySearchClear={this.props.storySearchClear}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -7,11 +7,13 @@ import Story from './Story';
|
||||
const StorySearch = (props) => {
|
||||
|
||||
const {
|
||||
root: {assets = []},
|
||||
root: {
|
||||
assets = []
|
||||
},
|
||||
data: {loading}
|
||||
} = props;
|
||||
|
||||
if (!props.visible) {
|
||||
if (!props.moderation.storySearchVisible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -27,6 +29,7 @@ const StorySearch = (props) => {
|
||||
<input
|
||||
className={styles.searchInput}
|
||||
onChange={props.handleSearchChange}
|
||||
value={props.moderation.storySearchString}
|
||||
/>
|
||||
<Button
|
||||
cStyle='blue'
|
||||
|
||||
@@ -25,6 +25,8 @@ import {
|
||||
viewUserDetail,
|
||||
hideUserDetail,
|
||||
setSortOrder,
|
||||
storySearchChange,
|
||||
storySearchClear
|
||||
} from 'actions/moderation';
|
||||
|
||||
import {Spinner} from 'coral-ui';
|
||||
@@ -306,6 +308,8 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
viewUserDetail,
|
||||
hideUserDetail,
|
||||
setSortOrder,
|
||||
storySearchChange,
|
||||
storySearchClear
|
||||
}, dispatch),
|
||||
});
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import {compose, gql} from 'react-apollo';
|
||||
import StorySearch from '../components/StorySearch';
|
||||
import withQuery from 'coral-framework/hocs/withQuery';
|
||||
import {storySearchChange} from 'coral-admin/src/actions/moderation';
|
||||
|
||||
class StorySearchContainer extends React.Component {
|
||||
|
||||
@@ -57,17 +54,6 @@ export const withAssetSearchQuery = withQuery(gql`
|
||||
}
|
||||
});
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
moderation: state.moderation.toJS()
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
...bindActionCreators({
|
||||
storySearchChange
|
||||
}, dispatch)
|
||||
});
|
||||
|
||||
export default compose(
|
||||
connect(mapStateToProps, mapDispatchToProps),
|
||||
withAssetSearchQuery
|
||||
)(StorySearchContainer);
|
||||
|
||||
Reference in New Issue
Block a user