Skip to content
Snippets Groups Projects
Unverified Commit d0c607f9 authored by Chris Beer's avatar Chris Beer Committed by GitHub
Browse files

Merge pull request #30 from ProjectMirador/render-plugincomponents

Pass through PluginComponents so that add plugins elsewhere are also …
parents 10c50b78 c8c5ef23
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ function createWrapper(props) { ...@@ -8,7 +8,7 @@ function createWrapper(props) {
return shallow( return shallow(
<miradorAnnotationPlugin.component <miradorAnnotationPlugin.component
config={{}} config={{}}
TargetComponent={'<div>hello</div>'} TargetComponent="<div>hello</div>"
targetProps={{}} targetProps={{}}
addCompanionWindow={jest.fn()} addCompanionWindow={jest.fn()}
receiveAnnotation={jest.fn()} receiveAnnotation={jest.fn()}
......
...@@ -44,10 +44,11 @@ class ExternalStorageAnnotation extends Component { ...@@ -44,10 +44,11 @@ class ExternalStorageAnnotation extends Component {
/** */ /** */
render() { render() {
const { TargetComponent, targetProps } = this.props; const { PluginComponents, TargetComponent, targetProps } = this.props;
return ( return (
<TargetComponent <TargetComponent
{...targetProps} // eslint-disable-line react/jsx-props-no-spreading {...targetProps} // eslint-disable-line react/jsx-props-no-spreading
PluginComponents={PluginComponents}
/> />
); );
} }
...@@ -62,6 +63,7 @@ ExternalStorageAnnotation.propTypes = { ...@@ -62,6 +63,7 @@ ExternalStorageAnnotation.propTypes = {
adapter: PropTypes.func, adapter: PropTypes.func,
}), }),
}).isRequired, }).isRequired,
PluginComponents: PropTypes.array, // eslint-disable-line react/forbid-prop-types
receiveAnnotation: PropTypes.func.isRequired, receiveAnnotation: PropTypes.func.isRequired,
TargetComponent: PropTypes.oneOfType([ TargetComponent: PropTypes.oneOfType([
PropTypes.func, PropTypes.func,
...@@ -72,6 +74,7 @@ ExternalStorageAnnotation.propTypes = { ...@@ -72,6 +74,7 @@ ExternalStorageAnnotation.propTypes = {
ExternalStorageAnnotation.defaultProps = { ExternalStorageAnnotation.defaultProps = {
canvases: [], canvases: [],
PluginComponents: [],
}; };
/** */ /** */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment