mirror of
https://github.com/wassname/talk.git
synced 2026-08-08 11:28:12 +08:00
Port plugins
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user