mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-24 05:16:00 +08:00
* update: convert imports to named imports * add: function to check if current screen is settings page * update: rename elementor logo to app logo * add: url mismatch flow and components * update: remove obsolete code * Update modules/connect/rest/authorize.php Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com> * Update modules/settings/module.php Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com> * fix: modal was not closing * update: remove url mismatch notice * update: mismatch modal and rendering logic * add: toast notifications for errors * update: convert components into styled components * update: remove bottom border from the dialog * update: text copy * fix: logo alignment * update: renamed styled component --------- Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com>
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
import AppBar from '@elementor/ui/AppBar';
|
|
import Box from '@elementor/ui/Box';
|
|
import IconButton from '@elementor/ui/IconButton';
|
|
import Toolbar from '@elementor/ui/Toolbar';
|
|
import Typography from '@elementor/ui/Typography';
|
|
import { styled } from '@elementor/ui/styles';
|
|
import { useSettings } from '@ea11y/hooks';
|
|
import { AppLogo, SquareRoundedChevronsLeft } from '@ea11y/icons';
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
const StyledHeading = styled(Box)`
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
padding: 0;
|
|
width: 200px;
|
|
`;
|
|
|
|
const SidebarAppBar = () => {
|
|
const { openSidebar, setOpenSidebar } = useSettings();
|
|
|
|
return (
|
|
<AppBar position="static" color="transparent" elevation={0}>
|
|
<Toolbar
|
|
disableGutters
|
|
variant="dense"
|
|
sx={{ justifyContent: 'space-between' }}
|
|
>
|
|
<StyledHeading>
|
|
<AppLogo />
|
|
<Typography
|
|
variant="h6"
|
|
marginLeft={0.5}
|
|
display={!openSidebar ? 'none' : 'inherit'}
|
|
>
|
|
{__('Ally', 'pojo-accessibility')}
|
|
</Typography>
|
|
</StyledHeading>
|
|
|
|
<IconButton
|
|
color="inherit"
|
|
onClick={() => setOpenSidebar(!openSidebar)}
|
|
size="small"
|
|
>
|
|
<SquareRoundedChevronsLeft
|
|
role="img"
|
|
aria-label={__('Toggle sidebar', 'pojo-accessibility')}
|
|
sx={{ rotate: !openSidebar ? '180deg' : '0' }}
|
|
/>
|
|
</IconButton>
|
|
</Toolbar>
|
|
</AppBar>
|
|
);
|
|
};
|
|
|
|
export default SidebarAppBar;
|