Port plugins

This commit is contained in:
Chi Vinh Le
2018-01-23 20:06:55 +01:00
parent b196bb379a
commit 59cdc9fd5d
9 changed files with 39 additions and 68 deletions
@@ -1,7 +1,6 @@
import React from 'react';
import Comment from '../containers/Comment';
import LoadMore from './LoadMore';
import { getErrorMessages } from 'plugin-api/beta/client/utils';
class TabPane extends React.Component {
state = {
@@ -15,9 +14,8 @@ class TabPane extends React.Component {
.then(() => {
this.setState({ loadingState: 'success' });
})
.catch(error => {
.catch(() => {
this.setState({ loadingState: 'error' });
this.props.notify('error', getErrorMessages(error));
});
};
@@ -3,18 +3,20 @@ import { bindActionCreators } from 'redux';
import ModActionButton from '../components/ModActionButton';
import { withTags, connect } from 'plugin-api/beta/client/hocs';
import { closeMenu } from 'plugins/talk-plugin-moderation-actions/client/actions';
import { notify } from 'plugin-api/beta/client/actions/notification';
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
notify,
closeMenu,
},
dispatch
);
const enhance = compose(
withTags('featured'),
connect(null, mapDispatchToProps)
connect(null, mapDispatchToProps),
withTags('featured')
);
export default enhance(ModActionButton);
@@ -24,8 +24,8 @@ const fragments = {
`,
};
const enhance = compose(
withTags('featured', { fragments }),
connect(null, mapDispatchToProps)
connect(null, mapDispatchToProps),
withTags('featured', { fragments })
);
export default enhance(ModTag);