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
93 lines
2.5 KiB
JavaScript
93 lines
2.5 KiB
JavaScript
import '../css/style.css';
|
|
import Box from '@elementor/ui/Box';
|
|
import DirectionProvider from '@elementor/ui/DirectionProvider';
|
|
import Grid from '@elementor/ui/Grid';
|
|
import { styled, ThemeProvider } from '@elementor/ui/styles';
|
|
import {
|
|
ConnectModal,
|
|
MenuItems,
|
|
OnboardingModal,
|
|
PostConnectModal,
|
|
UrlMismatchModal,
|
|
} from '@ea11y/components';
|
|
import {
|
|
useNotificationSettings,
|
|
useSavedSettings,
|
|
useSettings,
|
|
} from '@ea11y/hooks';
|
|
import { Sidebar, TopBar } from '@ea11y/layouts';
|
|
import Notifications from '@ea11y-apps/global/components/notifications';
|
|
import { mixpanelEvents, mixpanelService } from '@ea11y-apps/global/services';
|
|
import { useEffect } from '@wordpress/element';
|
|
import { usePluginSettingsContext } from './contexts/plugin-settings';
|
|
import PageContent from './page-content';
|
|
|
|
const App = () => {
|
|
const { hasFinishedResolution, loading } = useSavedSettings();
|
|
|
|
const { isConnected, isRTL, closePostConnectModal, isUrlMismatch } =
|
|
usePluginSettingsContext();
|
|
const { notificationMessage, notificationType } = useNotificationSettings();
|
|
const { selectedMenu } = useSettings();
|
|
|
|
useEffect(() => {
|
|
if (window.ea11ySettingsData?.planData?.user?.id) {
|
|
mixpanelService.init().then(() => {
|
|
mixpanelService.sendEvent(mixpanelEvents.pageView, {
|
|
page: 'Button',
|
|
});
|
|
});
|
|
}
|
|
}, [window.ea11ySettingsData?.planData?.user?.id]);
|
|
|
|
const selectedParent = MenuItems[selectedMenu?.parent];
|
|
const selectedChild = selectedMenu?.child
|
|
? selectedParent?.children[selectedMenu?.child]
|
|
: null;
|
|
|
|
return (
|
|
<DirectionProvider rtl={isRTL}>
|
|
<ThemeProvider colorScheme="light">
|
|
{isConnected !== undefined && !isUrlMismatch && !isConnected && (
|
|
<ConnectModal />
|
|
)}
|
|
{isConnected && !closePostConnectModal && <PostConnectModal />}
|
|
{isUrlMismatch && !isConnected && <UrlMismatchModal />}
|
|
<OnboardingModal />
|
|
|
|
<TopBar />
|
|
|
|
<StyledGrid>
|
|
<Sidebar />
|
|
|
|
<StyledContainer>
|
|
<PageContent
|
|
// Looks the best if we have both checks
|
|
isLoading={!hasFinishedResolution || loading}
|
|
page={selectedChild ? selectedChild?.page : selectedParent?.page}
|
|
/>
|
|
</StyledContainer>
|
|
</StyledGrid>
|
|
|
|
<Notifications message={notificationMessage} type={notificationType} />
|
|
</ThemeProvider>
|
|
</DirectionProvider>
|
|
);
|
|
};
|
|
|
|
export default App;
|
|
|
|
const StyledContainer = styled(Box)`
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: start;
|
|
`;
|
|
|
|
const StyledGrid = styled(Grid)`
|
|
height: calc(100% - 54.5px);
|
|
|
|
display: flex;
|
|
flex-direction: row;
|
|
`;
|