VectorAuthFooter.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. Copyright 2015, 2016 OpenMarket Ltd
  3. Copyright 2019 New Vector Ltd
  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. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. import React, { ReactElement } from "react";
  15. import SdkConfig from "matrix-react-sdk/src/SdkConfig";
  16. import { _t } from "matrix-react-sdk/src/languageHandler";
  17. const VectorAuthFooter = (): ReactElement => {
  18. const brandingConfig = SdkConfig.getObject("branding");
  19. const links = brandingConfig?.get("auth_footer_links") ?? [
  20. { text: "Blog", url: "https://element.io/blog" },
  21. { text: "Twitter", url: "https://twitter.com/element_hq" },
  22. { text: "GitHub", url: "https://github.com/vector-im/element-web" },
  23. ];
  24. const authFooterLinks = [];
  25. for (const linkEntry of links) {
  26. authFooterLinks.push(
  27. <a href={linkEntry.url} key={linkEntry.text} target="_blank" rel="noreferrer noopener">
  28. {linkEntry.text}
  29. </a>,
  30. );
  31. }
  32. return (
  33. <footer className="mx_AuthFooter" role="contentinfo">
  34. {authFooterLinks}
  35. <a href="https://matrix.org" target="_blank" rel="noreferrer noopener">
  36. {_t("Powered by Matrix")}
  37. </a>
  38. </footer>
  39. );
  40. };
  41. export default VectorAuthFooter;