2021-02-04 19:15:23 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { Component } from 'react';
|
2021-12-02 18:22:18 +01:00
|
|
|
import SiteOrigin from '../../ui/site-origin/site-origin';
|
2020-04-02 11:09:53 +02:00
|
|
|
|
|
|
|
export default class PermissionsConnectHeader extends Component {
|
|
|
|
static propTypes = {
|
2021-12-15 00:54:46 +01:00
|
|
|
iconUrl: 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 = {
|
2021-12-15 00:54:46 +01:00
|
|
|
iconUrl: null,
|
2020-04-02 11:09:53 +02:00
|
|
|
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-12-15 00:54:46 +01:00
|
|
|
const { iconUrl, iconName, siteOrigin } = this.props;
|
2020-04-02 11:09:53 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="permissions-connect-header__icon">
|
2021-12-15 00:54:46 +01:00
|
|
|
<SiteOrigin siteOrigin={siteOrigin} iconSrc={iconUrl} name={iconName} />
|
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
|
|
|
}
|
|
|
|
}
|