Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 63091e7

Browse files
committed
Step 10.2: Move matrix logo replacement into react-sdk
1 parent 661b8d5 commit 63091e7

File tree

4 files changed

+182
-2
lines changed

4 files changed

+182
-2
lines changed

res/img/matrix.svg

Lines changed: 153 additions & 0 deletions
Loading

src/components/structures/EmbeddedPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
5757
};
5858
}
5959

60-
protected translate(s: string): string {
61-
// default implementation - skins may wish to extend this
60+
private translate(s: string): string {
6261
return sanitizeHtml(_t(s));
6362
}
6463

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Copyright 2022 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// We're importing via require specifically so the svg becomes a URI rather than a DOM element.
18+
// eslint-disable-next-line @typescript-eslint/no-var-requires
19+
const matrixSvg = require('../../../res/img/matrix.svg').default;
20+
21+
/**
22+
* Intended to replace $matrixLogo in the welcome page.
23+
*/
24+
export const MATRIX_LOGO_HTML = `<a href="https://matrix.org" target="_blank" rel="noreferrer noopener">
25+
<img width="79" height="34" alt="Matrix" style="padding-left: 1px;vertical-align: middle" src="${matrixSvg}"/>
26+
</a>`;

src/components/views/auth/Welcome.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import SettingsStore from "../../../settings/SettingsStore";
2424
import { UIFeature } from "../../../settings/UIFeature";
2525
import LanguageSelector from "./LanguageSelector";
2626
import EmbeddedPage from "../../structures/EmbeddedPage";
27+
import { MATRIX_LOGO_HTML } from "../../structures/static-page-vars";
2728

2829
// translatable strings for Welcome pages
2930
_td("Sign in with SSO");
@@ -54,6 +55,7 @@ export default class Welcome extends React.PureComponent<IProps> {
5455
replaceMap={{
5556
"$riot:ssoUrl": "#/start_sso",
5657
"$riot:casUrl": "#/start_cas",
58+
"$matrixLogo": MATRIX_LOGO_HTML,
5759
}}
5860
/>
5961
<LanguageSelector />

0 commit comments

Comments
 (0)