mirror of
https://ghproxy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-07-21 12:16:59 +08:00
* [APP-1923] change remediation management (#411) * [APP-1988] Add tabs * [APP-1988][APP-1989] add tabs, remove menu item * [APP-1988][APP-1989] add tabs, remove menu item * [APP-1992] add empty state and tab navigation * [APP-1993][APP-1994] Change view for manage AI fixes, change delete confirmation modal * [APP-1996] add view for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1995] Color contrast form * [APP-2001] add global remediation logic (#415) * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2003] add disable across scans (#418) * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * add logs * add logs * add logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * change to theme value * change to theme value * change to theme value * change to theme value * add edit mode * add edit mode * add edit mode
61 lines
1.7 KiB
JavaScript
61 lines
1.7 KiB
JavaScript
import CircleCheckFilledIcon from '@elementor/icons/CircleCheckFilledIcon';
|
|
import Box from '@elementor/ui/Box';
|
|
import Chip from '@elementor/ui/Chip';
|
|
import Typography from '@elementor/ui/Typography';
|
|
import PropTypes from 'prop-types';
|
|
import { mixpanelEvents, mixpanelService } from '@ea11y-apps/global/services';
|
|
import { useScannerWizardContext } from '@ea11y-apps/scanner/context/scanner-wizard-context';
|
|
import {
|
|
StyledButton,
|
|
StyledButtonContainer,
|
|
} from '@ea11y-apps/scanner/styles/app.styles';
|
|
|
|
export const BlockButton = ({ title, count, block }) => {
|
|
const { setOpenedBlock, isResolved } = useScannerWizardContext();
|
|
|
|
const resolved = count === 0 || isResolved(block);
|
|
|
|
const handleClick = () => {
|
|
setOpenedBlock(block);
|
|
mixpanelService.sendEvent(mixpanelEvents.categoryClicked, {
|
|
page_url: window.ea11yScannerData?.pageData?.url,
|
|
issue_count: count,
|
|
category_name: title,
|
|
source: 'assistant',
|
|
});
|
|
};
|
|
|
|
return (
|
|
<StyledButton
|
|
variant="outlined"
|
|
color="secondary"
|
|
size="large"
|
|
fullWidth
|
|
onClick={handleClick}
|
|
>
|
|
<StyledButtonContainer
|
|
elevation={0}
|
|
variant="elevation"
|
|
color={resolved ? 'success' : 'default'}
|
|
>
|
|
<Box display="flex" alignItems="center" gap={0.5}>
|
|
<Typography variant="subtitle2" as="h4" color="text.primary">
|
|
{title}
|
|
</Typography>
|
|
|
|
{!resolved && (
|
|
<Chip label={count} color="error" variant="standard" size="tiny" />
|
|
)}
|
|
</Box>
|
|
|
|
{resolved && <CircleCheckFilledIcon color="success" />}
|
|
</StyledButtonContainer>
|
|
</StyledButton>
|
|
);
|
|
};
|
|
|
|
BlockButton.propTypes = {
|
|
title: PropTypes.string.isRequired,
|
|
count: PropTypes.number.isRequired,
|
|
block: PropTypes.string.isRequired,
|
|
};
|