Use annotations and imports

pull/21833/head
J. Ryan Stinnett 2020-01-28 10:10:37 +00:00
parent d014c5239b
commit 67358e06bf
2 changed files with 10 additions and 11 deletions

View File

@ -16,10 +16,14 @@ limitations under the License.
import React from 'react';
import PropTypes from 'prop-types';
import * as sdk from "../../../index";
import { _t } from '../../../languageHandler';
import Modal from "../../../Modal";
import Modal from '../../../Modal';
import { replaceableComponent } from '../../../utils/replaceableComponent';
import DeviceVerifyDialog from './DeviceVerifyDialog';
import BaseDialog from './BaseDialog';
import DialogButtons from '../elements/DialogButtons';
@replaceableComponent("views.dialogs.NewSessionReviewDialog")
export default class NewSessionReviewDialog extends React.PureComponent {
static propTypes = {
userId: PropTypes.string.isRequired,
@ -32,8 +36,6 @@ export default class NewSessionReviewDialog extends React.PureComponent {
}
onContinueClick = () => {
const DeviceVerifyDialog =
sdk.getComponent('views.dialogs.DeviceVerifyDialog');
const { userId, device } = this.props;
Modal.createTrackedDialog('New Session Verification', 'Starting dialog', DeviceVerifyDialog, {
userId,
@ -42,9 +44,6 @@ export default class NewSessionReviewDialog extends React.PureComponent {
}
render() {
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
const DialogButtons = sdk.getComponent("views.elements.DialogButtons");
const { device } = this.props;
const icon = <span className="mx_NewSessionReviewDialog_headerIcon mx_E2EIcon_warning"></span>;

View File

@ -16,12 +16,15 @@ limitations under the License.
import React from 'react';
import PropTypes from 'prop-types';
import * as sdk from "../../../index";
import { _t } from '../../../languageHandler';
import Modal from "../../../Modal";
import { MatrixClientPeg } from '../../../MatrixClientPeg';
import DeviceListener from '../../../DeviceListener';
import NewSessionReviewDialog from '../dialogs/NewSessionReviewDialog';
import FormButton from '../elements/FormButton';
import { replaceableComponent } from '../../../utils/replaceableComponent';
@replaceableComponent("views.toasts.VerifySessionToast")
export default class VerifySessionToast extends React.PureComponent {
static propTypes = {
toastKey: PropTypes.string.isRequired,
@ -34,8 +37,6 @@ export default class VerifySessionToast extends React.PureComponent {
_onReviewClick = async () => {
const cli = MatrixClientPeg.get();
const NewSessionReviewDialog =
sdk.getComponent('views.dialogs.NewSessionReviewDialog');
const device = await cli.getStoredDevice(cli.getUserId(), this.props.deviceId);
@ -46,7 +47,6 @@ export default class VerifySessionToast extends React.PureComponent {
};
render() {
const FormButton = sdk.getComponent("elements.FormButton");
return (<div>
<div className="mx_Toast_description">{_t("Review & verify your new session")}</div>
<div className="mx_Toast_buttons" aria-live="off">