From d99fb4796fcd39171dd116d3b7fe7248707c7fc3 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 6 Aug 2019 14:04:33 +0100 Subject: [PATCH] avoid using import * as Matrix Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/async-components/views/dialogs/ExportE2eKeysDialog.js | 4 ++-- src/async-components/views/dialogs/ImportE2eKeysDialog.js | 4 ++-- src/components/structures/LoggedInView.js | 6 +++--- src/components/structures/MyGroups.js | 4 ++-- src/components/views/groups/GroupMemberTile.js | 4 ++-- src/components/views/rooms/EventTile.js | 4 ++-- src/components/views/rooms/MemberInfo.js | 6 ++---- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/async-components/views/dialogs/ExportE2eKeysDialog.js b/src/async-components/views/dialogs/ExportE2eKeysDialog.js index 06fb0668d5..529780c121 100644 --- a/src/async-components/views/dialogs/ExportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/ExportE2eKeysDialog.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; -import * as Matrix from 'matrix-js-sdk'; +import { MatrixClient } from 'matrix-js-sdk'; import * as MegolmExportEncryption from '../../../utils/MegolmExportEncryption'; import sdk from '../../../index'; @@ -30,7 +30,7 @@ export default React.createClass({ displayName: 'ExportE2eKeysDialog', propTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient).isRequired, + matrixClient: PropTypes.instanceOf(MatrixClient).isRequired, onFinished: PropTypes.func.isRequired, }, diff --git a/src/async-components/views/dialogs/ImportE2eKeysDialog.js b/src/async-components/views/dialogs/ImportE2eKeysDialog.js index 10744a8911..5181b6da2f 100644 --- a/src/async-components/views/dialogs/ImportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/ImportE2eKeysDialog.js @@ -17,7 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import * as Matrix from 'matrix-js-sdk'; +import { MatrixClient } from 'matrix-js-sdk'; import * as MegolmExportEncryption from '../../../utils/MegolmExportEncryption'; import sdk from '../../../index'; import { _t } from '../../../languageHandler'; @@ -41,7 +41,7 @@ export default React.createClass({ displayName: 'ImportE2eKeysDialog', propTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient).isRequired, + matrixClient: PropTypes.instanceOf(MatrixClient).isRequired, onFinished: PropTypes.func.isRequired, }, diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index 3730b979f7..0ef9e362be 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import * as Matrix from 'matrix-js-sdk'; +import { MatrixClient } from 'matrix-js-sdk'; import React from 'react'; import PropTypes from 'prop-types'; import { DragDropContext } from 'react-beautiful-dnd'; @@ -62,7 +62,7 @@ const LoggedInView = React.createClass({ displayName: 'LoggedInView', propTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient).isRequired, + matrixClient: PropTypes.instanceOf(MatrixClient).isRequired, page_type: PropTypes.string.isRequired, onRoomCreated: PropTypes.func, @@ -78,7 +78,7 @@ const LoggedInView = React.createClass({ }, childContextTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient), + matrixClient: PropTypes.instanceOf(MatrixClient), authCache: PropTypes.object, }, diff --git a/src/components/structures/MyGroups.js b/src/components/structures/MyGroups.js index 2a61a1ef66..aec4767e7b 100644 --- a/src/components/structures/MyGroups.js +++ b/src/components/structures/MyGroups.js @@ -17,11 +17,11 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { MatrixClient } from 'matrix-js-sdk'; import sdk from '../../index'; import { _t } from '../../languageHandler'; import dis from '../../dispatcher'; import AccessibleButton from '../views/elements/AccessibleButton'; -import * as Matrix from "matrix-js-sdk"; export default React.createClass({ displayName: 'MyGroups', @@ -34,7 +34,7 @@ export default React.createClass({ }, contextTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient).isRequired, + matrixClient: PropTypes.instanceOf(MatrixClient).isRequired, }, componentWillMount: function() { diff --git a/src/components/views/groups/GroupMemberTile.js b/src/components/views/groups/GroupMemberTile.js index 92165e134a..971255d548 100644 --- a/src/components/views/groups/GroupMemberTile.js +++ b/src/components/views/groups/GroupMemberTile.js @@ -18,10 +18,10 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; +import { MatrixClient } from 'matrix-js-sdk'; import sdk from '../../../index'; import dis from '../../../dispatcher'; import { GroupMemberType } from '../../../groups'; -import * as Matrix from "matrix-js-sdk"; export default React.createClass({ displayName: 'GroupMemberTile', @@ -36,7 +36,7 @@ export default React.createClass({ }, contextTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient).isRequired, + matrixClient: PropTypes.instanceOf(MatrixClient).isRequired, }, onClick: function(e) { diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 893a838ccd..5fec115c95 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -32,7 +32,7 @@ const TextForEvent = require('../../../TextForEvent'); import dis from '../../../dispatcher'; import SettingsStore from "../../../settings/SettingsStore"; -import {EventStatus, default as Matrix} from 'matrix-js-sdk'; +import {EventStatus, MatrixClient} from 'matrix-js-sdk'; const ObjectUtils = require('../../../ObjectUtils'); @@ -189,7 +189,7 @@ module.exports = React.createClass({ }, contextTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient).isRequired, + matrixClient: PropTypes.instanceOf(MatrixClient).isRequired, }, componentWillMount: function() { diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 803242ec88..8cabb5af48 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -30,6 +30,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; +import { MatrixClient } from 'matrix-js-sdk'; import dis from '../../../dispatcher'; import Modal from '../../../Modal'; import sdk from '../../../index'; @@ -45,7 +46,6 @@ import MultiInviter from "../../../utils/MultiInviter"; import SettingsStore from "../../../settings/SettingsStore"; import E2EIcon from "./E2EIcon"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; -import * as Matrix from "matrix-js-sdk"; module.exports = React.createClass({ displayName: 'MemberInfo', @@ -72,7 +72,7 @@ module.exports = React.createClass({ }, contextTypes: { - matrixClient: PropTypes.instanceOf(Matrix.MatrixClient).isRequired, + matrixClient: PropTypes.instanceOf(MatrixClient).isRequired, }, componentWillMount: function() { @@ -981,8 +981,6 @@ module.exports = React.createClass({ ; } - const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper"); - let backButton; if (this.props.member.roomId) { backButton = (