logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

domain.js (1165B)


  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: 'Unhide {domain}' },
  8. });
  9. @injectIntl
  10. export default class Account extends ImmutablePureComponent {
  11. static propTypes = {
  12. domain: PropTypes.string,
  13. onUnblockDomain: PropTypes.func.isRequired,
  14. intl: PropTypes.object.isRequired,
  15. };
  16. handleDomainUnblock = () => {
  17. this.props.onUnblockDomain(this.props.domain);
  18. }
  19. render () {
  20. const { domain, intl } = this.props;
  21. return (
  22. <div className='domain'>
  23. <div className='domain__wrapper'>
  24. <span className='domain__domain-name'>
  25. <strong>{domain}</strong>
  26. </span>
  27. <div className='domain__buttons'>
  28. <IconButton active icon='unlock-alt' title={intl.formatMessage(messages.unblockDomain, { domain })} onClick={this.handleDomainUnblock} />
  29. </div>
  30. </div>
  31. </div>
  32. );
  33. }
  34. }