2021-02-04 19:15:23 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import SiteIcon from '../../ui/site-icon';
|
2020-04-02 11:09:53 +02:00
|
|
|
|
|
|
|
export default class PermissionsConnectHeader extends Component {
|
|
|
|
static propTypes = {
|
|
|
|
icon: PropTypes.string,
|
2020-07-02 19:08:43 +02:00
|
|
|
iconName: PropTypes.string.isRequired,
|
|
|
|
siteOrigin: PropTypes.string.isRequired,
|
2020-04-02 11:09:53 +02:00
|
|
|
headerTitle: PropTypes.node,
|
|
|
|
headerText: PropTypes.string,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2020-04-02 11:09:53 +02:00
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
icon: null,
|
|
|
|
headerTitle: '',
|
|
|
|
headerText: '',
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2020-04-02 11:09:53 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
renderHeaderIcon() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { icon, iconName, siteOrigin } = this.props;
|
2020-04-02 11:09:53 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="permissions-connect-header__icon">
|
2020-11-03 00:41:28 +01:00
|
|
|
<SiteIcon icon={icon} name={iconName} size={64} />
|
2020-07-02 19:08:43 +02:00
|
|
|
<div className="permissions-connect-header__text">{siteOrigin}</div>
|
2020-04-02 11:09:53 +02:00
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-04-02 11:09:53 +02:00
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { headerTitle, headerText } = this.props;
|
2020-04-02 11:09:53 +02:00
|
|
|
return (
|
|
|
|
<div className="permissions-connect-header">
|
2020-11-03 00:41:28 +01:00
|
|
|
{this.renderHeaderIcon()}
|
|
|
|
<div className="permissions-connect-header__title">{headerTitle}</div>
|
|
|
|
<div className="permissions-connect-header__subtitle">{headerText}</div>
|
2020-04-02 11:09:53 +02:00
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-04-02 11:09:53 +02:00
|
|
|
}
|
|
|
|
}
|