Merge pull request #8528 from jryans/config-branding
Support configurable welcome background and logo
This commit is contained in:
commit
994d4aa63f
|
@ -127,6 +127,11 @@ For a good example, see https://riot.im/develop/config.json
|
|||
release to release.
|
||||
1. `brand`: String to pass to your homeserver when configuring email notifications, to let the
|
||||
homeserver know what email template to use when talking to you.
|
||||
1. `branding`: Configures various branding and logo details, such as:
|
||||
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
|
||||
during authentication flows
|
||||
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
|
||||
authentication flows
|
||||
1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations
|
||||
server is not Riot and normally not your homeserver either. The integration server settings
|
||||
may be left blank to disable integrations.
|
||||
|
|
|
@ -19,23 +19,26 @@ limitations under the License.
|
|||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
|
||||
|
||||
const LOGO_URI = "themes/riot/img/logos/riot-im-logo-black-text.svg";
|
||||
export default class VectorAuthHeaderLogo extends React.PureComponent {
|
||||
static replaces = 'AuthHeaderLogo'
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'VectorAuthHeaderLogo',
|
||||
statics: {
|
||||
replaces: 'AuthHeaderLogo',
|
||||
},
|
||||
propTypes: {
|
||||
static propTypes = {
|
||||
icon: PropTypes.string,
|
||||
},
|
||||
}
|
||||
|
||||
render() {
|
||||
const brandingConfig = SdkConfig.get().branding;
|
||||
let logoUrl = "themes/riot/img/logos/riot-im-logo-black-text.svg";
|
||||
if (brandingConfig && brandingConfig.authHeaderLogoUrl) {
|
||||
logoUrl = brandingConfig.authHeaderLogoUrl;
|
||||
}
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<div className="mx_AuthHeaderLogo">
|
||||
<img src={LOGO_URI} alt="Riot" />
|
||||
<img src={logoUrl} alt="Riot" />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,21 +16,24 @@ limitations under the License.
|
|||
|
||||
'use strict';
|
||||
|
||||
const React = require('react');
|
||||
import React from 'react';
|
||||
import sdk from 'matrix-react-sdk/lib/index';
|
||||
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
|
||||
|
||||
module.exports = React.createClass({
|
||||
displayName: 'VectorAuthPage',
|
||||
export default class VectorAuthPage extends React.PureComponent {
|
||||
static replaces = 'AuthPage'
|
||||
|
||||
statics: {
|
||||
replaces: 'AuthPage',
|
||||
},
|
||||
|
||||
render: function() {
|
||||
render() {
|
||||
const AuthFooter = sdk.getComponent('auth.AuthFooter');
|
||||
|
||||
const brandingConfig = SdkConfig.get().branding;
|
||||
let backgroundUrl = "themes/riot/img/backgrounds/valley.jpg";
|
||||
if (brandingConfig && brandingConfig.welcomeBackgroundUrl) {
|
||||
backgroundUrl = brandingConfig.welcomeBackgroundUrl;
|
||||
}
|
||||
|
||||
const pageStyle = {
|
||||
background: 'center/cover fixed url(themes/riot/img/backgrounds/valley.jpg)',
|
||||
background: `center/cover fixed url(${backgroundUrl})`,
|
||||
};
|
||||
|
||||
const modalStyle = {
|
||||
|
@ -66,5 +69,5 @@ module.exports = React.createClass({
|
|||
<AuthFooter />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue