2019-01-23 04:28:23 +03:00
|
|
|
/*
|
|
|
|
Copyright 2019 New Vector Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2020-01-23 21:14:08 +03:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import classnames from 'classnames';
|
2019-01-23 04:28:23 +03:00
|
|
|
|
|
|
|
export default class AuthBody extends React.PureComponent {
|
2020-01-23 21:14:08 +03:00
|
|
|
static PropTypes = {
|
|
|
|
header: PropTypes.bool,
|
|
|
|
};
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
header: true,
|
|
|
|
};
|
|
|
|
|
2019-01-23 04:28:23 +03:00
|
|
|
render() {
|
2020-01-23 21:14:08 +03:00
|
|
|
const classes = {
|
|
|
|
'mx_AuthBody': true,
|
|
|
|
'mx_AuthBody_noHeader': !this.props.header,
|
2020-01-24 22:11:57 +03:00
|
|
|
// 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,
|
2020-01-23 21:14:08 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
return <div className={classnames(classes)}>
|
2019-01-23 04:28:23 +03:00
|
|
|
{ this.props.children }
|
|
|
|
</div>;
|
|
|
|
}
|
|
|
|
}
|