= ({ onProceed }) => (
-
+
{
+ const context = useContext(ProfileContext);
+ const dispatch = useReduxDispatch();
+ const { current: form } = useRef(new FormModel());
+ const onSubmit = useCallback(
+ () =>
+ context
+ .onSubmit({
+ form,
+ // TODO: rework
+ sendData: () => changePassword(context.userId, form.serialize()),
+ })
+ .then(() => {
+ dispatch(
+ updateUser({
+ passwordChangedAt: Date.now() / 1000,
+ }),
+ );
+ context.goToProfile();
+ }),
+ [context],
+ );
+
+ return ;
+};
+
+export default DeleteAccountPage;
diff --git a/packages/app/pages/profile/ProfileController.tsx b/packages/app/pages/profile/ProfileController.tsx
index 7ca1f40..332b6a3 100644
--- a/packages/app/pages/profile/ProfileController.tsx
+++ b/packages/app/pages/profile/ProfileController.tsx
@@ -20,6 +20,7 @@ import ChangePasswordPage from 'app/pages/profile/ChangePasswordPage';
import ChangeUsernamePage from 'app/pages/profile/ChangeUsernamePage';
import ChangeEmailPage from 'app/pages/profile/ChangeEmailPage';
import MultiFactorAuthPage from 'app/pages/profile/MultiFactorAuthPage';
+import DeleteAccountPage from 'app/pages/profile/DeleteAccountPage';
interface Props {
userId: number;
@@ -50,6 +51,7 @@ const ProfileController: ComponentType = ({ userId, onSubmit, refreshUser
+