logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

account_authorize.js (1980B)


  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import ImmutablePropTypes from 'react-immutable-proptypes';
  4. import Permalink from '../../../components/permalink';
  5. import Avatar from '../../../components/avatar';
  6. import DisplayName from '../../../components/display_name';
  7. import IconButton from '../../../components/icon_button';
  8. import { defineMessages, injectIntl } from 'react-intl';
  9. import ImmutablePureComponent from 'react-immutable-pure-component';
  10. const messages = defineMessages({
  11. authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' },
  12. reject: { id: 'follow_request.reject', defaultMessage: 'Reject' },
  13. });
  14. @injectIntl
  15. export default class AccountAuthorize extends ImmutablePureComponent {
  16. static propTypes = {
  17. account: ImmutablePropTypes.map.isRequired,
  18. onAuthorize: PropTypes.func.isRequired,
  19. onReject: PropTypes.func.isRequired,
  20. intl: PropTypes.object.isRequired,
  21. };
  22. render () {
  23. const { intl, account, onAuthorize, onReject } = this.props;
  24. const content = { __html: account.get('note_emojified') };
  25. return (
  26. <div className='account-authorize__wrapper'>
  27. <div className='account-authorize'>
  28. <Permalink href={account.get('url')} to={`/accounts/${account.get('id')}`} className='detailed-status__display-name'>
  29. <div className='account-authorize__avatar'><Avatar account={account} size={48} /></div>
  30. <DisplayName account={account} />
  31. </Permalink>
  32. <div className='account__header__content' dangerouslySetInnerHTML={content} />
  33. </div>
  34. <div className='account--panel'>
  35. <div className='account--panel__button'><IconButton title={intl.formatMessage(messages.authorize)} icon='check' onClick={onAuthorize} /></div>
  36. <div className='account--panel__button'><IconButton title={intl.formatMessage(messages.reject)} icon='times' onClick={onReject} /></div>
  37. </div>
  38. </div>
  39. );
  40. }
  41. }