From 135c84251c8b7b5c7f02dd81d6b914e99ec1b247 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Jan 2020 14:16:32 -0700 Subject: [PATCH] Fix more imports post-merge --- src/components/views/context_menus/TopLeftMenu.js | 2 +- src/components/views/dialogs/DMInviteDialog.js | 8 ++++---- src/components/views/elements/ToggleSwitch.js | 3 +-- src/components/views/room_settings/RoomProfileSettings.js | 2 +- src/components/views/rooms/RoomList.js | 2 +- src/components/views/settings/AvatarSetting.js | 2 +- src/components/views/settings/ProfileSettings.js | 2 +- .../views/settings/tabs/room/BridgeSettingsTab.js | 8 ++++---- src/utils/DMRoomMap.js | 2 +- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/views/context_menus/TopLeftMenu.js b/src/components/views/context_menus/TopLeftMenu.js index 4f6da336f7..528e4790c2 100644 --- a/src/components/views/context_menus/TopLeftMenu.js +++ b/src/components/views/context_menus/TopLeftMenu.js @@ -25,7 +25,7 @@ import SdkConfig from '../../../SdkConfig'; import { getHostingLink } from '../../../utils/HostingLink'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {MenuItem} from "../../structures/ContextMenu"; -import sdk from "../../../index"; +import * as sdk from "../../../index"; export class TopLeftMenu extends React.Component { static propTypes = { diff --git a/src/components/views/dialogs/DMInviteDialog.js b/src/components/views/dialogs/DMInviteDialog.js index 371768eb4e..a0d95772f9 100644 --- a/src/components/views/dialogs/DMInviteDialog.js +++ b/src/components/views/dialogs/DMInviteDialog.js @@ -17,14 +17,14 @@ limitations under the License. import React, {createRef} from 'react'; import PropTypes from 'prop-types'; import {_t} from "../../../languageHandler"; -import sdk from "../../../index"; -import MatrixClientPeg from "../../../MatrixClientPeg"; +import * as sdk from "../../../index"; +import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {makeUserPermalink} from "../../../utils/permalinks/Permalinks"; import DMRoomMap from "../../../utils/DMRoomMap"; -import {RoomMember} from "matrix-js-sdk/lib/matrix"; +import {RoomMember} from "matrix-js-sdk/src/matrix"; import * as humanize from "humanize"; import SdkConfig from "../../../SdkConfig"; -import {getHttpUriForMxc} from "matrix-js-sdk/lib/content-repo"; +import {getHttpUriForMxc} from "matrix-js-sdk/src/content-repo"; import * as Email from "../../../email"; import {getDefaultIdentityServerUrl, useDefaultIdentityServer} from "../../../utils/IdentityServerUtils"; import {abbreviateUrl} from "../../../utils/UrlUtils"; diff --git a/src/components/views/elements/ToggleSwitch.js b/src/components/views/elements/ToggleSwitch.js index b067840792..bea1a85555 100644 --- a/src/components/views/elements/ToggleSwitch.js +++ b/src/components/views/elements/ToggleSwitch.js @@ -18,8 +18,7 @@ limitations under the License. import React from "react"; import PropTypes from "prop-types"; import classNames from "classnames"; - -import sdk from "../../../index"; +import * as sdk from "../../../index"; // Controlled Toggle Switch element, written with Accessibility in mind const ToggleSwitch = ({checked, disabled=false, onChange, ...props}) => { diff --git a/src/components/views/room_settings/RoomProfileSettings.js b/src/components/views/room_settings/RoomProfileSettings.js index 2b0123192c..a1816df71a 100644 --- a/src/components/views/room_settings/RoomProfileSettings.js +++ b/src/components/views/room_settings/RoomProfileSettings.js @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import {_t} from "../../../languageHandler"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import Field from "../elements/Field"; -import sdk from "../../../index"; +import * as sdk from "../../../index"; // TODO: Merge with ProfileSettings? export default class RoomProfileSettings extends React.Component { diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index b33e3daf77..5c12b027a4 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -21,7 +21,7 @@ import React from "react"; import ReactDOM from "react-dom"; import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; -import utils from "matrix-js-sdk/lib/utils"; +import * as utils from "matrix-js-sdk/src/utils"; import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import rate_limited_func from "../../../ratelimitedfunc"; diff --git a/src/components/views/settings/AvatarSetting.js b/src/components/views/settings/AvatarSetting.js index 51ef3a4302..261a832158 100644 --- a/src/components/views/settings/AvatarSetting.js +++ b/src/components/views/settings/AvatarSetting.js @@ -17,7 +17,7 @@ limitations under the License. import React, {useCallback} from "react"; import PropTypes from "prop-types"; -import sdk from "../../../index"; +import * as sdk from "../../../index"; import {_t} from "../../../languageHandler"; import Modal from "../../../Modal"; diff --git a/src/components/views/settings/ProfileSettings.js b/src/components/views/settings/ProfileSettings.js index e386b0fe0f..8d2c289b15 100644 --- a/src/components/views/settings/ProfileSettings.js +++ b/src/components/views/settings/ProfileSettings.js @@ -20,7 +20,7 @@ import {MatrixClientPeg} from "../../../MatrixClientPeg"; import Field from "../elements/Field"; import {User} from "matrix-js-sdk"; import { getHostingLink } from '../../../utils/HostingLink'; -import sdk from "../../../index"; +import * as sdk from "../../../index"; export default class ProfileSettings extends React.Component { constructor() { diff --git a/src/components/views/settings/tabs/room/BridgeSettingsTab.js b/src/components/views/settings/tabs/room/BridgeSettingsTab.js index 3022885701..71b0169788 100644 --- a/src/components/views/settings/tabs/room/BridgeSettingsTab.js +++ b/src/components/views/settings/tabs/room/BridgeSettingsTab.js @@ -17,11 +17,11 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import {_t} from "../../../../../languageHandler"; -import MatrixClientPeg from "../../../../../MatrixClientPeg"; +import {MatrixClientPeg} from "../../../../../MatrixClientPeg"; import Pill from "../../../elements/Pill"; import {makeUserPermalink} from "../../../../../utils/permalinks/Permalinks"; import BaseAvatar from "../../../avatars/BaseAvatar"; -import { ContentRepo } from "matrix-js-sdk"; +import {getHttpUriForMxc} from "matrix-js-sdk/src/content-repo"; const BRIDGE_EVENT_TYPES = [ "uk.half-shot.bridge", @@ -83,7 +83,7 @@ export default class BridgeSettingsTab extends React.Component { let networkIcon = null; if (networkName && network.avatar) { - const avatarUrl = ContentRepo.getHttpUriForMxc( + const avatarUrl = getHttpUriForMxc( MatrixClientPeg.get().getHomeserverUrl(), network.avatar, 32, 32, "crop", ); @@ -99,7 +99,7 @@ export default class BridgeSettingsTab extends React.Component { let channelIcon = null; if (channel.avatar) { - const avatarUrl = ContentRepo.getHttpUriForMxc( + const avatarUrl = getHttpUriForMxc( MatrixClientPeg.get().getHomeserverUrl(), channel.avatar, 32, 32, "crop", ); diff --git a/src/utils/DMRoomMap.js b/src/utils/DMRoomMap.js index fb66b0a55f..547da0863b 100644 --- a/src/utils/DMRoomMap.js +++ b/src/utils/DMRoomMap.js @@ -17,7 +17,7 @@ limitations under the License. import {MatrixClientPeg} from '../MatrixClientPeg'; import _uniq from 'lodash/uniq'; -import {Room} from "matrix-js-sdk/lib/matrix"; +import {Room} from "matrix-js-sdk/src/matrix"; /** * Class that takes a Matrix Client and flips the m.direct map