forked from MichaelYick/mailpoet
Add automation editor React setup
[MAILPOET-4287]
This commit is contained in:
parent
ed4fea6afa
commit
10c397d3e5
12
mailpoet/assets/js/src/automation/editor/index.tsx
Normal file
12
mailpoet/assets/js/src/automation/editor/index.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
function Editor(): JSX.Element {
|
||||
return <div>Automation editor</div>;
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const root = document.getElementById('mailpoet_automation_editor');
|
||||
if (root) {
|
||||
ReactDOM.render(<Editor />, root);
|
||||
}
|
||||
});
|
@ -1,5 +1,14 @@
|
||||
<% extends 'layout.html' %>
|
||||
|
||||
<% block container %>
|
||||
<div>Automation Editor</div>
|
||||
<div class="block-editor">
|
||||
<div id="mailpoet_automation_editor" class="block-editor__container"></div>
|
||||
</div>
|
||||
<% endblock %>
|
||||
|
||||
<% block after_javascript %>
|
||||
<script type="text/javascript">
|
||||
var mailpoet_automation_api = <%= json_encode(api) %>;
|
||||
</script>
|
||||
<%= javascript('automation_editor.js')%>
|
||||
<% endblock %>
|
||||
|
@ -282,6 +282,7 @@ const adminConfig = {
|
||||
],
|
||||
admin: 'webpack_admin_index.jsx',
|
||||
automation: 'automation/automation.tsx',
|
||||
automation_editor: 'automation/editor/index.tsx',
|
||||
newsletter_editor: 'newsletter_editor/webpack_index.jsx',
|
||||
form_editor: 'form_editor/form_editor.jsx',
|
||||
settings: 'settings/index.tsx',
|
||||
|
Loading…
x
Reference in New Issue
Block a user