mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-23 06:31:13 +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>
61 lines
1.6 KiB
JavaScript
61 lines
1.6 KiB
JavaScript
import CircleCheckFilledIcon from '@elementor/icons/CircleCheckFilledIcon';
|
|
import { Chip } from '@elementor/ui';
|
|
import Box from '@elementor/ui/Box';
|
|
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 handleClick = () => {
|
|
setOpenedBlock(block);
|
|
mixpanelService.sendEvent(mixpanelEvents.categoryClicked, {
|
|
page_url: window.ea11yScannerData?.pageData?.url,
|
|
issue_count: count,
|
|
category_name: title,
|
|
source: 'assistant',
|
|
});
|
|
};
|
|
|
|
const resolved = count === 0 || isResolved(block);
|
|
|
|
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">
|
|
{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,
|
|
};
|