Skip to content
Snippets Groups Projects
Commit a0984e6f authored by chris's avatar chris
Browse files

clean up

parent 10f6e9a1
No related branches found
No related tags found
1 merge request!384Rename context view
import React, { Component } from 'react'; /* eslint-disable react/jsx-props-no-spreading */
/* eslint-disable react/no-array-index-key */
import React from 'react';
import { useInjection } from './WaxContext'; import { useInjection } from './WaxContext';
class UpdateView extends Component {
constructor(props) {
super(props);
this.state = {
view: this.props.view,
};
}
updateView(view) {
this.setState(view);
}
render() {
return this.props.children({ view: this.state.view });
}
}
const ComponentPlugin = renderArea => layoutProps => { const ComponentPlugin = renderArea => layoutProps => {
const { instance } = useInjection('Layout'); const { instance } = useInjection('Layout');
......
/* eslint-disable no-underscore-dangle */
import { injectable } from 'inversify'; import { injectable } from 'inversify';
export default
@injectable() @injectable()
export default class PmPlugins { class PmPlugins {
_plugins = new Map(); _plugins = new Map();
add(key, plugin) { add(key, plugin) {
this._plugins.set(key, plugin); this._plugins.set(key, plugin);
......
...@@ -16,8 +16,7 @@ const parser = schema => { ...@@ -16,8 +16,7 @@ const parser = schema => {
export default ({ placeholder, targetFormat, value, schema, plugins }) => { export default ({ placeholder, targetFormat, value, schema, plugins }) => {
let finalPlugins = []; let finalPlugins = [];
// eslint-disable-next-line no-shadow const createPlaceholder = () => {
const createPlaceholder = placeholder => {
return Placeholder({ content: placeholder }); return Placeholder({ content: placeholder });
}; };
...@@ -27,6 +26,7 @@ export default ({ placeholder, targetFormat, value, schema, plugins }) => { ...@@ -27,6 +26,7 @@ export default ({ placeholder, targetFormat, value, schema, plugins }) => {
]); ]);
const WaxOptions = { const WaxOptions = {
doc: {},
schema, schema,
plugins: finalPlugins, plugins: finalPlugins,
}; };
......
import { set, get, isArrayLikeObject } from 'lodash'; import { set, get, isArrayLikeObject } from 'lodash';
import { injectable, inject } from 'inversify'; import { injectable, inject } from 'inversify';
export default
@injectable() @injectable()
export default class Config { class Config {
_config = {}; _config = {};
constructor(@inject('config') config) { constructor(@inject('config') config) {
this._config = config; this._config = config;
......
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