forked from matrix/element-web
Merge branch 'develop' into travis/room-list/enable
This commit is contained in:
commit
e6706b0e7b
|
@ -31,8 +31,7 @@
|
||||||
"feature_pinning": "labs",
|
"feature_pinning": "labs",
|
||||||
"feature_custom_status": "labs",
|
"feature_custom_status": "labs",
|
||||||
"feature_custom_tags": "labs",
|
"feature_custom_tags": "labs",
|
||||||
"feature_state_counters": "labs",
|
"feature_state_counters": "labs"
|
||||||
"feature_irc_ui": "labs"
|
|
||||||
},
|
},
|
||||||
"default_federate": true,
|
"default_federate": true,
|
||||||
"default_theme": "light",
|
"default_theme": "light",
|
||||||
|
|
|
@ -116,8 +116,3 @@ In the event the new room list needs to be disabled, add this to your config.jso
|
||||||
|
|
||||||
**Note**: In a future release the new room list will not be optional.
|
**Note**: In a future release the new room list will not be optional.
|
||||||
|
|
||||||
## IRC message layout (`feature_irc_ui`)
|
|
||||||
|
|
||||||
Adds an option to change the message layout to an IRC style ` timestamp | avatar
|
|
||||||
| name | message `
|
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
"feature_dm_verification": "labs",
|
"feature_dm_verification": "labs",
|
||||||
"feature_bridge_state": "labs",
|
"feature_bridge_state": "labs",
|
||||||
"feature_presence_in_room_list": "labs",
|
"feature_presence_in_room_list": "labs",
|
||||||
"feature_custom_themes": "labs",
|
"feature_custom_themes": "labs"
|
||||||
"feature_irc_ui": "labs"
|
|
||||||
},
|
},
|
||||||
"piwik": {
|
"piwik": {
|
||||||
"url": "https://piwik.riot.im/",
|
"url": "https://piwik.riot.im/",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2019 New Vector Ltd
|
Copyright 2019, 2020 New Vector Ltd
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import * as sdk from 'matrix-react-sdk/src/index';
|
import * as sdk from 'matrix-react-sdk/src/index';
|
||||||
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
|
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
|
||||||
|
@ -23,21 +21,31 @@ import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
|
||||||
export default class VectorAuthPage extends React.PureComponent {
|
export default class VectorAuthPage extends React.PureComponent {
|
||||||
static replaces = 'AuthPage'
|
static replaces = 'AuthPage'
|
||||||
|
|
||||||
|
static welcomeBackgroundUrl;
|
||||||
|
|
||||||
|
// cache the url as a static to prevent it changing without refreshing
|
||||||
|
static getWelcomeBackgroundUrl() {
|
||||||
|
if (VectorAuthPage.welcomeBackgroundUrl) return VectorAuthPage.welcomeBackgroundUrl;
|
||||||
|
|
||||||
|
const brandingConfig = SdkConfig.get().branding;
|
||||||
|
VectorAuthPage.welcomeBackgroundUrl = "themes/riot/img/backgrounds/valley.jpg";
|
||||||
|
if (brandingConfig && brandingConfig.welcomeBackgroundUrl) {
|
||||||
|
if (Array.isArray(brandingConfig.welcomeBackgroundUrl)) {
|
||||||
|
const index = Math.floor(Math.random() * brandingConfig.welcomeBackgroundUrl.length);
|
||||||
|
VectorAuthPage.welcomeBackgroundUrl = brandingConfig.welcomeBackgroundUrl[index];
|
||||||
|
} else {
|
||||||
|
VectorAuthPage.welcomeBackgroundUrl = brandingConfig.welcomeBackgroundUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return VectorAuthPage.welcomeBackgroundUrl;
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const AuthFooter = sdk.getComponent('auth.AuthFooter');
|
const AuthFooter = sdk.getComponent('auth.AuthFooter');
|
||||||
|
|
||||||
const brandingConfig = SdkConfig.get().branding;
|
|
||||||
let backgroundUrl = "themes/riot/img/backgrounds/valley.jpg";
|
|
||||||
if (brandingConfig && brandingConfig.welcomeBackgroundUrl) {
|
|
||||||
if (Array.isArray(brandingConfig.welcomeBackgroundUrl)) {
|
|
||||||
backgroundUrl = brandingConfig.welcomeBackgroundUrl[Math.floor(Math.random() * brandingConfig.welcomeBackgroundUrl.length)];
|
|
||||||
} else {
|
|
||||||
backgroundUrl = brandingConfig.welcomeBackgroundUrl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const pageStyle = {
|
const pageStyle = {
|
||||||
background: `center/cover fixed url(${backgroundUrl})`,
|
background: `center/cover fixed url(${VectorAuthPage.getWelcomeBackgroundUrl()})`,
|
||||||
};
|
};
|
||||||
|
|
||||||
const modalStyle = {
|
const modalStyle = {
|
||||||
|
@ -65,7 +73,7 @@ export default class VectorAuthPage extends React.PureComponent {
|
||||||
return (
|
return (
|
||||||
<div className="mx_AuthPage" style={pageStyle}>
|
<div className="mx_AuthPage" style={pageStyle}>
|
||||||
<div className="mx_AuthPage_modal" style={modalStyle}>
|
<div className="mx_AuthPage_modal" style={modalStyle}>
|
||||||
<div className="mx_AuthPage_modalBlur" style={blurStyle}></div>
|
<div className="mx_AuthPage_modalBlur" style={blurStyle} />
|
||||||
<div className="mx_AuthPage_modalContent" style={modalContentStyle}>
|
<div className="mx_AuthPage_modalContent" style={modalContentStyle}>
|
||||||
{ this.props.children }
|
{ this.props.children }
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue