From da9f1d1fa37f44073a0c0b40a2d41614c9ffa9da Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 6 Aug 2019 18:22:11 +0100 Subject: [PATCH] discard create-react-class, no point using it here. use React.FC Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- package.json | 1 - src/components/views/auth/VectorAuthFooter.js | 61 +++++++++--------- .../views/auth/VectorCustomServerDialog.js | 63 +++++++++---------- 3 files changed, 57 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 7173e1fa52..63d34d88e6 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,6 @@ "babel-runtime": "^6.26.0", "bluebird": "^3.5.2", "browser-request": "^0.3.3", - "create-react-class": "^15.6.0", "draft-js": "^0.11.0-alpha", "extract-text-webpack-plugin": "^4.0.0-beta.0", "favico.js": "^0.3.10", diff --git a/src/components/views/auth/VectorAuthFooter.js b/src/components/views/auth/VectorAuthFooter.js index fd40979052..a5f27350cf 100644 --- a/src/components/views/auth/VectorAuthFooter.js +++ b/src/components/views/auth/VectorAuthFooter.js @@ -16,43 +16,38 @@ limitations under the License. */ import React from 'react'; -import createReactClass from 'create-react-class'; import SdkConfig from 'matrix-react-sdk/lib/SdkConfig'; import { _t } from 'matrix-react-sdk/lib/languageHandler'; -module.exports = createReactClass({ - displayName: 'VectorAuthFooter', - statics: { - replaces: 'AuthFooter', - }, +module.exports = () => { + const brandingConfig = SdkConfig.get().branding; + let links = [ + {"text": "blog", "url": "https://medium.com/@RiotChat"}, + {"text": "twitter", "url": "https://twitter.com/@RiotChat"}, + {"text": "github", "url": "https://github.com/vector-im/riot-web"}, + ]; - render: function() { - const brandingConfig = SdkConfig.get().branding; - let links = [ - {"text": "blog", "url": "https://medium.com/@RiotChat"}, - {"text": "twitter", "url": "https://twitter.com/@RiotChat"}, - {"text": "github", "url": "https://github.com/vector-im/riot-web"}, - ]; + if (brandingConfig && brandingConfig.authFooterLinks) { + links = brandingConfig.authFooterLinks; + } - if (brandingConfig && brandingConfig.authFooterLinks) { - links = brandingConfig.authFooterLinks; - } - - const authFooterLinks = []; - for (const linkEntry of links) { - authFooterLinks.push( - - {linkEntry.text} - , - ); - } - - return ( -
- {authFooterLinks} - { _t('powered by Matrix') } -
+ const authFooterLinks = []; + for (const linkEntry of links) { + authFooterLinks.push( + + {linkEntry.text} + , ); - }, -}); + } + + return ( +
+ {authFooterLinks} + { _t('powered by Matrix') } +
+ ); +}; +module.exports.statics = { + replaces: 'AuthFooter', +}; diff --git a/src/components/views/auth/VectorCustomServerDialog.js b/src/components/views/auth/VectorCustomServerDialog.js index f959321880..cf2ba1abbf 100644 --- a/src/components/views/auth/VectorCustomServerDialog.js +++ b/src/components/views/auth/VectorCustomServerDialog.js @@ -16,44 +16,39 @@ limitations under the License. */ import React from "react"; -import createReactClass from 'create-react-class'; import { _t } from 'matrix-react-sdk/lib/languageHandler'; /** * This is identical to `CustomServerDialog` except for replacing "this app" * with "Riot". */ -module.exports = createReactClass({ - displayName: 'VectorCustomServerDialog', - statics: { - replaces: 'CustomServerDialog', - }, - - render: function() { - return ( -
-
- { _t('Custom Server Options') } -
-
-

{_t( - "You can use the custom server options to sign into other " + - "Matrix servers by specifying a different homeserver URL. This " + - "allows you to use Riot with an existing Matrix account on a " + - "different homeserver.", - )}

-

{_t( - "You can also set a custom identity server, but you won't be " + - "able to invite users by email address, or be invited by email " + - "address yourself.", - )}

-
-
- -
+module.exports = () => { + return ( +
+
+ { _t('Custom Server Options') }
- ); - }, -}); +
+

{_t( + "You can use the custom server options to sign into other " + + "Matrix servers by specifying a different homeserver URL. This " + + "allows you to use Riot with an existing Matrix account on a " + + "different homeserver.", + )}

+

{_t( + "You can also set a custom identity server, but you won't be " + + "able to invite users by email address, or be invited by email " + + "address yourself.", + )}

+
+
+ +
+
+ ); +}; +module.exports.statics = { + replaces: 'CustomServerDialog', +};