mirror of
https://github.com/wassname/talk.git
synced 2026-08-05 13:30:26 +08:00
Adding withRequestAccountDeletion, withRequestDownloadLink, withCancelAccountDeletion
This commit is contained in:
@@ -25,5 +25,8 @@ export {
|
||||
withUnbanUser,
|
||||
withStopIgnoringUser,
|
||||
withSetCommentStatus,
|
||||
withRequestAccountDeletion,
|
||||
withRequestDownloadLink,
|
||||
withCancelAccountDeletion,
|
||||
} from 'coral-framework/graphql/mutations';
|
||||
export { compose } from 'recompose';
|
||||
|
||||
@@ -4,7 +4,7 @@ import SetUsernameDialog from './stream/containers/SetUsernameDialog';
|
||||
import translations from './translations.yml';
|
||||
import Login from './login/containers/Main';
|
||||
import reducer from './login/reducer';
|
||||
import DeleteMyAccount from './profile-settings/components/DeleteMyAccount';
|
||||
import DeleteMyAccount from './profile-settings/containers/DeleteMyAccount';
|
||||
|
||||
export default {
|
||||
reducer,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import cn from 'classnames';
|
||||
import styles from './DeleteMyAccount.css';
|
||||
import { Button } from 'plugin-api/beta/client/components/ui';
|
||||
@@ -24,7 +25,11 @@ class DeleteMyAccount extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="talk-plugin-auth--delete-my-account">
|
||||
<DeleteMyAccountDialog closeDialog={this.closeDialog} />
|
||||
<DeleteMyAccountDialog
|
||||
requestAccountDeletion={this.props.requestAccountDeletion}
|
||||
cancelAccountDeletion={this.props.cancelAccountDeletion}
|
||||
closeDialog={this.closeDialog}
|
||||
/>
|
||||
<h3
|
||||
className={cn(
|
||||
styles.title,
|
||||
@@ -54,4 +59,10 @@ class DeleteMyAccount extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
DeleteMyAccount.propTypes = {
|
||||
requestAccountDeletion: PropTypes.func.isRequired,
|
||||
cancelAccountDeletion: PropTypes.func.isRequired,
|
||||
notify: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default DeleteMyAccount;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { compose, gql } from 'react-apollo';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { connect, withFragments } from 'plugin-api/beta/client/hocs';
|
||||
import DeleteMyAccount from '../components/DeleteMyAccount';
|
||||
import { notify } from 'coral-framework/actions/notification';
|
||||
import {
|
||||
withRequestAccountDeletion,
|
||||
withCancelAccountDeletion,
|
||||
} from 'plugin-api/beta/client/hocs';
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({ notify }, dispatch);
|
||||
|
||||
const withData = withFragments({
|
||||
root: gql`
|
||||
fragment TalkIgnoreUser_IgnoredUserSection_root on RootQuery {
|
||||
me {
|
||||
scheduledDeletionDate
|
||||
}
|
||||
}
|
||||
`,
|
||||
});
|
||||
|
||||
export default compose(
|
||||
connect(null, mapDispatchToProps),
|
||||
withRequestAccountDeletion,
|
||||
withCancelAccountDeletion,
|
||||
withData
|
||||
)(DeleteMyAccount);
|
||||
Reference in New Issue
Block a user