2022-05-10 07:44:35 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-23 15:15:17 +00:00
|
|
|
import { PureComponent } from 'react';
|
|
|
|
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
2022-05-10 07:44:35 +00:00
|
|
|
import { connect } from 'react-redux';
|
2023-05-23 15:15:17 +00:00
|
|
|
|
2022-05-10 07:44:35 +00:00
|
|
|
import { revealAccount } from 'mastodon/actions/accounts';
|
|
|
|
import Button from 'mastodon/components/button';
|
2022-11-04 01:28:37 +00:00
|
|
|
import { domain } from 'mastodon/initial_state';
|
2022-05-10 07:44:35 +00:00
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch, { accountId }) => ({
|
|
|
|
|
|
|
|
reveal () {
|
|
|
|
dispatch(revealAccount(accountId));
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2023-05-23 08:52:27 +00:00
|
|
|
class LimitedAccountHint extends PureComponent {
|
2022-05-10 07:44:35 +00:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
accountId: PropTypes.string.isRequired,
|
|
|
|
reveal: PropTypes.func,
|
2023-01-30 00:45:35 +00:00
|
|
|
};
|
2022-05-10 07:44:35 +00:00
|
|
|
|
|
|
|
render () {
|
|
|
|
const { reveal } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='limited-account-hint'>
|
2022-11-04 01:28:37 +00:00
|
|
|
<p><FormattedMessage id='limited_account_hint.title' defaultMessage='This profile has been hidden by the moderators of {domain}.' values={{ domain }} /></p>
|
2022-05-10 07:44:35 +00:00
|
|
|
<Button onClick={reveal}><FormattedMessage id='limited_account_hint.action' defaultMessage='Show profile anyway' /></Button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-24 02:17:53 +00:00
|
|
|
|
|
|
|
export default connect(() => {}, mapDispatchToProps)(LimitedAccountHint);
|