| 1 |
import { HelpCenter } from '@help-center/HelpCenter'; |
| 2 |
import { render } from '@shared/lib/dom'; |
| 3 |
import { isOnLaunch } from '@shared/lib/utils'; |
| 4 |
import domReady from '@wordpress/dom-ready'; |
| 5 |
import '@help-center/help-center.css'; |
| 6 |
import '@help-center/buttons'; |
| 7 |
|
| 8 |
const isInsideIframe = () => !!document.querySelector('body.iframe'); |
| 9 |
|
| 10 |
domReady(() => { |
| 11 |
if (isOnLaunch() || isInsideIframe()) return; |
| 12 |
const id = 'extendify-help-center-main'; |
| 13 |
if (document.getElementById(id)) return; |
| 14 |
const helpCenter = Object.assign(document.createElement('div'), { |
| 15 |
className: 'extendify-help-center', |
| 16 |
id, |
| 17 |
}); |
| 18 |
document.body.append(helpCenter); |
| 19 |
render(<HelpCenter />, helpCenter); |
| 20 |
}); |
| 21 |
|