From e6605441aa9244d4ca62aa9fd1154f0631cce3c6 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 12 Jan 2021 14:08:09 +0200 Subject: [PATCH] WIP minimize --- res/css/views/dialogs/_HostSignupDialog.scss | 4 + .../views/dialogs/HostSignupDialog.tsx | 112 ++++++++++++------ .../views/dialogs/HostSignupDialogTypes.tsx | 2 + 3 files changed, 79 insertions(+), 39 deletions(-) diff --git a/res/css/views/dialogs/_HostSignupDialog.scss b/res/css/views/dialogs/_HostSignupDialog.scss index 566f4e8a0d..ee86608ed4 100644 --- a/res/css/views/dialogs/_HostSignupDialog.scss +++ b/res/css/views/dialogs/_HostSignupDialog.scss @@ -38,3 +38,7 @@ limitations under the License. } } } + +.mx_HostSignupBaseDialog_minimized { + display: none; +} diff --git a/src/components/views/dialogs/HostSignupDialog.tsx b/src/components/views/dialogs/HostSignupDialog.tsx index cecd603904..fd4bdca30f 100644 --- a/src/components/views/dialogs/HostSignupDialog.tsx +++ b/src/components/views/dialogs/HostSignupDialog.tsx @@ -16,9 +16,11 @@ limitations under the License. import * as React from "react"; import BaseDialog from '../../views/dialogs/BaseDialog'; +import GenericToast from "../toasts/GenericToast"; import Modal from "../../../Modal"; import QuestionDialog from './QuestionDialog'; import SdkConfig from "../../../SdkConfig"; +import ToastStore from "../../../stores/ToastStore"; import {_t} from "../../../languageHandler"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {OwnProfileStore} from "../../../stores/OwnProfileStore"; @@ -32,6 +34,7 @@ interface IState { completed: boolean; error: string; loadIframe: boolean; + minimized: boolean; } export default class HostSignupDialog extends React.PureComponent { @@ -45,6 +48,7 @@ export default class HostSignupDialog extends React.PureComponent { + this.setState({ + minimized: false, + }); + } + + private minimizeDialog = () => { + ToastStore.sharedInstance().addOrReplaceToast({ + priority: 0, + key: 'host_signup_dialog', + title: "Building your home", + icon: "verification", + props: { + description: "", + onAccept: this.maximizeDialog, + acceptLabel: "Return", + }, + component: GenericToast, + }); + this.setState({ + minimized: true, + }); + } + private onFinished = (result: boolean) => { if (result || this.state.completed) { // We're done, close @@ -132,49 +163,52 @@ export default class HostSignupDialog extends React.PureComponent -
- {this.state.loadIframe && -