one-click-accessibility/modules/settings/assets/js/components/admin-top-bar/index.js
Nirbhay Singh 0dac7e1699
[APP-1198] [APP-1199] Quota bar and notices (#219)
* add: quota bar

* add: openLink helper function

* add: styled elements and visits link placeholder

* update: remove hover state from the box

* add: quota notices

* update: quota access and usage calculations

* add: logic to calculate plan usage

* update: move logic to calculate plan usage to hook

* add: todo note

* add: todos

* add: mixpanel events

* fix: hide quota bar when sidebar is minimized

* fix: settings panel was not expanding when sidebar is minimized

* update: text and structure of the bar

* update: quota calculation logic

* update: remove TODOs

* update: text and values

* fix: height of the container for icon settings

* update: golinks

* update: golinks
2025-03-17 10:23:26 +02:00

43 lines
1.2 KiB
JavaScript

import HelpIcon from '@elementor/icons/HelpIcon';
import AppBar from '@elementor/ui/AppBar';
import Link from '@elementor/ui/Link';
import Toolbar from '@elementor/ui/Toolbar';
import { styled } from '@elementor/ui/styles';
import { eventNames, mixpanelService } from '@ea11y/services';
import { __ } from '@wordpress/i18n';
import { GOLINKS } from '../../constants';
const StyledToolbar = styled(Toolbar)`
justify-content: end;
align-items: center;
flex-direction: row;
background-color: ${({ theme }) => theme.palette.background.default};
gap: 10px;
border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
`;
const AdminTopBar = () => {
return (
<AppBar position="static">
<StyledToolbar variant="dense">
<Link
color="secondary"
underline="hover"
href={GOLINKS.HELP}
target="_blank"
sx={{ display: 'inline-flex', alignItems: 'center', gap: 1 }}
aria-label={__('Help', 'pojo-accessibility')}
onClick={() =>
mixpanelService.sendEvent(eventNames.helpButtonClicked, {
source: 'Header',
})
}
>
<HelpIcon />
</Link>
</StyledToolbar>
</AppBar>
);
};
export default AdminTopBar;