From a680b5f96832ac40dff5b701f3e7c9a4680ca875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 27 Sep 2021 12:47:47 +0200 Subject: [PATCH] Convert Registration to TS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/{Registration.js => Registration.tsx} | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) rename src/{Registration.js => Registration.tsx} (89%) diff --git a/src/Registration.js b/src/Registration.tsx similarity index 89% rename from src/Registration.js rename to src/Registration.tsx index c59d244149..90e81c0d45 100644 --- a/src/Registration.js +++ b/src/Registration.tsx @@ -20,10 +20,11 @@ limitations under the License. * registration code. */ +import React from "react"; import dis from './dispatcher/dispatcher'; -import * as sdk from './index'; import Modal from './Modal'; import { _t } from './languageHandler'; +import QuestionDialog from "./components/views/dialogs/QuestionDialog"; // Regex for what a "safe" or "Matrix-looking" localpart would be. // TODO: Update as needed for https://github.com/matrix-org/matrix-doc/issues/1514 @@ -41,9 +42,11 @@ export const SAFE_LOCALPART_REGEX = /^[a-z0-9=_\-./]+$/; * @param {bool} options.screen_after * If present the screen to redirect to after a successful login or register. */ -export async function startAnyRegistrationFlow(options) { +export async function startAnyRegistrationFlow( + // eslint-disable-next-line camelcase + options: { go_home_on_cancel?: boolean, go_welcome_on_cancel?: boolean, screen_after?: boolean}, +): Promise { if (options === undefined) options = {}; - const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); const modal = Modal.createTrackedDialog('Registration required', '', QuestionDialog, { hasCancelButton: true, quitOnly: true,