mirror of
https://github.com/elementor/hello-theme.git
synced 2026-07-28 15:06:20 +08:00
Some checks failed
Build / Build theme (push) Failing after 1s
Lint / ESLint (push) Failing after 0s
PHPUnit / File Diff (push) Failing after 1s
Lint / PHPCS (push) Failing after 41s
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - Test Results (push) Successful in 2s
* Setup prettier * Fix lint/format issues
46 lines
1.2 KiB
JavaScript
46 lines
1.2 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 />);
|
|
}
|
|
});
|