mirror of
https://gh.wpcy.net/https://github.com/elementor/hello-theme.git
synced 2026-04-24 11:45:02 +08:00
Some checks failed
Build / Build theme (push) Has been cancelled
Lint / ESLint (push) Has been cancelled
Lint / PHPCS (push) Has been cancelled
PHPUnit / File Diff (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 7.4 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.0 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.1 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.2 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.5 - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress 6.6 - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress latest - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.3 (push) Has been cancelled
PHPUnit / PHPUnit - Test Results (push) Has been cancelled
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
import { createRoot } from 'react-dom/client';
|
|
import { ThemeProvider } from '@elementor/ui/styles';
|
|
import { Welcome } from './components/paper/welcome';
|
|
import { AdminProvider } from './providers/admin-provider';
|
|
import Box from '@elementor/ui/Box';
|
|
|
|
const App = () => {
|
|
return (
|
|
<ThemeProvider colorScheme="auto">
|
|
<AdminProvider>
|
|
<Box sx={ { pt: 2, pr: 2, pb: 1 } }>
|
|
<Welcome sx={ { width: '100%', px: 4, py: 3, position: 'relative' } } dismissable />
|
|
</Box>
|
|
</AdminProvider>
|
|
</ThemeProvider>
|
|
);
|
|
};
|
|
|
|
document.addEventListener( 'DOMContentLoaded', () => {
|
|
const container = document.getElementById( 'ehe-admin-cb' );
|
|
|
|
if ( container ) {
|
|
const { beforeWrap = false } = window.ehe_cb;
|
|
const { selector, before = false } = window.ehe_cb.data;
|
|
const headerEnd = document.querySelector( selector );
|
|
|
|
if ( headerEnd ) {
|
|
if ( beforeWrap ) {
|
|
const wrapElement = document.querySelector( '.wrap' );
|
|
if ( wrapElement ) {
|
|
wrapElement.insertAdjacentElement( 'beforebegin', container );
|
|
}
|
|
} else if ( before ) {
|
|
headerEnd.insertAdjacentElement( 'beforebegin', container );
|
|
} else {
|
|
headerEnd.insertAdjacentElement( 'afterend', container );
|
|
}
|
|
}
|
|
|
|
const root = createRoot( container );
|
|
root.render( <App /> );
|
|
}
|
|
} );
|
|
|