* Improve screen reader accessibility of auth pages Using a combination of auto-focus + aria-live to ensure content is read as the states progress For https://element-io.atlassian.net/browse/PSB-971 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshot Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix double landmark Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update screenshot Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
59 lines
2.2 KiB
TypeScript
59 lines
2.2 KiB
TypeScript
/*
|
|
Copyright 2019-2024 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import React from "react";
|
|
import classNames from "classnames";
|
|
import { type EmptyObject } from "matrix-js-sdk/src/matrix";
|
|
|
|
import SdkConfig from "../../../SdkConfig";
|
|
import AuthPage from "./AuthPage";
|
|
import SettingsStore from "../../../settings/SettingsStore";
|
|
import { UIFeature } from "../../../settings/UIFeature";
|
|
import LanguageSelector from "./LanguageSelector";
|
|
import EmbeddedPage from "../../structures/EmbeddedPage";
|
|
import { MATRIX_LOGO_HTML } from "../../structures/static-page-vars";
|
|
|
|
export default class Welcome extends React.PureComponent<EmptyObject> {
|
|
public render(): React.ReactNode {
|
|
const pagesConfig = SdkConfig.getObject("embedded_pages");
|
|
let pageUrl: string | undefined;
|
|
if (pagesConfig) {
|
|
pageUrl = pagesConfig.get("welcome_url");
|
|
}
|
|
|
|
const replaceMap: Record<string, string> = {
|
|
"$brand": SdkConfig.get("brand"),
|
|
"$riot:ssoUrl": "#/start_sso",
|
|
"$riot:casUrl": "#/start_cas",
|
|
"$matrixLogo": MATRIX_LOGO_HTML,
|
|
"[matrix]": MATRIX_LOGO_HTML,
|
|
};
|
|
|
|
if (!pageUrl) {
|
|
// Fall back to default and replace $logoUrl in welcome.html
|
|
const brandingConfig = SdkConfig.getObject("branding");
|
|
const logoUrl = brandingConfig?.get("auth_header_logo_url") ?? "themes/element/img/logos/element-logo.svg";
|
|
replaceMap["$logoUrl"] = logoUrl;
|
|
pageUrl = "welcome.html";
|
|
}
|
|
|
|
return (
|
|
<AuthPage>
|
|
<div
|
|
className={classNames("mx_Welcome", {
|
|
mx_WelcomePage_registrationDisabled: !SettingsStore.getValue(UIFeature.Registration),
|
|
})}
|
|
data-testid="mx_welcome_screen"
|
|
>
|
|
<EmbeddedPage className="mx_WelcomePage" url={pageUrl} replaceMap={replaceMap} />
|
|
<LanguageSelector />
|
|
</div>
|
|
</AuthPage>
|
|
);
|
|
}
|
|
}
|