-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
44 lines (37 loc) · 960 Bytes
/
main.js
File metadata and controls
44 lines (37 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import './styles/main.scss';
import 'babel-polyfill';
import ContentEditor from './js/content-editor';
import React from 'react';
import { render } from 'react-dom';
import { store } from './js/store';
import { http } from './js/store/adapters';
const contentStore = store(http);
const style = `
div.outter {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
}
`;
const template = `
<div class="outter">
{content.image {className: 'some-class-other', width: '100%', height: '11em'}}
{content.image {className: 'some-class-other', width: '10em'}}
{content.text {headingLevel: 'h4', className: 'a-text'}}
{content.md {className: 'markdown-editor', width: '100%'}}
</div>
`;
function saveData(data) {
window.console.info(data);
}
const props = {
template,
componentsStyle: style,
onSave: saveData,
store: contentStore
};
render(
<ContentEditor { ...props } />,
document.querySelector('.editor')
);