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.
35 lines
854 B
35 lines
854 B
import { useCallback } from 'react'; |
|
|
|
import { FormattedMessage } from 'react-intl'; |
|
|
|
import { unblockDomain } from 'mastodon/actions/domain_blocks'; |
|
import { useAppDispatch } from 'mastodon/store'; |
|
|
|
import { Button } from './button'; |
|
|
|
export const Domain: React.FC<{ |
|
domain: string; |
|
}> = ({ domain }) => { |
|
const dispatch = useAppDispatch(); |
|
|
|
const handleDomainUnblock = useCallback(() => { |
|
dispatch(unblockDomain(domain)); |
|
}, [dispatch, domain]); |
|
|
|
return ( |
|
<div className='domain'> |
|
<div className='domain__domain-name'> |
|
<strong>{domain}</strong> |
|
</div> |
|
|
|
<div className='domain__buttons'> |
|
<Button onClick={handleDomainUnblock}> |
|
<FormattedMessage |
|
id='account.unblock_domain_short' |
|
defaultMessage='Unblock' |
|
/> |
|
</Button> |
|
</div> |
|
</div> |
|
); |
|
};
|
|
|