gab-social/app/javascript/gabsocial/components/domain/index.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

import IconButton from '../icon_button';
2019-07-02 08:10:25 +01:00
import { defineMessages, injectIntl } from 'react-intl';
import './index.scss';
2019-07-02 08:10:25 +01:00
const messages = defineMessages({
unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },
});
export default @injectIntl
class Domain extends PureComponent {
2019-07-02 08:10:25 +01:00
static propTypes = {
domain: PropTypes.string,
onUnblockDomain: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
handleDomainUnblock = () => {
this.props.onUnblockDomain(this.props.domain);
}
render () {
const { domain, intl } = this.props;
return (
<div className='domain'>
<div className='domain__wrapper'>
<span className='domain__name'>
2019-07-02 08:10:25 +01:00
<strong>{domain}</strong>
</span>
<div className='domain__buttons'>
<IconButton
active
icon='unlock'
title={intl.formatMessage(messages.unblockDomain, {
domain,
})}
onClick={this.handleDomainUnblock}
/>
2019-07-02 08:10:25 +01:00
</div>
</div>
</div>
);
}
}