mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-21 07:09:20 +08:00
* [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * [APP-1747] add parent selector * Add mixpanel events * Add mixpanel events * Add mixpanel events * Exclude adminbar from css rule * Exclude adminbar from css rule * Exclude adminbar from css rule * Exclude adminbar from css rule * Exclude adminbar from css rule * Exclude adminbar from css rule * Update modules/remediation/assets/js/actions/styles.js Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com> * Exclude adminbar from css rule * Exclude adminbar from css rule * Update modules/scanner/assets/js/hooks/use-color-contrast-form.js Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com> * Exclude adminbar from css rule * Exclude adminbar from css rule * fix quota * fix quota * fix quota * fix quota * fix quota * fix quota * fix quota * fix linter * [APP-1825] Add remove/disable category * [APP-1825] Add remove/disable category --------- Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
import TrashIcon from '@elementor/icons/TrashIcon';
|
|
import Button from '@elementor/ui/Button';
|
|
import IconButton from '@elementor/ui/IconButton';
|
|
import { DeleteRemediationModal } from '@ea11y-apps/scanner/components/delete-remediation-modal';
|
|
import { useManageActions } from '@ea11y-apps/scanner/hooks/use-manage-actions';
|
|
import { useState } from '@wordpress/element';
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
export const DeleteButton = ({ group }) => {
|
|
const { deleteAllRemediationForPage } = useManageActions();
|
|
const [showDeleteModal, setShowDeleteModal] = useState(false);
|
|
|
|
const toggleDeleteModal = () => setShowDeleteModal(!showDeleteModal);
|
|
|
|
const onDeleteRemediation = async () => {
|
|
setShowDeleteModal(false);
|
|
await deleteAllRemediationForPage(group);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
{group ? (
|
|
<IconButton
|
|
size="tiny"
|
|
color="error"
|
|
aria-label={__('Remove all remediations', 'pojo-accessibility')}
|
|
onClick={toggleDeleteModal}
|
|
>
|
|
<TrashIcon fontSize="tiny" />
|
|
</IconButton>
|
|
) : (
|
|
<Button
|
|
startIcon={<TrashIcon />}
|
|
size="small"
|
|
color="error"
|
|
variant="text"
|
|
onClick={toggleDeleteModal}
|
|
>
|
|
{__('Remove all', 'pojo-accessibility')}
|
|
</Button>
|
|
)}
|
|
|
|
<DeleteRemediationModal
|
|
open={showDeleteModal}
|
|
hideConfirmation={toggleDeleteModal}
|
|
onDelete={onDeleteRemediation}
|
|
isMain
|
|
/>
|
|
</>
|
|
);
|
|
};
|