]> cat aescling's git repositories - mastodon.git/blob - app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.js
Merge branch 'master' into glitch-soc/merge-upstream
[mastodon.git] / app / javascript / flavours / glitch / features / follow_requests / components / account_authorize.js
1 import React from 'react';
2 import PropTypes from 'prop-types';
3 import ImmutablePropTypes from 'react-immutable-proptypes';
4 import Permalink from 'flavours/glitch/components/permalink';
5 import Avatar from 'flavours/glitch/components/avatar';
6 import DisplayName from 'flavours/glitch/components/display_name';
7 import IconButton from 'flavours/glitch/components/icon_button';
8 import { defineMessages, injectIntl } from 'react-intl';
9 import ImmutablePureComponent from 'react-immutable-pure-component';
10
11 const messages = defineMessages({
12 authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' },
13 reject: { id: 'follow_request.reject', defaultMessage: 'Reject' },
14 });
15
16 @injectIntl
17 export default class AccountAuthorize extends ImmutablePureComponent {
18
19 static propTypes = {
20 account: ImmutablePropTypes.map.isRequired,
21 onAuthorize: PropTypes.func.isRequired,
22 onReject: PropTypes.func.isRequired,
23 intl: PropTypes.object.isRequired,
24 };
25
26 render () {
27 const { intl, account, onAuthorize, onReject } = this.props;
28 const content = { __html: account.get('note_emojified') };
29
30 return (
31 <div className='account-authorize__wrapper'>
32 <div className='account-authorize'>
33 <Permalink href={account.get('url')} to={`/accounts/${account.get('id')}`} className='detailed-status__display-name'>
34 <div className='account-authorize__avatar'><Avatar account={account} size={48} /></div>
35 <DisplayName account={account} />
36 </Permalink>
37
38 <div className='account__header__content' dangerouslySetInnerHTML={content} />
39 </div>
40
41 <div className='account--panel'>
42 <div className='account--panel__button'><IconButton title={intl.formatMessage(messages.authorize)} icon='check' onClick={onAuthorize} /></div>
43 <div className='account--panel__button'><IconButton title={intl.formatMessage(messages.reject)} icon='times' onClick={onReject} /></div>
44 </div>
45 </div>
46 );
47 }
48
49 }
This page took 0.128595 seconds and 4 git commands to generate.