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.

61 lines
2.1 KiB

  1. import ImmutablePropTypes from 'react-immutable-proptypes';
  2. import Permalink from '../../../components/permalink';
  3. import Avatar from '../../../components/avatar';
  4. import DisplayName from '../../../components/display_name';
  5. import emojify from '../../../emoji';
  6. import IconButton from '../../../components/icon_button';
  7. import { defineMessages, injectIntl } from 'react-intl';
  8. const messages = defineMessages({
  9. authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' },
  10. reject: { id: 'follow_request.reject', defaultMessage: 'Reject' }
  11. });
  12. const outerStyle = {
  13. padding: '14px 10px'
  14. };
  15. const panelStyle = {
  16. background: '#2f3441',
  17. display: 'flex',
  18. flexDirection: 'row',
  19. borderTop: '1px solid #363c4b',
  20. borderBottom: '1px solid #363c4b',
  21. padding: '10px 0'
  22. };
  23. const btnStyle = {
  24. flex: '1 1 auto',
  25. textAlign: 'center'
  26. };
  27. const AccountAuthorize = ({ intl, account, onAuthorize, onReject }) => {
  28. const content = { __html: emojify(account.get('note')) };
  29. return (
  30. <div>
  31. <div style={outerStyle}>
  32. <Permalink href={account.get('url')} className='detailed-status__display-name' style={{ display: 'block', overflow: 'hidden', marginBottom: '15px' }}>
  33. <div style={{ float: 'left', marginRight: '10px' }}><Avatar src={account.get('avatar')} size={48} /></div>
  34. <DisplayName account={account} />
  35. </Permalink>
  36. <div style={{ color: '#616b86', fontSize: '14px' }} className='account__header__content' dangerouslySetInnerHTML={content} />
  37. </div>
  38. <div style={panelStyle}>
  39. <div style={btnStyle}><IconButton title={intl.formatMessage(messages.authorize)} icon='check' onClick={onAuthorize} /></div>
  40. <div style={btnStyle}><IconButton title={intl.formatMessage(messages.reject)} icon='times' onClick={onReject} /></div>
  41. </div>
  42. </div>
  43. )
  44. };
  45. AccountAuthorize.propTypes = {
  46. account: ImmutablePropTypes.map.isRequired,
  47. onAuthorize: React.PropTypes.func.isRequired,
  48. onReject: React.PropTypes.func.isRequired,
  49. intl: React.PropTypes.object.isRequired
  50. };
  51. export default injectIntl(AccountAuthorize);