2017-05-03 02:04:16 +02:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import Permalink from '../../../components/permalink';
|
|
|
|
import Avatar from '../../../components/avatar';
|
|
|
|
import DisplayName from '../../../components/display_name';
|
2020-07-24 17:42:22 +02:00
|
|
|
import IconButton from '../../../components/icon_button';
|
|
|
|
import { NavLink } from 'react-router-dom';
|
2020-02-03 09:57:56 +01:00
|
|
|
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
|
2017-05-03 02:04:16 +02:00
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' },
|
2020-02-03 09:57:56 +01:00
|
|
|
reject : { id: 'follow_request.reject', defaultMessage: 'Reject' },
|
2017-05-03 02:04:16 +02:00
|
|
|
});
|
|
|
|
|
2018-09-14 17:59:48 +02:00
|
|
|
export default @injectIntl
|
|
|
|
class AccountAuthorize extends ImmutablePureComponent {
|
2017-05-03 02:04:16 +02:00
|
|
|
|
2017-05-12 14:44:10 +02:00
|
|
|
static propTypes = {
|
2020-02-03 09:57:56 +01:00
|
|
|
account : ImmutablePropTypes.map.isRequired,
|
2017-05-12 14:44:10 +02:00
|
|
|
onAuthorize: PropTypes.func.isRequired,
|
2020-02-03 09:57:56 +01:00
|
|
|
onReject : PropTypes.func.isRequired,
|
|
|
|
intl : PropTypes.object.isRequired,
|
2017-05-12 14:44:10 +02:00
|
|
|
};
|
|
|
|
|
2020-02-03 09:57:56 +01:00
|
|
|
render() {
|
2017-05-03 02:04:16 +02:00
|
|
|
const { intl, account, onAuthorize, onReject } = this.props;
|
2017-08-07 20:32:03 +02:00
|
|
|
const content = { __html: account.get('note_emojified') };
|
2017-05-03 02:04:16 +02:00
|
|
|
|
2020-07-24 17:42:22 +02:00
|
|
|
|
|
|
|
const fields = account.get('fields');
|
2017-05-03 02:04:16 +02:00
|
|
|
return (
|
|
|
|
<div className='account-authorize__wrapper'>
|
|
|
|
<div className='account-authorize'>
|
2020-02-03 09:57:56 +01:00
|
|
|
<Permalink
|
|
|
|
href={account.get('url')}
|
|
|
|
to={`/accounts/${account.get('id')}`}
|
|
|
|
className='detailed-status__display-name'
|
|
|
|
>
|
2020-07-24 17:42:22 +02:00
|
|
|
<div className='account-authorize__avatar'><Avatar
|
|
|
|
account={account}
|
|
|
|
size={48}
|
|
|
|
/></div >
|
2017-05-03 02:04:16 +02:00
|
|
|
<DisplayName account={account} />
|
2020-02-03 11:29:32 +01:00
|
|
|
</Permalink >
|
2020-07-24 17:42:22 +02:00
|
|
|
<div className='more'>
|
|
|
|
{account.get('remote_url')}
|
|
|
|
</div>
|
2017-05-03 02:04:16 +02:00
|
|
|
|
2020-02-03 09:57:56 +01:00
|
|
|
<div
|
|
|
|
className='account__header__content'
|
|
|
|
dangerouslySetInnerHTML={content}
|
|
|
|
/>
|
|
|
|
</div >
|
2020-07-24 17:42:22 +02:00
|
|
|
<span className='account-authorize--more-data'>
|
|
|
|
<NavLink
|
|
|
|
isActive={this.isStatusesPageActive}
|
|
|
|
activeClassName='active'
|
|
|
|
to={`/accounts/${account.get('id')}`}
|
|
|
|
title={intl.formatNumber(account.get('statuses_count'))}
|
|
|
|
>
|
|
|
|
<i className='fa fa-comment' />
|
|
|
|
<strong >{(account.get('statuses_count'))}</strong > <FormattedMessage
|
|
|
|
id='account.posts'
|
|
|
|
defaultMessage='Toots'
|
|
|
|
/>
|
|
|
|
</NavLink >
|
2017-05-03 02:04:16 +02:00
|
|
|
|
2020-07-24 17:42:22 +02:00
|
|
|
<NavLink
|
|
|
|
exact
|
|
|
|
activeClassName='active'
|
|
|
|
to={`/accounts/${account.get('id')}/following`}
|
|
|
|
title={intl.formatNumber(account.get('following_count'))}
|
2020-02-03 11:29:32 +01:00
|
|
|
>
|
2020-07-24 17:42:22 +02:00
|
|
|
<strong >{(account.get('following_count'))}</strong > <FormattedMessage
|
|
|
|
id='account.follows'
|
|
|
|
defaultMessage='Follows'
|
2020-02-27 13:48:21 +01:00
|
|
|
/>
|
2020-07-24 17:42:22 +02:00
|
|
|
</NavLink >
|
|
|
|
|
|
|
|
<NavLink
|
|
|
|
exact
|
|
|
|
activeClassName='active'
|
|
|
|
to={`/accounts/${account.get('id')}/followers`}
|
|
|
|
title={intl.formatNumber(account.get('followers_count'))}
|
2020-02-03 11:29:32 +01:00
|
|
|
>
|
2020-07-24 17:42:22 +02:00
|
|
|
<strong >{(account.get('followers_count'))}</strong > <FormattedMessage
|
|
|
|
id='account.followers'
|
|
|
|
defaultMessage='Followers'
|
2020-02-27 13:48:21 +01:00
|
|
|
/>
|
2020-07-24 17:42:22 +02:00
|
|
|
</NavLink >
|
|
|
|
|
|
|
|
</span >
|
|
|
|
|
|
|
|
<div className='account--panel'>
|
|
|
|
<div className='account--panel__button'><IconButton
|
|
|
|
title={intl.formatMessage(messages.authorize)}
|
|
|
|
icon='check'
|
|
|
|
onClick={onAuthorize}
|
|
|
|
/></div >
|
|
|
|
<div className='account--panel__button'><IconButton
|
|
|
|
title={intl.formatMessage(messages.reject)}
|
|
|
|
icon='times'
|
|
|
|
onClick={onReject}
|
|
|
|
/></div >
|
2020-02-03 09:57:56 +01:00
|
|
|
</div >
|
|
|
|
</div >
|
2017-05-03 02:04:16 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|