2017-05-02 20:04:16 -04:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-23 11:15:17 -04:00
|
|
|
|
|
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
|
|
|
2022-11-13 15:10:20 -05:00
|
|
|
import { Link } from 'react-router-dom';
|
2023-05-23 11:15:17 -04:00
|
|
|
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
|
2024-01-12 05:31:24 -05:00
|
|
|
import CheckIcon from '@material-symbols/svg-600/outlined/check.svg?react';
|
|
|
|
import CloseIcon from '@material-symbols/svg-600/outlined/close.svg?react';
|
2023-10-24 13:45:08 -04:00
|
|
|
|
2023-05-08 21:11:56 -04:00
|
|
|
import { Avatar } from '../../../components/avatar';
|
2023-05-09 17:08:54 -04:00
|
|
|
import { DisplayName } from '../../../components/display_name';
|
2023-05-08 21:11:56 -04:00
|
|
|
import { IconButton } from '../../../components/icon_button';
|
2017-05-02 20:04:16 -04:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' },
|
2017-05-20 11:31:47 -04:00
|
|
|
reject: { id: 'follow_request.reject', defaultMessage: 'Reject' },
|
2017-05-02 20:04:16 -04:00
|
|
|
});
|
|
|
|
|
2018-09-14 11:59:48 -04:00
|
|
|
class AccountAuthorize extends ImmutablePureComponent {
|
2017-05-02 20:04:16 -04:00
|
|
|
|
2017-05-12 08:44:10 -04:00
|
|
|
static propTypes = {
|
2023-11-03 11:00:03 -04:00
|
|
|
account: ImmutablePropTypes.record.isRequired,
|
2017-05-12 08:44:10 -04:00
|
|
|
onAuthorize: PropTypes.func.isRequired,
|
|
|
|
onReject: PropTypes.func.isRequired,
|
2017-05-20 11:31:47 -04:00
|
|
|
intl: PropTypes.object.isRequired,
|
2017-05-12 08:44:10 -04:00
|
|
|
};
|
|
|
|
|
2017-05-02 20:04:16 -04:00
|
|
|
render () {
|
|
|
|
const { intl, account, onAuthorize, onReject } = this.props;
|
2017-08-07 14:32:03 -04:00
|
|
|
const content = { __html: account.get('note_emojified') };
|
2017-05-02 20:04:16 -04:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='account-authorize__wrapper'>
|
|
|
|
<div className='account-authorize'>
|
2022-11-13 15:10:20 -05:00
|
|
|
<Link to={`/@${account.get('acct')}`} className='detailed-status__display-name'>
|
2017-08-07 13:44:55 -04:00
|
|
|
<div className='account-authorize__avatar'><Avatar account={account} size={48} /></div>
|
2017-05-02 20:04:16 -04:00
|
|
|
<DisplayName account={account} />
|
2022-11-13 15:10:20 -05:00
|
|
|
</Link>
|
2017-05-02 20:04:16 -04:00
|
|
|
|
2021-01-22 04:09:23 -05:00
|
|
|
<div className='account__header__content translate' dangerouslySetInnerHTML={content} />
|
2017-05-02 20:04:16 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className='account--panel'>
|
2023-10-24 13:45:08 -04:00
|
|
|
<div className='account--panel__button'><IconButton title={intl.formatMessage(messages.authorize)} icon='check' iconComponent={CheckIcon} onClick={onAuthorize} /></div>
|
|
|
|
<div className='account--panel__button'><IconButton title={intl.formatMessage(messages.reject)} icon='times' iconComponent={CloseIcon} onClick={onReject} /></div>
|
2017-05-02 20:04:16 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-23 22:17:53 -04:00
|
|
|
|
|
|
|
export default injectIntl(AccountAuthorize);
|