]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/components/domain.js
Address vulnerability from GHSA-3fjr-858r-92rw
[mastodon.git] / app / javascript / mastodon / components / domain.js
1 import React from 'react';
2 import PropTypes from 'prop-types';
3 import IconButton from './icon_button';
4 import { defineMessages, injectIntl } from 'react-intl';
5 import ImmutablePureComponent from 'react-immutable-pure-component';
6
7 const messages = defineMessages({
8 unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' },
9 });
10
11 export default @injectIntl
12 class Account extends ImmutablePureComponent {
13
14 static propTypes = {
15 domain: PropTypes.string,
16 onUnblockDomain: PropTypes.func.isRequired,
17 intl: PropTypes.object.isRequired,
18 };
19
20 handleDomainUnblock = () => {
21 this.props.onUnblockDomain(this.props.domain);
22 }
23
24 render () {
25 const { domain, intl } = this.props;
26
27 return (
28 <div className='domain'>
29 <div className='domain__wrapper'>
30 <span className='domain__domain-name'>
31 <strong>{domain}</strong>
32 </span>
33
34 <div className='domain__buttons'>
35 <IconButton active icon='unlock' title={intl.formatMessage(messages.unblockDomain, { domain })} onClick={this.handleDomainUnblock} />
36 </div>
37 </div>
38 </div>
39 );
40 }
41
42 }
This page took 0.084323 seconds and 5 git commands to generate.