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