You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
4 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React, { Component } from 'react';
|
||
|
import SiteIcon from '../../ui/site-icon';
|
||
5 years ago
|
|
||
|
export default class PermissionsConnectHeader extends Component {
|
||
|
static propTypes = {
|
||
|
icon: PropTypes.string,
|
||
4 years ago
|
iconName: PropTypes.string.isRequired,
|
||
|
siteOrigin: PropTypes.string.isRequired,
|
||
5 years ago
|
headerTitle: PropTypes.node,
|
||
|
headerText: PropTypes.string,
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
|
static defaultProps = {
|
||
|
icon: null,
|
||
|
headerTitle: '',
|
||
|
headerText: '',
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
renderHeaderIcon() {
|
||
4 years ago
|
const { icon, iconName, siteOrigin } = this.props;
|
||
5 years ago
|
|
||
|
return (
|
||
|
<div className="permissions-connect-header__icon">
|
||
4 years ago
|
<SiteIcon icon={icon} name={iconName} size={64} />
|
||
4 years ago
|
<div className="permissions-connect-header__text">{siteOrigin}</div>
|
||
5 years ago
|
</div>
|
||
4 years ago
|
);
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
render() {
|
||
4 years ago
|
const { headerTitle, headerText } = this.props;
|
||
5 years ago
|
return (
|
||
|
<div className="permissions-connect-header">
|
||
4 years ago
|
{this.renderHeaderIcon()}
|
||
|
<div className="permissions-connect-header__title">{headerTitle}</div>
|
||
|
<div className="permissions-connect-header__subtitle">{headerText}</div>
|
||
5 years ago
|
</div>
|
||
4 years ago
|
);
|
||
5 years ago
|
}
|
||
|
}
|