Commit 42a62ec1 authored by Christos's avatar Christos

Merge branch 'default-image-render' into 'master'

default image render

See merge request !20
parents 97249f5e fa248b10
......@@ -101,6 +101,16 @@ const StyledWax = styled(Wax)`
}
`;
const renderImage = file => {
const reader = new FileReader();
return new Promise((accept, fail) => {
reader.onload = () => accept(reader.result);
reader.onerror = () => fail(reader.error);
// Some extra delay to make the asynchronicity visible
setTimeout(() => reader.readAsDataURL(file), 150);
});
};
class Editoria extends Component {
render() {
return (
......@@ -112,22 +122,8 @@ class Editoria extends Component {
placeholder="Type Something..."
theme="editoria"
layout="editoria"
fileUpload={file => {
let reader = new FileReader();
return new Promise((accept, fail) => {
reader.onload = () => accept(reader.result);
reader.onerror = () => fail(reader.error);
// Some extra delay to make the asynchronicity visible
setTimeout(() => reader.readAsDataURL(file), 1500);
});
}}
value="<p>hello</p>
<ul><li>listItem 1</li><li>listItem 2</li><li>listItem 3</li></ul>
<table>
<tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th></tr>
<tr><td>Jill</td><td>Smith</td><td>50</td></tr>
<tr><td>Eve</td><td>Jackson</td><td>94</td></tr>
</table>"
fileUpload={file => renderImage(file)}
value=""
>
{({ editor, view, ...props }) => (
<React.Fragment>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment