diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-12-15 18:50:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 18:50:11 +0100 |
commit | 70415714f14e067aba518a105c96475db31fa124 (patch) | |
tree | 6a5e3bb7bec28809235025af12994b70c1082f5f /app/javascript/mastodon/features/account/components/follow_request_note.js | |
parent | 7a3c6bb88833a48253eb4795f4ee1127c6b5b5b0 (diff) |
Add follow request banner on account header (#20785)
* Add requested_by to relationship maps * Display whether an account has requested to follow you on their profile
Diffstat (limited to 'app/javascript/mastodon/features/account/components/follow_request_note.js')
-rw-r--r-- | app/javascript/mastodon/features/account/components/follow_request_note.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/account/components/follow_request_note.js b/app/javascript/mastodon/features/account/components/follow_request_note.js new file mode 100644 index 000000000..300ae4266 --- /dev/null +++ b/app/javascript/mastodon/features/account/components/follow_request_note.js @@ -0,0 +1,37 @@ +import React from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import { FormattedMessage } from 'react-intl'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import Icon from 'mastodon/components/icon'; + +export default class FollowRequestNote extends ImmutablePureComponent { + + static propTypes = { + account: ImmutablePropTypes.map.isRequired, + }; + + render () { + const { account, onAuthorize, onReject } = this.props; + + return ( + <div className='follow-request-banner'> + <div className='follow-request-banner__message'> + <FormattedMessage id='account.requested_follow' defaultMessage='{name} has requested to follow you' values={{ name: <bdi><strong dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} /></bdi> }} /> + </div> + + <div className='follow-request-banner__action'> + <button type='button' className='button button-tertiary button--confirmation' onClick={onAuthorize}> + <Icon id='check' fixedWidth /> + <FormattedMessage id='follow_request.authorize' defaultMessage='Authorize' /> + </button> + + <button type='button' className='button button-tertiary button--destructive' onClick={onReject}> + <Icon id='times' fixedWidth /> + <FormattedMessage id='follow_request.reject' defaultMessage='Reject' /> + </button> + </div> + </div> + ); + } + +} |