mirror of
https://ghproxy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-07-23 12:37:39 +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
75 lines
1.7 KiB
JavaScript
75 lines
1.7 KiB
JavaScript
import CalendarDollarIcon from '@elementor/icons/CalendarDollarIcon';
|
|
import Box from '@elementor/ui/Box';
|
|
import IconButton from '@elementor/ui/IconButton';
|
|
import Skeleton from '@elementor/ui/Skeleton';
|
|
import { styled } from '@elementor/ui/styles';
|
|
import {
|
|
bindMenu,
|
|
bindTrigger,
|
|
usePopupState,
|
|
} from '@elementor/ui/usePopupState';
|
|
import {
|
|
QuotaBarGroup,
|
|
QuotaBarPopupMenu,
|
|
QuotaIndicator,
|
|
} from '@ea11y/components';
|
|
import { useSavedSettings, useSettings } from '@ea11y/hooks';
|
|
|
|
const QuotaBar = () => {
|
|
const { openSidebar } = useSettings();
|
|
const { loading } = useSavedSettings();
|
|
|
|
const quotaPopupMenuState = usePopupState({
|
|
variant: 'popover',
|
|
popupId: 'quotaPopupMenu',
|
|
});
|
|
|
|
if (loading) {
|
|
return (
|
|
<StyledBox>
|
|
<Skeleton width="100%" height={91} />
|
|
</StyledBox>
|
|
);
|
|
}
|
|
|
|
if (!openSidebar) {
|
|
return (
|
|
<StyledBox>
|
|
<StyledIconButton {...bindTrigger(quotaPopupMenuState)}>
|
|
<CalendarDollarIcon sx={{ color: 'common.black', marginRight: 1 }} />
|
|
<QuotaIndicator />
|
|
</StyledIconButton>
|
|
<QuotaBarPopupMenu
|
|
{...bindMenu(quotaPopupMenuState)}
|
|
closeAction={quotaPopupMenuState.close}
|
|
/>
|
|
</StyledBox>
|
|
);
|
|
}
|
|
|
|
return <QuotaBarGroup />;
|
|
};
|
|
|
|
export default QuotaBar;
|
|
|
|
const StyledBox = styled(Box)`
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: start;
|
|
justify-content: center;
|
|
|
|
margin: ${({ theme }) => theme.spacing(2)};
|
|
padding: 0;
|
|
|
|
border-radius: ${({ theme }) => theme.shape.borderRadius * 2}px;
|
|
`;
|
|
|
|
const StyledIconButton = styled(IconButton)`
|
|
padding: ${({ theme }) => theme.spacing(1)} ${({ theme }) => theme.spacing(2)};
|
|
background-color: ${({ theme }) => theme.palette.background.paper};
|
|
border-radius: 8px;
|
|
|
|
&:hover {
|
|
background-color: ${({ theme }) => theme.palette.action.hover};
|
|
}
|
|
`;
|