From 5459c1eb9630da9af26060f48bbf110514a24a94 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 24 Mar 2022 23:43:46 -0600 Subject: [PATCH] Step 10.2: Move hacky welcome page replacement to react-sdk --- res/welcome.html | 3 +- res/welcome/images/matrix.svg | 153 ------------------ .../structures/VectorEmbeddedPage.tsx | 34 ---- src/i18n/strings/en_EN.json | 2 +- 4 files changed, 3 insertions(+), 189 deletions(-) delete mode 100644 res/welcome/images/matrix.svg delete mode 100644 src/components/structures/VectorEmbeddedPage.tsx diff --git a/res/welcome.html b/res/welcome.html index bb3f84fe64..ef01d8876c 100644 --- a/res/welcome.html +++ b/res/welcome.html @@ -173,7 +173,8 @@ we don't have an account and should hide them. No account == no guest account ei

_t("Welcome to Element")

-

_t("Decentralised, encrypted chat & collaboration powered by [matrix]")

+ +

_t("Decentralised, encrypted chat & collaboration powered by $matrixLogo")

diff --git a/res/welcome/images/matrix.svg b/res/welcome/images/matrix.svg deleted file mode 100644 index 13adcab25a..0000000000 --- a/res/welcome/images/matrix.svg +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/structures/VectorEmbeddedPage.tsx b/src/components/structures/VectorEmbeddedPage.tsx deleted file mode 100644 index 85adb2fb3f..0000000000 --- a/src/components/structures/VectorEmbeddedPage.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2016 OpenMarket Ltd -Copyright 2017 Vector Creations Ltd -Copyright 2019 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import EmbeddedPage from 'matrix-react-sdk/src/components/structures/EmbeddedPage'; -import sanitizeHtml from 'sanitize-html'; -import { _t } from 'matrix-react-sdk/src/languageHandler'; - -export default class VectorEmbeddedPage extends EmbeddedPage { - static replaces = 'EmbeddedPage'; - - // we're overriding the base component here, for Element-specific tweaks - translate(s: string) { - s = sanitizeHtml(_t(s)); - // ugly fix for https://github.com/vector-im/element-web/issues/4243 - // eslint-disable-next-line max-len - s = s.replace(/\[matrix\]/, 'Matrix'); - return s; - } -} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 24cdd0fc3d..aef27979d6 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -26,7 +26,7 @@ "Go to element.io": "Go to element.io", "Failed to start": "Failed to start", "Welcome to Element": "Welcome to Element", - "Decentralised, encrypted chat & collaboration powered by [matrix]": "Decentralised, encrypted chat & collaboration powered by [matrix]", + "Decentralised, encrypted chat & collaboration powered by $matrixLogo": "Decentralised, encrypted chat & collaboration powered by $matrixLogo", "Sign In": "Sign In", "Create Account": "Create Account", "Explore rooms": "Explore rooms"