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.

43 lines
1.2 KiB

  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import IconButton from './icon_button';
  4. import { defineMessages, injectIntl } from 'react-intl';
  5. import ImmutablePureComponent from 'react-immutable-pure-component';
  6. const messages = defineMessages({
  7. unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' },
  8. });
  9. class Account extends ImmutablePureComponent {
  10. static propTypes = {
  11. domain: PropTypes.string,
  12. onUnblockDomain: PropTypes.func.isRequired,
  13. intl: PropTypes.object.isRequired,
  14. };
  15. handleDomainUnblock = () => {
  16. this.props.onUnblockDomain(this.props.domain);
  17. };
  18. render () {
  19. const { domain, intl } = this.props;
  20. return (
  21. <div className='domain'>
  22. <div className='domain__wrapper'>
  23. <span className='domain__domain-name'>
  24. <strong>{domain}</strong>
  25. </span>
  26. <div className='domain__buttons'>
  27. <IconButton active icon='unlock' title={intl.formatMessage(messages.unblockDomain, { domain })} onClick={this.handleDomainUnblock} />
  28. </div>
  29. </div>
  30. </div>
  31. );
  32. }
  33. }
  34. export default injectIntl(Account);