mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 00:38:27 +00:00
[Glitch] Change design of confirmation modals in web UI
Port 8818748b90 to glitch-soc
Co-authored-by: Renaud Chaput <renchap@gmail.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -3,6 +3,8 @@ import { useCallback } from 'react';
|
||||
import { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import LockOpenIcon from '@/material-icons/400-24px/lock_open.svg?react';
|
||||
import { unblockDomain } from 'flavours/glitch/actions/domain_blocks';
|
||||
import { useAppDispatch } from 'flavours/glitch/store';
|
||||
|
||||
import { IconButton } from './icon_button';
|
||||
|
||||
@@ -13,17 +15,15 @@ const messages = defineMessages({
|
||||
},
|
||||
});
|
||||
|
||||
interface Props {
|
||||
export const Domain: React.FC<{
|
||||
domain: string;
|
||||
onUnblockDomain: (domain: string) => void;
|
||||
}
|
||||
|
||||
export const Domain: React.FC<Props> = ({ domain, onUnblockDomain }) => {
|
||||
}> = ({ domain }) => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleDomainUnblock = useCallback(() => {
|
||||
onUnblockDomain(domain);
|
||||
}, [domain, onUnblockDomain]);
|
||||
dispatch(unblockDomain(domain));
|
||||
}, [dispatch, domain]);
|
||||
|
||||
return (
|
||||
<div className='domain'>
|
||||
|
||||
Reference in New Issue
Block a user