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.

37 lines
1.1 KiB

  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { connect } from 'react-redux';
  4. import { revealAccount } from 'mastodon/actions/accounts';
  5. import { FormattedMessage } from 'react-intl';
  6. import Button from 'mastodon/components/button';
  7. import { domain } from 'mastodon/initial_state';
  8. const mapDispatchToProps = (dispatch, { accountId }) => ({
  9. reveal () {
  10. dispatch(revealAccount(accountId));
  11. },
  12. });
  13. class LimitedAccountHint extends React.PureComponent {
  14. static propTypes = {
  15. accountId: PropTypes.string.isRequired,
  16. reveal: PropTypes.func,
  17. };
  18. render () {
  19. const { reveal } = this.props;
  20. return (
  21. <div className='limited-account-hint'>
  22. <p><FormattedMessage id='limited_account_hint.title' defaultMessage='This profile has been hidden by the moderators of {domain}.' values={{ domain }} /></p>
  23. <Button onClick={reveal}><FormattedMessage id='limited_account_hint.action' defaultMessage='Show profile anyway' /></Button>
  24. </div>
  25. );
  26. }
  27. }
  28. export default connect(() => {}, mapDispatchToProps)(LimitedAccountHint);