Step 3.2: Stop using getComponent

This commit is contained in:
Travis Ralston 2022-03-02 14:10:42 -07:00
parent 1bbecdff6c
commit 585c777878
2 changed files with 5 additions and 7 deletions

View file

@ -15,9 +15,10 @@ limitations under the License.
*/
import React, { CSSProperties } from 'react';
import * as sdk from 'matrix-react-sdk/src/index';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
import VectorAuthFooter from "./VectorAuthFooter";
export default class VectorAuthPage extends React.PureComponent {
static replaces = 'AuthPage';
@ -44,8 +45,6 @@ export default class VectorAuthPage extends React.PureComponent {
}
render() {
const AuthFooter = sdk.getComponent('auth.AuthFooter');
const pageStyle = {
background: `center/cover fixed url(${VectorAuthPage.getWelcomeBackgroundUrl()})`,
};
@ -80,7 +79,7 @@ export default class VectorAuthPage extends React.PureComponent {
{ this.props.children }
</div>
</div>
<AuthFooter />
<VectorAuthFooter />
</div>
);
}

View file

@ -19,7 +19,6 @@ limitations under the License.
*/
import React from 'react';
import * as sdk from 'matrix-react-sdk/src/index';
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
import { _td, newTranslatableError } from 'matrix-react-sdk/src/languageHandler';
import AutoDiscoveryUtils from 'matrix-react-sdk/src/utils/AutoDiscoveryUtils';
@ -30,6 +29,7 @@ import { IConfigOptions } from "matrix-react-sdk/src/IConfigOptions";
import { logger } from "matrix-js-sdk/src/logger";
import { createClient } from "matrix-js-sdk/src/matrix";
import { SnakedObject } from "matrix-react-sdk/src/utils/SnakedObject";
import MatrixChat from "matrix-react-sdk/src/components/structures/MatrixChat";
import { parseQs } from './url_utils';
import VectorBasePlatform from "./platform/VectorBasePlatform";
@ -133,7 +133,6 @@ export async function loadApp(fragParams: {}) {
const defaultDeviceName = snakedConfig.get("default_device_display_name")
?? platform.getDefaultDeviceDisplayName();
const MatrixChat = sdk.getComponent('structures.MatrixChat');
return <MatrixChat
onNewScreen={onNewScreen}
makeRegistrationUrl={makeRegistrationUrl}
@ -147,7 +146,7 @@ export async function loadApp(fragParams: {}) {
/>;
}
async function verifyServerConfig() {
async function verifyServerConfig(): Promise<IConfigOptions> {
let validatedConfig;
try {
logger.log("Verifying homeserver configuration");