diff --git a/src/pages/app.tsx b/src/pages/app.tsx index 0fa90d89..89f05b31 100644 --- a/src/pages/app.tsx +++ b/src/pages/app.tsx @@ -13,6 +13,7 @@ import { CheckAuth } from "../context/revoltjs/CheckAuth"; import Invite from "./invite/Invite"; const Login = lazy(() => import("./login/Login")); +const ConfirmDelete = lazy(() => import("./login/ConfirmDelete")); const RevoltApp = lazy(() => import("./RevoltApp")); export function App() { @@ -30,6 +31,9 @@ export function App() { + + + diff --git a/src/pages/login/ConfirmDelete.tsx b/src/pages/login/ConfirmDelete.tsx new file mode 100644 index 00000000..61f164a0 --- /dev/null +++ b/src/pages/login/ConfirmDelete.tsx @@ -0,0 +1,56 @@ +import { Check } from "@styled-icons/boxicons-regular"; +import { useParams } from "react-router-dom"; +import styled from "styled-components"; + +import { useEffect, useState } from "preact/hooks"; + +import { Modal, Preloader } from "@revoltchat/ui"; + +import { useApplicationState } from "../../mobx/State"; + +const Centre = styled.div` + display: flex; + justify-content: center; +`; + +export default function ConfirmDelete() { + const state = useApplicationState(); + const [deleted, setDeleted] = useState(true); + const { token } = useParams<{ token: string }>(); + + useEffect(() => { + state.config + .createClient() + .api.put("/auth/account/delete", { token }) + .then(() => setDeleted(true)); + }, []); + + return ( + + Your account will be deleted in 7 days. +
+ You may contact{" "} + + Revolt support + {" "} + to cancel the request if you wish. + + ) : ( + "Contacting the server." + ) + } + nonDismissable> + {deleted ? ( + + + + ) : ( + + )} +
+ ); +}