Add separate component for post-auth security flows

Instead of twisting `AuthBody`, this adds a new component for the different
styling of post-auth security flows. This also makes them fixed width and
adjusts padding to match designs.
This commit is contained in:
J. Ryan Stinnett 2020-01-27 22:27:11 +00:00
parent 805e9abb39
commit 89f110f60a
8 changed files with 83 additions and 38 deletions

View file

@ -17,29 +17,10 @@ limitations under the License.
'use strict';
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
export default class AuthBody extends React.PureComponent {
static PropTypes = {
header: PropTypes.bool,
};
static defaultProps = {
header: true,
};
render() {
const classes = {
'mx_AuthBody': true,
'mx_AuthBody_noHeader': !this.props.header,
// XXX The login pages all use a smaller fonts size but we don't want this
// for subsequent auth screens like the e2e setup. Doing this a terrible way
// for now.
'mx_AuthBody_loginRegister': this.props.header,
};
return <div className={classnames(classes)}>
return <div className="mx_AuthBody">
{ this.props.children }
</div>;
}